Skip to content

moooon

Motir

Vibe your whole project. Bring an idea — Motir's three AI layers plan it, track it, and ship it, end to end. You're looking at Motir, built in Motir.

  • Vibe Project
  • Open Source
  • AI Agent
  • AI Loop
1
requests
0
upvotes
145
planned
1,361
shipped

Motir · Work items

MOTIR-280Done

5.2.8 Story tests — Vitest lifecycle/permission matrix + Playwright E2E (upload→panel→preview→delete, editor-sourced block, paged walk) + a11y sweep

Estimate: 30m · Depends on: 5.2.3, 5.2.5, 5.2.6

The story-closing verification (Principle #18): the end-to-end journey + the cross-cutting assertions the per-subtask tests don't own. (Epic-wide journeys stay Story 5.6; this is the 5.2-scoped story E2E, the 5.1.7 split.)

Vitest (integration, real Postgres): the full lifecycle walk — upload (panel + editor paths) → link states → body-edit relink/unlink → delete (role matrix × own/all × editor-sourced block) → GC sweep of the strays — asserting row/blob/revision-trail state at each step; the cross-workspace 404; the still-referenced-elsewhere guard from 5.2.3.

Playwright E2E (tests/e2e/attachments.spec.ts): as the PM — Attach two files (an image + a zip) via the button → cards render (thumbnail vs glyph) and the count updates; drag-drop a PDF → progress → card; click the image → lightbox (Esc returns focus) → Download visible; click the zip → downloads, no modal; paste an image into the description (edit form) → it appears editor-sourced with disabled delete + tooltip; delete the zip (confirm warns unrestorable) → gone + History entry. At-scale fixture (120+ attachments): first paint 50 + "Show more (N)", extend appends, list/strip toggle holds, no unbounded request. Role pass: member deletes own only; viewer sees no upload/delete. Run against the standing dev-server harness (OOM-safe reuse pattern).

Strict a11y sweep: the detail route with a populated panel + the open lightbox passes the strict axe config (extends the 2.4.6/5.1.7 sweep scope).

Acceptance criteria

  • The Vitest lifecycle + permission matrix covers every cell named above; pnpm test:coverage keeps all 5.2 files ≥90% branch/fn/line.
  • attachments.spec.ts passes the full journey + the scale walk + the role pass green in CI's Playwright lane (uploads use small fixture files; the blob store is the provisioned dev/CI token).
  • The strict axe sweep (panel populated + lightbox open) reports zero violations.
  • The Story 5.2 verification recipe runs clean top to bottom; shared-DB flake isolation respected.

Context refs

  • tests/attachments/attachments-service.test.ts (2.3.7) — extend, don't fork; tests/e2e/issue-detail-flow.spec.ts + _helpers/ conventions
  • The 5.1.7 story-test shape (the sibling split between story E2E and Epic story 5.6)
  • The E2E harness memories (standing dev server + inngest stub; Playwright upload fixtures); the strict-a11y sweep config
  • The Story 5.2 verification recipe — the checklist this subtask automates