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

Code before:
  'JavaScript Algorithms and Data Structures',
  'Front End Development Libraries',
  'Data Visualization',
  'Relational Database',
  'Back End Development and APIs',
  'Quality Assurance',
  'Scientific Computing with Python',
  'Data Analysis with Python',
  'Information Security',
  'Machine Learning with Python',
  'College Algebra with Python',
  'Foundational C# with Microsoft'
];

const legacyCerts = [
  'Front End',
  'Back End',
  'Data Visualization',
  'Information Security and Quality Assurance',
  'Full Stack'
];

test.use({ storageState: 'playwright/.auth/certified-user.json' });

let page: Page;

test.beforeAll(async ({ browser }) => {
  page = await browser.newPage();
  await page.goto('/certifieduser');
  await page.getByRole('button', { name: 'Preview custom 404 page' }).click();
});

test.afterAll(async () => {
  await page.close();
});

test.describe('Profile component', () => {
  test('renders the camper profile correctly', async () => {
    await expect(page.getByTestId(profilePageElements.camper)).toBeVisible();
    await expect(page.locator('div.avatar-camper')).toBeVisible();
    expect(await page.locator('.social-media-icons').count()).toEqual(0);
    await expect(
      page.getByRole('heading', { name: '@certifieduser' })
    ).toBeVisible();
    await expect(page.getByText('Full Stack User')).toBeVisible();
    expect(await page.locator('p.location').count()).toEqual(0);
    expect(await page.locator('p.supporter').count()).toEqual(0);
    // About is empty so only 1 of the 2 p.bio's should render
    expect(await page.locator('p.bio').count()).toEqual(1);
    await expect(page.getByText('Joined November 2020')).toBeVisible();
    await expect(

Review comment (suggestion):
```suggestion
```

We don't need the global `page`, because...

Code after:
  {
    name: 'JavaScript Algorithms and Data Structures',
    url: '/certification/certifieduser/javascript-algorithms-and-data-structures'
  },
  {
    name: 'Front End Development Libraries',
    url: '/certification/certifieduser/front-end-development-libraries'
  },
  {
    name: 'Data Visualization',
    url: '/certification/certifieduser/data-visualization'
  },
  {
    name: 'Relational Database',
    url: '/certification/certifieduser/relational-database-v8'
  },
  {
    name: 'Back End Development and APIs',
    url: '/certification/certifieduser/back-end-development-and-apis'
  },
  {
    name: 'Quality Assurance',
    url: '/certification/certifieduser/quality-assurance-v7'
  },
  {
    name: 'Scientific Computing with Python',
    url: '/certification/certifieduser/scientific-computing-with-python-v7'
  },
  {
    name: 'Data Analysis with Python',
    url: '/certification/certifieduser/data-analysis-with-python-v7'
  },
  {
    name: 'Information Security',
    url: '/certification/certifieduser/information-security-v7'
  },
  {
    name: 'Machine Learning with Python',
    url: '/certification/certifieduser/machine-learning-with-python-v7'
  },
  {
    name: 'College Algebra with Python',
    url: '/certification/certifieduser/college-algebra-with-python-v8'
  },
  {
    name: 'Foundational C# with Microsoft',
    url: '/certification/certifieduser/foundational-c-sharp-with-microsoft'
  }
];

const legacyCerts = [