Repository Public
1# Testing23```bash4pnpm typecheck # tsc --noEmit5pnpm test # 111 unit / integration tests (vitest)6pnpm build && pnpm test:e2e # 54 end-to-end tests (Playwright, production build, throw-away database)7pnpm secret-scan8pnpm test:all # everything above9```1011No test touches the network or the production database. The forge is replaced by an in-process fake; the end-to-end server points its forge URL at a closed port.1213| Suite | What it proves |14|---|---|15| `tests/catalog.test.ts` | Seed content is valid, bilingual and references existing files; no seeded app claims a public channel; filters, search (accent-insensitive), sorting; draft → publish workflow; no card gets a download or TestFlight action without a verified destination. |16| `tests/releases.test.ts` | Discovery of public repositories only; idempotence; retries; failing repository reported; stale flag; invalid releases (missing checksum, foreign URL, empty file, bad tag); approval → published; checksum mismatch; forge download error; notarization policy; default version and rollback; automatic withdrawal when the asset changes; download route (bytes, range, 404 for unapproved / unknown / traversal / unpublished / tampered); counters; audit trail. |17| `tests/testflight.test.ts` | Invitation URL rule; valid public invitation; missing; internal; disabled; full; unverified; wrong platform; link check parsing; no fetch to foreign hosts. |18| `tests/security.test.ts` | Enrolment tokens (hashed, single live, expiring, absent from logs); forged attestation refused; challenge single-use and bound to the browser; lock-out; session expiry and idle timeout; 401 on every admin route; CSRF and origin checks; draft/publish through the API; uploads (re-encoding, non-images and SVG refused, traversal); webhook signature, staleness, replay; rate limiting. |19| `tests/maps.test.ts` | Map distribution route (`/maps/v1`) on a throw-away directory: documents 200 / 304 with SHA-256 ETags, package 200, 206 with exact bytes, `If-Range` match and mismatch, 416, ignored multi-range, HEAD, unlisted file, size mismatch, symbolic link leaving the root, traversal and odd segments, `pins.json`, empty distribution, rate limit. |20| `tests/maps-library.test.ts` | Maps page library (`src/lib/maps.ts`) on throw-away directories: regions sorted by download size with names, sizes, data date, version, licences and components; unknown capabilities dropped; region document missing, malformed or of another version; malformed entries skipped; symbolic links leaving the root; same root as the `/maps/v1` route; empty, missing or malformed catalogue is an empty library; decimal size units. |21| `e2e/public.spec.ts` | Homepage, universe interaction, reduced motion, catalog filters in the URL, all nine product pages, gallery keyboard navigation, byte-exact download of a fixture image, TestFlight states, comparison, French pages and hreflang, light/dark, 404, keyboard, sitemap/robots/metadata, security headers, no third-party request, axe WCAG 2.1 A/AA on ten page/appearance combinations. |22| `e2e/admin.spec.ts` | Closed without a session; invalid and reused enrolment links; passkey enrolment and sign-in with a virtual authenticator; CSRF; draft → preview → publish; invalid document refused; screenshot upload to public gallery; unverified TestFlight link never shown; release approval failing closed; withdrawal; sync error surfaced; announcements; audit trail. |23| `e2e/mobile.spec.ts` | Phone and tablet viewports: no horizontal overflow, navigation, touch selection in the universe, touch target sizes, responsive lazy images. |2425Two fixture applications exist only in the end-to-end database, to exercise states production does not have yet (a published macOS image, an open public beta).2627Not covered by automation: a real Touch ID / Face ID ceremony on the production domain, Safari and Firefox rendering, a real notarized DMG going through approval (none exists yet), a real public TestFlight page.28