Repository: freeCodeCamp/freeCodeCamp
File: e2e/hotkeys.spec.ts (TypeScript)

Code before:
  ).toBeVisible();

  await page.keyboard.press('e');
  await expect(getEditors(page)).toBeFocused();

  await getEditors(page).press('Escape');
  await page.keyboard.press('r');
  await expect(page.locator('.instructions-panel')).toBeFocused();
});

test('User can use shortcuts to navigate between frontend projects', async ({
  page
}) => {
  await page.goto(links.frontEnd1);
  await expect(page.locator('#editor-layout')).toBeFocused();
  await page.keyboard.press('Escape');
  await page.keyboard.press('n');

  await page.waitForURL(links.frontEnd2);
  await expect(page.locator('#editor-layout')).toBeFocused();
  await page.keyboard.press('p');
  await page.keyboard.press('Escape');
  await page.waitForURL(links.frontEnd1);
});

test('User can use shortcuts to navigate backend projects', async ({
  page
}) => {
  await page.goto(links.backEnd1);
  await expect(page.locator('#editor-layout')).toBeFocused();
  await page.keyboard.press('Escape');
  await page.keyboard.press('n');

  await page.waitForURL(links.backEnd2);
  await expect(page.locator('#editor-layout')).toBeFocused();
  await page.keyboard.press('p');
  await page.keyboard.press('Escape');
  await page.waitForURL(links.backEnd1);
});

test('User can use shortcuts to navigate videos', async ({ page }) => {
  await page.goto(links.video1);
  await expect(page.locator('#editor-layout')).toBeFocused();
  await page.keyboard.press('Escape');
  await page.keyboard.press('n');

  await page.waitForURL(links.video2);
  await expect(page.locator('#editor-layout')).toBeFocused();
  await page.keyboard.press('p');
  await page.keyboard.press('Escape');
  await page.waitForURL(links.video1);

Review comment (suggestion):
```suggestion
test('User can use shortcuts to navigate between backend projects', async ({
```

Code after:
  ).toBeVisible();

  await page.keyboard.press('e');
  await expect(getEditors(page)).toBeFocused();

  await getEditors(page).press('Escape');
  await page.keyboard.press('r');
  await expect(page.locator('.instructions-panel')).toBeFocused();
});

test('User can use shortcuts to navigate between frontend projects', async ({
  page
}) => {
  await page.goto(links.frontEnd1);
  await expect(page.locator('#editor-layout')).toBeFocused();
  await page.keyboard.press('Escape');
  await page.keyboard.press('n');

  await page.waitForURL(links.frontEnd2);
  await expect(page.locator('#editor-layout')).toBeFocused();
  await page.keyboard.press('p');
  await page.keyboard.press('Escape');
  await page.waitForURL(links.frontEnd1);
});

test('User can use shortcuts to navigate between backend projects', async ({
  page
}) => {
  await page.goto(links.backEnd1);
  await expect(page.locator('#editor-layout')).toBeFocused();
  await page.keyboard.press('Escape');
  await page.keyboard.press('n');

  await page.waitForURL(links.backEnd2);
  await expect(page.locator('#editor-layout')).toBeFocused();
  await page.keyboard.press('p');
  await page.keyboard.press('Escape');
  await page.waitForURL(links.backEnd1);
});

test('User can use shortcuts to navigate between video-based challenges', async ({
  page
}) => {
  await page.goto(links.video1);
  await expect(page.locator('#editor-layout')).toBeFocused();
  await page.keyboard.press('Escape');
  await page.keyboard.press('n');

  await page.waitForURL(links.video2);
  await expect(page.locator('#editor-layout')).toBeFocused();
  await page.keyboard.press('p');