Files
lage-chat-control/tests/e2e/nojs.spec.ts
T
Aurealibe 8ebc1da9e4 Rebuild du site sur Astro : i18n multilingue, faits verifies, Docker, CI, tests
- Astro statique, EN par defaut + /fr/ + /nl/, detection langue navigateur
- i18n par fichiers JSON, ajouter une langue = ajouter des traductions
- Contenu original porte a l'identique (diff d'inventaire par langue)
- Chronologie legislative corrigee sur sources primaires (PE, Conseil, votes)
- Timeline 23 precedents + observatoire 35 items + annuaire 66 outils FOSS,
  chaque affirmation verifiee et sourcee
- Zero requete tierce (teste), lisible JS coupe, axe WCAG AA x2 themes
- Version offline monofichier par langue a chaque build
- Docker multi-stage vers nginx + CSP stricte auto-generee
- CI GitHub Actions (SHA-pinnees) + verification hebdo des liens
- CONTRIBUTING : divulgation d'affiliation obligatoire, allowlist de
  domaines testee en CI
2026-07-10 03:52:49 +01:00

26 lines
1.2 KiB
TypeScript

import { expect, test } from '@playwright/test'
import { localePaths } from './helpers'
// Tor Browser "safest" mode is part of this site's audience: the FULL
// guide must be readable with JavaScript disabled. These run in the
// `nojs` project (javaScriptEnabled: false) — and still pass with JS on.
for (const path of localePaths) {
test(`guide fully readable without JS on ${path}`, async ({ page }) => {
await page.goto(path)
await expect(page.locator('h1')).toBeVisible()
// the guide's narrative sections are prerendered
const sections = page.locator('main section[id]')
expect(await sections.count()).toBeGreaterThan(10)
// <details> is native HTML — install steps must open with JS off
const details = page.locator('main details').first()
if ((await details.count()) > 0) {
await details.locator('summary').click()
await expect(details).toHaveAttribute('open', '')
}
// the language switcher is a native <details> dropdown: it opens and
// exposes plain links with no script at all
await page.locator('[data-lang-menu] summary').click()
await expect(page.locator('[data-lang-menu] a').first()).toBeVisible()
})
}