5.1.7 Story tests — Vitest service matrix + Playwright E2E (comment→mention→email, reply/edit/delete, show-more at scale) + strict a11y sweep
Estimate: 30m · Depends on: 5.1.5, 5.1.6
The story-closing verification (Principle #18 — review at the Story level): the end-to-end journey over the real stack plus the cross-cutting assertions the per-subtask tests don't own. (Epic-wide collaboration journeys remain Story 5.6; this is the 5.1-scoped story E2E, the same split Stories 2.3.10 / 2.4.6 / 4.7 use.)
Vitest (integration, real Postgres): the permission matrix end-to-end through the service (viewer/member/admin × add/edit-own/edit-all/delete-own/delete-all), the threading invariants (reply depth, root-delete cascade + revision record), mention parse→persist→event flow incl. the dropped-non-viewable case and the edit-diff (only-new-mentions) rule, and pagination edges (cursor walk, order flip, empty page, count).
Playwright E2E (tests/e2e/comments.spec.ts): signed in as the PM — add a comment; @-mention Bo via the picker (keyboard path: type, ↓, Enter); assert the posted chip AND the [EMAIL] dev-console line (mention notification to Bo, none to self); reply (auto-mention pre-filled) and assert single-level nesting; edit → Edited tag; delete the root → confirm names the reply count → thread gone. At-scale fixture (an issue seeded with 100+ comments — seed positions/fixtures per the E2E helper conventions): first paint shows 20 + "Show more comments (N older)", extending appends, the sort toggle flips, no unbounded request fires. Role pass: a viewer sees the thread, no composer. Run against the standing dev-server harness (the OOM-safe reuseExistingServer pattern).
Strict a11y sweep: the detail route WITH a populated, mention-bearing thread + open mention picker passes the strict axe config (extending the 2.4.6 sweep): labelled feed, keyboard-complete picker, text-conveyed state (Edited / timestamps / role notices), AA on the mention chip + confirm popover.
Acceptance criteria
- The Vitest matrix covers every permission cell + threading + mention-diff + paging edge named above;
pnpm test:coveragekeeps all 5.1 files ≥90% branch/fn/line. comments.spec.tspasses the full journey (comment → mention → email assert → reply → edit → delete-with-cascade-confirm) + the 100-comment scale walk + the viewer pass, green in CI's Playwright lane.- The strict axe sweep over the comments-populated detail route reports zero violations.
- The Story 5.1 verification recipe runs clean top to bottom; flaky-isolation rule respected (no reliance on sibling-session DB state).
Context refs
tests/e2e/issue-detail-flow.spec.ts+tests/e2e/_helpers/— the detail-page E2E conventions + selector gotchas (Combobox option name = label+secondary: match the email substring)tests/integration/service-test conventions (real DB,getSessionmock only)- The 2.4.6 strict-a11y sweep config (extend scope); the dev email console
[EMAIL]grep contract (1.1.6 / 1.6.3) - The E2E harness memories: standing dev server + inngest stub (OOM), shared-DB flake isolation