Files
freeCodeCamp/e2e/cert-username-case-navigation.spec.ts
Sem Bauke 30bcf40381 feat(client): migrate to Gatsby v5 and React 18 (#65729)
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2026-02-11 19:15:32 +01:00

39 lines
1.2 KiB
TypeScript

import { execSync } from 'child_process';
import { expect, test } from '@playwright/test';
test.describe('Public profile certifications', () => {
test('Should show claimed certifications if the username has all lowercase characters', async ({
page
}) => {
await page.goto('/certifieduser');
await expect(
page.getByRole('link', { name: /View.+Certification/ })
).toHaveCount(25);
});
test('Should show claimed certifications if the username includes uppercase characters', async ({
page
}) => {
await page.goto('/certifieduser');
await page.getByRole('button', { name: 'Edit my profile' }).click();
await page.getByLabel('Username').fill('CertifiedBoozer');
await page.getByRole('button', { name: 'Save' }).nth(0).click();
await expect(page.getByTestId('flash-message')).toContainText(
/We have updated your username to/
);
await page.goto('/certifiedboozer');
await page.waitForURL('/certifiedboozer');
await expect(
page.getByRole('link', { name: /View.+Certification/ })
).toHaveCount(25);
});
test.afterAll(() => {
execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
});
});