/** * Wave-0 RED stubs for the lists API router. * * These stubs cover LIST-01 through LIST-04 behavior. * Downstream plans (02/03/06) replace the `it.todo` entries with real assertions * once the routes and DB are wired. * * Security focus: T-04-02 — scoped fan-out (private list events must NOT reach non-owner). * * Run: pnpm --filter @familysync/api test */ import { describe, it } from 'vitest' describe('GET /api/lists — LIST-01: returns only accessible lists', () => { it.todo('returns empty array when user has no lists') it.todo('returns lists owned by the current user') it.todo('returns lists shared with the current user via list_shares') it.todo('does NOT return private lists owned by another user') }) describe('POST /api/lists — LIST-01: create list', () => { it.todo('creates a list and inserts a list_shares row when isShared=true (D-01)') it.todo('creates a private list with no list_shares row when isShared=false') it.todo('rejects a name longer than 255 characters with 422') it.todo('returns 401 when called without a session') }) describe('PATCH /api/list-items/:id — LIST-02: per-field update', () => { it.todo('updates only the checked field when patch body is { checked: true } (D-08)') it.todo('updates only the text field when patch body is { text: "..." } (D-08)') it.todo('rejects a patch body with more than one field with 422') it.todo('returns 403 when caller does not own or share the parent list (T-04-02)') }) describe('PATCH /api/list-items/:id rank — LIST-03: fractional reorder', () => { it.todo('updates the rank field to the new fractional-indexing string') it.todo('rejects an empty rank string with 422') }) describe('SSE scoped fan-out — LIST-04 / T-04-02: private-list event isolation', () => { it.todo('publishListEvent on a private list does NOT emit to a subscriber for a different list') it.todo('publishListEvent on a shared list emits to all subscribers for that list') })