Files
ResumeSite/tests/e2e/i18n-switch.spec.ts
T
cesnimda 033c9ec315 test: vitest unit + playwright e2e suites; fix a11y, contrast, no-JS reveal
- vitest: dictionary parity, slug-map bijection, content-schema validation, JSON-LD (23)
- playwright: both locales, language-switch mapping (incl. no-JS), CV downloads,
  form happy-path + honeypot, axe a11y on 5 templates x 2 themes (23)
- fix: raise ink-faint + light accent to meet WCAG AA 4.5:1 (axe-verified)
- fix: gate reveal animations behind html.js so content is visible without JS
  (progressive enhancement - was hidden at opacity 0); scan reduced-motion path
- fix: validate contact form before the anti-bot time-trap (no false success)
- chore: ESLint node globals, typed diagram props, resvg fontFiles, prettier pass

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 06:14:18 +02:00

26 lines
1.1 KiB
TypeScript

import { test, expect } from '@playwright/test';
test.describe('language switch maps page↔page (J5, ROUTING_SPEC §3)', () => {
test('deep NO case-study URL → EN twin', async ({ page }) => {
await page.goto('/no/prosjekter/jobtrack/');
await page.locator('header [role="group"] a', { hasText: 'EN' }).first().click();
await expect(page).toHaveURL(/\/projects\/jobtrack\/$/);
await expect(page.locator('html')).toHaveAttribute('lang', 'en-GB');
});
test('EN about → NO twin with localised slug', async ({ page }) => {
await page.goto('/about/');
await page.locator('header [role="group"] a', { hasText: 'NO' }).first().click();
await expect(page).toHaveURL(/\/no\/om-meg\/$/);
});
test('switch works without JavaScript (links, not scripts)', async ({ browser }) => {
const context = await browser.newContext({ javaScriptEnabled: false });
const page = await context.newPage();
await page.goto('/no/erfaring/');
await page.locator('header [role="group"] a', { hasText: 'EN' }).first().click();
await expect(page).toHaveURL(/\/experience\/$/);
await context.close();
});
});