# Integration Test Instructions Feature: prerendering. HEAD `39dc456`; test results from CI run 599 on `2006fa0` and the test deployment of run 598 on `79b1a66`. ## Purpose Test the interactions between the three units: the start migration and script step (unit 1, produces `dist/client`), the display fallbacks (unit 2, what the HTML shows without or before JavaScript) and the hosting and targets (unit 3, the rules that serve the files and the scripts that upload and check them). Unit tests cannot show these: they need the real build output, a real browser, a real nginx and a real lftp. There is no service to start by hand. The browser suite (`pnpm e2e`) starts its own preview server and its own nginx, and cleans them up. In this stage no browser run was made locally; the results below are CI run 599. ```mermaid graph TD U1["Unit 1: prerender and script step"] U2["Unit 2: display fallbacks"] U3["Unit 3: server rules and deploy scripts"] DIST["dist/client: 12 HTML files and assets"] PREV["Preview server"] NGINX["Real nginx 1.24"] LFTP["Real lftp 4.9.2"] BROWSER["Chromium via Playwright"] TESTHOST["test.andreaslop.nl"] U1 -->|"produces"| DIST U2 -->|"changes HTML of"| DIST U3 -->|"serves"| DIST DIST --> PREV DIST --> NGINX DIST --> LFTP PREV --> BROWSER NGINX --> BROWSER LFTP -->|"upload in CI run 598"| TESTHOST classDef service fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; classDef client fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; classDef gateway fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; classDef external fill:#e9d5ff,stroke:#6b21a8,stroke-width:1px,color:#000; classDef database fill:#fbd38d,stroke:#92400e,stroke-width:1px,color:#000; class U1,U2,U3 service; class BROWSER client; class PREV,NGINX gateway; class LFTP,TESTHOST external; class DIST database; ``` Text alternative: units 1 to 3 all act on the build output `dist/client`, which the preview server, a real nginx and a real lftp consume; a Chromium browser tests the preview server and nginx, and lftp uploads to the test host. ## Test Scenarios ### Scenario 1: Unit 1 (prerendered HTML) → browser hydration - **Description**: the prerendered HTML and the client entry must give a hydrated page without console messages or CSP violations, on every page and width, including the `404.html` case (React error #418 race found in unit 1). - **Setup**: `pnpm build`. The suite starts `config/previewServer.ts`. - **Test Steps**: Chromium opens every page (hydration at 390 px and other widths), waits for hydration, and records console output and CSP violations. - **Expected Results**: no console message, no CSP violation, one title per page. - **Files**: `e2e/hydration.e2e.ts` (48 tests), `e2e/interaction.e2e.ts` (12), `e2e/smoke.e2e.ts` (3). - **Result (CI run 599)**: all passed. ### Scenario 2: Unit 1 (script step) → raw HTML - **Description**: the moved scripts must leave no inline executable script, no `on*=` attribute and no `javascript:` link, and the e-mail address must be in no output file. - **Test Steps**: fetch the raw HTML of each page and scan it. - **Expected Results**: none of the forbidden items; the CSP stays `script-src 'self'` plus Umami. - **Files**: `e2e/rawHtml.e2e.ts` (14 tests). - **Result (CI run 599)**: passed. ### Scenario 3: Unit 1 + unit 2 → what shows without JavaScript and before hydration - **Description**: with JavaScript off every page is visible, photos show through `