diff --git a/e2e/settings.spec.ts b/e2e/settings.spec.ts index 5846fa42546..581c25b5a70 100644 --- a/e2e/settings.spec.ts +++ b/e2e/settings.spec.ts @@ -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(); + } + }); +});