feat(04-01): install new deps + scaffold API test harness with Wave-0 RED stubs
- Add react-router@7, @dnd-kit/core, @dnd-kit/sortable, fractional-indexing to PWA - Add fractional-indexing to API (rank generation server-side) - ioredis NOT added (in-memory EventEmitter per RESEARCH Plan 02 justification) - Create apps/api/test/setup.ts with afterEach DB cleanup for list tables - Wire test.setupFiles in apps/api/vitest.config.ts - Add 4 Wave-0 RED stub test files (LIST-01/02/03/04, D-04, D-11, D-07) - All stubs run as todo, not import-error
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dnd-kit/core": "^6.3.1",
|
||||
"@dnd-kit/sortable": "^10.0.0",
|
||||
"@schedule-x/calendar": "4.6.0",
|
||||
"@schedule-x/calendar-controls": "4.6.0",
|
||||
"@schedule-x/event-modal": "4.6.0",
|
||||
@@ -18,10 +20,12 @@
|
||||
"@schedule-x/react": "4.1.0",
|
||||
"@schedule-x/theme-default": "4.6.0",
|
||||
"@tanstack/react-query": "5.101.0",
|
||||
"fractional-indexing": "^3.2.0",
|
||||
"ical.js": "2.2.1",
|
||||
"lucide-react": "1.17.0",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-router": "^7.17.0",
|
||||
"temporal-polyfill": "0.3.2",
|
||||
"vite-plugin-pwa": "^1.3.0",
|
||||
"zustand": "5.0.14"
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Wave-0 RED stubs for useListSSE hook.
|
||||
*
|
||||
* Covers D-11: bounded (capped exponential) backoff before showing the
|
||||
* "disconnected / updates paused" indicator.
|
||||
*
|
||||
* Tests use a mock EventSource that simulates connect/disconnect scenarios.
|
||||
* Downstream plans implement the actual useListSSE.ts hook.
|
||||
*
|
||||
* Run: pnpm --filter @familysync/pwa test
|
||||
*/
|
||||
|
||||
describe('useListSSE — D-11 bounded backoff', () => {
|
||||
it.todo('starts connected when EventSource fires the open event')
|
||||
it.todo('attempts to reconnect with exponential backoff on error')
|
||||
it.todo('stops retrying after the configured max attempts and sets status to disconnected')
|
||||
it.todo('resets backoff counter on successful reconnect')
|
||||
it.todo('calls onMessage callback with parsed event data when a message arrives')
|
||||
it.todo('cleans up EventSource on unmount')
|
||||
})
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Wave-0 RED stubs for ListDetail component.
|
||||
*
|
||||
* Covers D-07: optimistic update — the editing member's change shows instantly,
|
||||
* then reconciles against the server (rollback on rejection).
|
||||
*
|
||||
* Downstream plans implement the actual ListDetail.tsx component.
|
||||
*
|
||||
* Run: pnpm --filter @familysync/pwa test
|
||||
*/
|
||||
|
||||
describe('ListDetail — D-07 optimistic update + rollback', () => {
|
||||
it.todo('checking an item immediately updates the UI before server responds')
|
||||
it.todo('unchecking an item immediately updates the UI before server responds')
|
||||
it.todo('rolls back the checked state if the server PATCH returns an error')
|
||||
it.todo('adding an item shows it in the list immediately (optimistic insert)')
|
||||
it.todo('removes the optimistically-added item if the server POST returns an error')
|
||||
it.todo('completed items sink to the "completed" section at the bottom (D-05)')
|
||||
})
|
||||
Reference in New Issue
Block a user