Files
freecodecamp--freecodecamp/e2e/show-cert-from-superblock.spec.ts
wehub-resource-sync dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:53 +08:00

53 lines
1.5 KiB
TypeScript

import { execSync } from 'child_process';
import { expect, test } from '@playwright/test';
test.describe('When the user HAS NOT claimed their cert', () => {
test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeAll(() => {
execSync('node ../tools/scripts/seed/seed-demo-user');
});
test.beforeEach(async ({ page }) => {
await page.goto('/learn/front-end-development-libraries');
});
test('should see a "Go to settings to claim your certification" pointing to "/settings#cert-front-end-development-libraries"', async ({
page
}) => {
const link = page.getByRole('link', {
name: 'Go to settings to claim your certification'
});
await expect(link).toBeVisible();
await expect(link).toHaveAttribute(
'href',
'/settings#cert-front-end-development-libraries'
);
});
test.afterAll(() => {
execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
});
});
test.describe('When the user HAS claimed their cert', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/learn/front-end-development-libraries');
});
test('should see a "Show Certification" link pointing to "/certification/certifieduser/front-end-development-libraries"', async ({
page
}) => {
const link = page.getByRole('link', {
name: 'Show Certification'
});
await expect(link).toBeVisible();
await expect(link).toHaveAttribute(
'href',
'/certification/certifieduser/front-end-development-libraries'
);
});
});