Adds browser tests for the page without JavaScript

The tests cover every page without JavaScript, the menu by keyboard and pointer,
the fade-in at load and on scroll, and image requests per width. They found that
the closed menu's shoot links could take focus, which is fixed here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 23:50:17 +01:00
co-authored by Claude Opus 5.5
parent 01fcfeefea
commit 2754890370
13 changed files with 1229 additions and 23 deletions
@@ -331,7 +331,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
All files in `web/e2e/`, Dutch titles and comments like the neighbours, using the helpers in `e2e/support/` (`openPage`, `waitForHydration`, `eventually`, the preview server). Each test file ends with the checks named; failures that point at the design are STOP cases.
### Step 15: Raw HTML checks (BR-PRE-04, BR-NAV-02, V-D11) [ ]
### Step 15: Raw HTML checks (BR-PRE-04, BR-NAV-02, V-D11) [x]
- Executor: Sonnet.
- Implements: BR-PRE-01 to 04, 09; BR-NAV-01, 02; NFR-PR-SEC-01; V-D11.
@@ -339,7 +339,7 @@ All files in `web/e2e/`, Dutch titles and comments like the neighbours, using th
- Do: plain `fetch` of the preview server for the eleven pages and `/404.html`: in `<head>` exactly one `noscript` holding one `style`, with none of `</`, `url(`, `@import`; the assembled e-mail address (all forms used in `rawHtml.e2e.ts`) occurs nowhere; every `link[rel=preload][as=image]` href occurs once per file; every page with a `priority` photo (`/`, `/over-mij`, `/soorten-fotoshoots`, five shoot pages) has the preload with `fetchpriority="high"` for it; `/contact` has a link with `media="(min-width: 64em)"` for the aside photo and no other link for that file; `/portfolio` has React's link for tile 1 and exactly two `media` links (48em, 64em) for two different photos; the light logo preload is absent on every page except `/`; the contact portrait preload is absent; every `img[data-deferred]` is followed by a `noscript` containing an `img` with the same `alt`; no `<link rel="preload">` for a twin; `data-reveal="hidden"` occurs nowhere.
- Done when: the file passes against a current build (run in Step 21; at authoring time use `pnpm build && pnpm exec vitest run --config vitest.e2e.config.ts e2e/displayHtml.e2e.ts`).
### Step 16: No JavaScript on every page (FR-PR-11, 13) [ ]
### Step 16: No JavaScript on every page (FR-PR-11, 13) [x]
- Executor: Sonnet.
- Implements: BR-IMG-01, 02, 05; BR-NJS-01 to 08; BR-RVL-01; FR-PR-11, 13, 22; V-D12.
@@ -347,7 +347,7 @@ All files in `web/e2e/`, Dutch titles and comments like the neighbours, using th
- Do: for the eleven pages and the 404 page (`/onbekend`, `expectNotFound`), at 390 and 1280 px, `javaScript: false`, after `networkidle`: no visible `button` element; every `[data-reveal]` has computed opacity 1; every displayed `img` is `complete` with `naturalWidth` > 0; every `img[data-deferred]` has computed `display: none`; the number of displayed `img` with non-empty `alt` equals the number `getByRole('img')` finds (each photo once in the accessibility tree); no element matching `[data-email-pending]` or `[data-requires-js]` is displayed; no `a[href^="mailto:"]`; the footer has no heading named "Contact" and no empty column (checked with `getByRole('contentinfo')`); on `/`: no `hero-prev-button`, `hero-next-button`, `hero-pause-button` or `hero-progress` displayed and the first slide's photo displayed; on `/portfolio`: no `filter-bar` displayed, every tile link's `href` ends in an image file; the testimonials block shows one review (unit-1 V9 stays as is). Screenshots of every page and width are saved when `E2E_SCREENSHOT_DIR` is set and **looked at** by you (V-D12): list in the Record what looks wrong (empty areas, spacing left by hidden controls such as the filter bar margin or the gate's margin) without fixing design-level issues.
- Done when: green in Step 21; V-D12 filled with the findings.
### Step 17: Menu without JavaScript, by keyboard and pointer (FR-PR-12) [ ]
### Step 17: Menu without JavaScript, by keyboard and pointer (FR-PR-12) [x]
- Executor: Sonnet.
- Implements: BR-NAV-03 to 09; FR-PR-12; V-D4 (Chrome part), V-D9; NFR-PR-S-01.
@@ -361,7 +361,7 @@ All files in `web/e2e/`, Dutch titles and comments like the neighbours, using th
- Desktop submenu at 1280 x 800: chevron buttons not displayed; Tab (immediately after each key) from the "Soorten fotoshoots" link reaches Newborn to Portretten in order and then Contact; the panel is visible while focus is inside it and hidden after focus leaves.
- Done when: green in Step 21; V-D4 (Chrome only) and V-D9 filled; Firefox and Safari are recorded as not verifiable by agents (§ 5).
### Step 18: `Reveal` at load and on scroll (FR-PR-09, 10; V-D6) [ ]
### Step 18: `Reveal` at load and on scroll (FR-PR-09, 10; V-D6) [x]
- Executor: Sonnet.
- Implements: BR-RVL-01 to 10, 13, 14; FR-PR-09, 10; V-D6.
@@ -375,7 +375,7 @@ All files in `web/e2e/`, Dutch titles and comments like the neighbours, using th
- V-D6: at 320 x 568, 360 x 640, 412 x 823, 768 x 1024 and 1350 x 940, every `[data-reveal]` that is `hidden` after hydration has a height of at most `(innerHeight - 60) / 0.12`; list the tallest per page in the Record.
- Done when: green in Step 21; V-D6 filled.
### Step 19: Images and preloads per width (FR-PR-11, 21; V-D13, V-D15) [ ]
### Step 19: Images and preloads per width (FR-PR-11, 21; V-D13, V-D15) [x]
- Executor: Sonnet.
- Implements: BR-IMG-03; BR-PRE-01 to 12; BR-DTS-03; V-D13, V-D15.
@@ -390,7 +390,7 @@ All files in `web/e2e/`, Dutch titles and comments like the neighbours, using th
- V-D15: load `/portfolio?shoot=gezin` at 1350: after the filter applies and the page is scrolled to the bottom, no image URL was requested more than once.
- Done when: green in Step 21; V-D13 and V-D15 filled.
### Step 20: Existing browser tests whose expectations change [ ]
### Step 20: Existing browser tests whose expectations change [x]
- Executor: Sonnet.
- Implements: BR-DTS-04; V-D8.
@@ -401,7 +401,7 @@ All files in `web/e2e/`, Dutch titles and comments like the neighbours, using th
Everything else (V9: one review and the rest 1 px, `aria-hidden`, `inert`; V8; BR-HYD-20 no console error; price text; address absent) must pass unchanged. A failure outside this list is a STOP case.
- Done when: both files pass in Step 21; the Record lists each changed assertion with its reason, and V-D8 is filled.
### Step 21: Run all browser tests on a current build [ ]
### Step 21: Run all browser tests on a current build [x]
- Executor: Haiku.
- Implements: NFR-PR-Q-03; CP3.
@@ -522,6 +522,7 @@ Preconditions for all of Part H: Step 23 green; the main session has confirmed t
| `useReveal.test.tsx`: "assumes no reduced motion in the hydrating render, then follows the preference" | Reduced motion is read in the layout effect, not through Chakra's hook | BR-RVL-07 | 14 |
| `src/components/PortfolioGrid/PortfolioGrid.test.tsx` | `eagerCount={3}` becomes the new prop; eager tile assertions follow BR-PRE-08 | The prop is replaced | 14 |
| `src/components/portfolio/PortfolioGallery/PortfolioGallery.test.tsx` | Only an assertion that the first photos have no `src` before load, if there is one | `eagerCount={0}` is gone | 14 |
| `src/components/NoScript/noScriptCss.test.tsx` "group expanded" rule | Exact string split in two: the group keeps `grid-template-rows:1fr;transition:none`, `visibility:visible` moves to `#mobile-nav:target [id^="mobile-group-"]` | BR-NAV-06 against BR-NAV-08: a visible child of a hidden parent is focusable; owner ratified | 17 |
| `e2e/interaction.e2e.ts` V15 block | Comment only | The no-JavaScript page now shows content | 20 |
| `e2e/rawHtml.e2e.ts` link and image counts | Exclude `noscript` content from the counts | `DOMParser` parses `noscript` as markup | 20 |