6.1.6 Story tests — compile-correctness matrix + injection fuzz + serialization properties + the build-a-filter E2E + a11y sweep
Estimate: 30m · Depends on: 6.1.4, 6.1.5
The story-closing verification (Principle #18; the 5.x split — the epic-wide journey stays Story 6.7).
Vitest (integration, real Postgres): the compile-correctness matrix — every (field-type × operator) cell against seeded data with known expected sets, under BOTH combinators, incl. relative date windows (frozen clock), empty/negation semantics, multi-CF join composition, and the tree-read parity cases (flat and tree match sets identical per AST); the injection fuzz suite (meta-chars, quote-smuggling, operator/field-id forgery, oversized ASTs → 422s; query-log assert: zero unparameterized user strings); the serialization properties (AST↔URL round-trip for generated ASTs; malformed-param recovery; facet-upgrade losslessness); the stale-referent matrix (deleted field/option/label/component each).
Playwright E2E (tests/e2e/filter-builder.spec.ts): the recipe journey — build the multi-row mixed filter (incl. a CF row + a label row + negation + a relative date), assert results + count, flip the combinator, round-trip the URL in a fresh context, upgrade from facets, hit zero-results + Clear all, and verify the Tree shows the same set with muted ancestors. a11y: the strict axe sweep over the open builder (every editor kind open once) + the applied state.
Acceptance criteria
- The matrix covers every registry cell (driven FROM the registry — a new entry without a matrix case fails the suite, the totality-guard pattern); fuzz + property suites green; tree/flat parity holds.
- The E2E journey passes green in CI's Playwright lane; the sweep reports zero violations.
- The Story 6.1 verification recipe runs clean top to bottom;
pnpm test:coveragekeeps all 6.1 files ≥90%.
Context refs
- The 5.5.1/6.1.1 totality-guard pattern (matrix driven from the registry)
tests/integration/+tests/e2e/conventions; the harness/selector memories- The Story 6.1 verification recipe — the checklist this automates
- Story 6.7 (the epic-wide remainder — do not duplicate)