Testing strategy
Testing protects, in order: tenant isolation, data integrity, the contract, the experience (TEST_STRATEGY).
| Layer | Tooling | Shape today |
|---|---|---|
| Unit (web/domain/mobile) | Vitest / Jest | ~250 tests: pure helpers, components over a stubbed transport |
| Integration (api/db/worker) | Vitest + real Postgres | ~215 tests incl. the negative-auth registry and fault-injection atomicity |
| End-to-end | Playwright against a built app | 35 journeys incl. axe scans on every major surface |
| Visual/primitives | Storybook (+a11y addon) | Primitives and pattern stories |
House rules that bite:
- E2E serves the last build — rebuild before running after web changes.
- Contract-changing PRs run
turbo run test --force(cache-masking incident). - Axe assertions wait for toasts to detach and entry animations to finish — both produce false contrast failures mid-transition.
- Keyboard journeys are asserted with real focus, not simulated class checks.