Repository: freeCodeCamp/freeCodeCamp
File: e2e/independent-lower-jaw.spec.ts (TypeScript)

Code before:
  }

  await expect(
    page.getByTestId('independentLowerJaw-check-button')
  ).not.toBeFocused();
});

test('Should render UI correctly', async ({ page }) => {
  await page.goto(workshopChallengeUrl);

  await expect(
    page.getByTestId('independentLowerJaw-check-button')
  ).toBeVisible();
  await expect(
    page.getByTestId('independentLowerJaw-failing-hint')
  ).toHaveCount(0);
});

test('Displays desktop button copy for checking code', async ({ page }) => {
  await page.goto(workshopChallengeUrl);

  await expect(
    page.getByTestId('independentLowerJaw-check-button')
  ).toContainText('Check Your Code');
});

test('Hint text should not contain placeholders `fcc-expected`', async ({
  page,
  browserName,
  isMobile
}) => {
  await page.goto(penguinChallengeUrl);

  const editor = getEditors(page);
  await focusEditor({ page, isMobile });
  await clearEditor({ page, browserName, isMobile });
  await editor.fill(
    'body{background:linear-gradient(45deg, rgb(118, 201, 255), rgb(247, 255, 222));margin:0;padding:0;width:5%;height:100vh}'
  );

  await page.getByTestId('independentLowerJaw-check-button').click();

  const hintDescription = page.getByTestId('independentLowerJaw-failing-hint');
  await expect(hintDescription).toContainText(
    'You should give body a width of 100%, but found 5%',
    { useInnerText: true }
  );
});

test.describe('Unauthenticated user', () => {
  test.use({ storageState: { cookies: [], origins: [] } });

Review comment (suggestion):
```suggestion
```
Again, let's just check behaviour.

Code after:
    'body{background:linear-gradient(45deg, rgb(118, 201, 255), rgb(247, 255, 222));margin:0;padding:0;width:5%;height:100vh}'
  );

  await page.getByTestId('independentLowerJaw-check-button').click();

  const hintDescription = page.getByTestId('independentLowerJaw-failing-hint');
  await expect(hintDescription).toContainText(
    'You should give body a width of 100%, but found 5%',
    { useInnerText: true }
  );
});

test.describe('Unauthenticated user', () => {
  test.use({ storageState: { cookies: [], origins: [] } });

  test('Focuses on the sign in button when unauthenticated user completes a step', async ({
    page,
    browserName,
    isMobile
  }) => {
    await page.goto(workshopChallengeUrl);

    const editor = getEditors(page);
    await focusEditor({ page, isMobile });
    await clearEditor({ page, browserName, isMobile });
    await editor.fill(workshopPassingSolution);

    await page.getByTestId('independentLowerJaw-check-button').click();

    const signInLink = page.getByTestId('independentLowerJaw-signin-link');
    await expect(
      page.getByTestId('independentLowerJaw-submit-button')
    ).toBeVisible();
    await expect(signInLink).toBeVisible();
    await expect(
      page.getByTestId('independentLowerJaw-check-button')
    ).toHaveCount(0);
    await expect(signInLink).toBeFocused();
  });
});

test.describe('Authenticated user', () => {
  test.use({ storageState: 'playwright/.auth/certified-user.json' });

  test('Focuses on the submit button when authenticated user completes a step', async ({
    page,
    browserName,
    isMobile
  }) => {
    await page.goto(workshopChallengeUrl);