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

Code before:
    ).toBeVisible();
    await expect(
      page.getByText(translations.buttons['yes-please'])
    ).toBeVisible();
    await page
      .getByTestId(settingsTestIds.newEmail)
      .fill(settingsObject.testEmail);
    await page
      .getByTestId(settingsTestIds.confirmEmail)
      .fill(settingsObject.testEmail);
    const saveEmailButton = page.getByRole('button', {
      name: translations.settings.email.heading
    });
    await expect(saveEmailButton).toBeVisible();
    await saveEmailButton.click();
    const noWeeklyBtn = page.getByText(translations.buttons['no-thanks']);
    await expect(noWeeklyBtn).toBeVisible();
    await noWeeklyBtn.click();
    await expect(
      page
        .getByRole('group', { name: "Send me Quincy's weekly email" })
        .locator('p')
    ).toBeVisible();
  });

  test('Should validate Privacy Settings', async () => {
    await expect(
      page.getByRole('heading', {
        name: translations.settings.headings.privacy
      })
    ).toBeVisible();
    await expect(page.getByText(translations.settings.privacy)).toBeVisible();
    await expect(
      page
        .locator('p')
        .filter({ hasText: translations.settings.labels['my-profile'] })
    ).toBeVisible();
    await expect(
      page
        .locator('p')
        .filter({ hasText: translations.settings.labels['my-name'] })
    ).toBeVisible();
    await expect(
      page
        .locator('p')
        .filter({ hasText: translations.settings.labels['my-about'] })
    ).toBeVisible();
    await expect(
      page
        .locator('p')
        .filter({ hasText: translations.settings.labels['my-points'] })

Review comment (suggestion):
```suggestion
  test('Should validate Privacy Settings', async ({ page }) => {
```

Code after:
        .locator('p')
        .filter({ hasText: translations.settings.labels['my-points'] })
    ).toBeVisible();
    await expect(
      page
        .getByRole('group', {
          name: translations.settings.labels['my-certs']
        })
        .locator('p')
        .filter({ hasText: translations.settings.labels['my-certs'] })
    ).toBeVisible();
    await expect(
      page
        .getByRole('group', {
          name: translations.settings.labels['my-donations']
        })
        .locator('p')
        .filter({ hasText: translations.settings.labels['my-donations'] })
    ).toBeVisible();
    await expect(
      page
        .getByRole('group', {
          name: translations.settings.labels['my-heatmap']
        })
        .locator('p')
        .filter({ hasText: translations.settings.labels['my-heatmap'] })
    ).toBeVisible();
    await expect(
      page
        .getByRole('group', {
          name: translations.settings.labels['my-location']
        })
        .locator('p')
        .filter({ hasText: translations.settings.labels['my-location'] })
    ).toBeVisible();
    await expect(
      page
        .getByRole('group', {
          name: translations.settings.labels['my-timeline']
        })
        .locator('p')
        .filter({ hasText: translations.settings.labels['my-timeline'] })
    ).toBeVisible();
    await expect(
      page
        .getByRole('group', {
          name: translations.settings.labels['my-portfolio']
        })
        .locator('p')
        .filter({ hasText: translations.settings.labels['my-portfolio'] })
    ).toBeVisible();