test(e2e): scroll functionality for certification sections on /settings (#63038)

This commit is contained in:
Huyen Nguyen
2025-10-25 10:50:51 +07:00
committed by GitHub
parent 380003c142
commit 72544f2b92
+21
View File
@@ -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();
}
});
});