mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
test(e2e): scroll functionality for certification sections on /settings (#63038)
This commit is contained in:
@@ -2,6 +2,7 @@ import { execSync } from 'child_process';
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
import translations from '../client/i18n/locales/english/translations.json';
|
||||
import { currentCertifications } from '../shared/config/certification-settings';
|
||||
import { alertToBeVisible } from './utils/alerts';
|
||||
|
||||
const settingsTestIds = {
|
||||
@@ -321,3 +322,23 @@ test.describe('Settings - New User', () => {
|
||||
await expect(claimFullStackCertButton).toBeDisabled();
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Setting - Hash Navigation', () => {
|
||||
test('should scroll to certification sections when navigating with hash', async ({
|
||||
page
|
||||
}) => {
|
||||
for (const certSlug of currentCertifications) {
|
||||
await page.goto(`/settings#cert-${certSlug}`);
|
||||
|
||||
// Wait for scroll animation
|
||||
await page.waitForTimeout(300);
|
||||
|
||||
const certHeading = page.getByRole('heading', {
|
||||
name: translations.certification.title[certSlug],
|
||||
exact: true
|
||||
});
|
||||
|
||||
await expect(certHeading).toBeInViewport();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user