Documents build and test, operations and the approved privacy wording

Adds the build and test summary and instructions, the deployment and
monitoring plans, the production readiness checklist with the go-live
conditions, and the approved privacy draft (retention, controller).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 23:40:11 +01:00
co-authored by Claude Sonnet 5.5
parent a1444b7b2a
commit d8847d8c3b
12 changed files with 136 additions and 20 deletions
@@ -0,0 +1,31 @@
# Build and test summary: contact-form-cms
Date: 2026-11-10. Branch feature/contact-form-cms (a1444b7 plus later commits). Unit: contact-form (web only).
| Check | Result |
|---|---|
| `tsc` (typecheck in `pnpm build`) | clean |
| `pnpm lint` (ESLint incl. cms-client import boundary) | clean |
| `pnpm format:check` | clean |
| `pnpm test` (Vitest, 100% thresholds for pure functions) | 134 files, 1473 tests passed |
| cms-client package tests (copied) | 62 passed (boundary test included) |
| `pnpm build` + prerender | ok, 12 pages |
| E2E `contactForm.e2e.ts` + `hydration.e2e.ts` (real Chrome, built site, mocked `/api`) | 49 passed, 2 skipped with the switch off; the 2 "switch on" tests pass in a build with the switch on |
| `pnpm audit --prod` | no known vulnerabilities |
| Lighthouse mobile | all pages pass, except `/` performance 0.84 (threshold 0.85); same chance result as on master earlier (0.84); not a regression of this feature |
| Lighthouse desktop | all 12 pages pass |
| Real widget in real Chrome against the local ASF host (CMS 192.168.1.2:5291, captcha on, global endpoint) | form opens, widget loads and solves, POST 202, thank-you shown, no CSP violation, no console message |
## Requirement coverage
FR-CF-01..12 and NFR-CF-01..05 are covered by the unit/component tests (ContactForm, ContactPanel, useContactAvailability through the panel, securityHeaders, shootOptions), the e2e and the real-browser run. PBT (partial): label length 1-100 and uniqueness, JSON round trip with special characters, and the package's own property tests.
## Findings and decisions
- CSP: only `frame-src` with the exact hosts global, global0, global1 is needed; the real-browser run showed no violation without `connect-src`, `script-src` or `worker-src` additions (the widget's own fetches run inside its iframe).
- With the switch on, a `404` on the token route (form closed) logs a console message in the browser; the hydration e2e tests therefore run with the switch off and the switch-on behaviour has its own e2e with a mocked API.
- The package needed two small changes for ASF's stricter rules (explicit field instead of a constructor parameter property; a loop instead of a recursive `useCallback`); SLS-Main made them upstream (93fa729), so the copy is unchanged.
- Dev (StrictMode) asks for the token twice; the production build asks once.
## Not done / needs others
- Test of the form against a deployed ASF test host (needs the CMS branch merged and deployed; not requested yet).
- EU endpoint (`eu`, `eu0`, `eu1` in `frame-src`) is not tested; it needs a paid plan.
- Screen reader check by a person.
@@ -0,0 +1,3 @@
# Build instructions
From `web/`: `pnpm install --frozen-lockfile`, then `pnpm build` (typecheck, Vite build with prerender, inline scripts moved to files). Output in `web/dist/client`.
Local run against a CMS host: `API_PROXY_TARGET=http://<host>:<port> pnpm exec vite --host --port <port>` (no proxy without the variable). The form only talks to the server when `siteContent.contactForm.enabled` is `true`.
@@ -0,0 +1,3 @@
# Integration and e2e test instructions
1. Built site against a mocked API: `pnpm build` then `pnpm e2e` (real Chrome; `e2e/contactForm.e2e.ts` runs the "off" or "on" variant depending on the switch in `siteContent.ts`; to run the "on" variant build with the switch on locally and run only that file).
2. Real server: start the local ASF host (SLS Software - CMS: API `192.168.1.2:5291`, captcha on, smtp4dev for mail), run the dev server with `API_PROXY_TARGET=http://192.168.1.2:5291`, and open `/contact`. Expected: the notice disappears, the widget solves, sending gives the thank-you, the message appears in the ASF CMS admin and in smtp4dev. Check the browser console for CSP messages.
@@ -0,0 +1,2 @@
# Performance test instructions
Build with the switch off (as in production now) and run `pnpm lighthouse` (mobile) and `lhci autorun --config=lighthouserc.desktop.cjs` (desktop). The form and the captcha SDK are lazy chunks loaded only when the form is near the screen and open, so pages without a form in view load no new JavaScript. Known: `/` mobile performance varies around the 0.85 threshold (0.84 also on master).
@@ -0,0 +1,2 @@
# Unit and component test instructions
`pnpm test` (Vitest, jsdom, coverage thresholds). Relevant files: `src/components/ContactForm/ContactForm.test.tsx` (fake Friendly Captcha SDK, fake client), `src/components/ContactPanel/ContactPanel.test.tsx` (availability states), `src/lib/shootOptions.test.ts`, `config/securityHeaders.test.ts`, `src/cms-client/**/__tests__` (copied package tests incl. the boundary test). Property tests print their fast-check seed; rerun with `FC_SEED=<seed>`.