1.3 KiB
1.3 KiB
T063 — Live contract 與相容回歸
Status:
doneMilestone:M6Est. change:~190 test lines
Goal
完成後,mock/live ScoutRepo 的排序、分頁、時間與錯誤語意一致,其他 listPosts 呼叫者不回歸。
Depends on
- T062
Inputs
- 讀取 / 依賴:
- 檔案:web Scout repos/tests、
apps/web/src/pages/TodayPage.tsx - 既有能力 / API:in-memory repo、MSW/fetch stub、legacy listPosts
- Spec 段落:§5.2、§6、§9 #16
- 檔案:web Scout repos/tests、
Outputs
程式變更(預期路徑)
| 路徑 | 動作 | 說明 |
|---|---|---|
apps/web/src/data/scoutRepo.contract.test.ts |
add | 同一案例套用 in-memory 與 live adapter。 |
apps/web/src/pages/ScoutPage.test.tsx |
edit | 補完整 live-shaped workflow。 |
apps/web/src/pages/TodayPage.test.tsx |
add/edit | 固定 legacy listPosts 相容。 |
行為變更
- 無新增產品行為;固定 mock/live 同契約與 Today 相容。
API / 契約(若有)
- page totals、unknown time、shortfall、404/409/503 在兩 adapter 等價。
Out of scope
- 不把 TodayPage 遷移到 run API。
Acceptance
- Spec #16 通過,TodayPage 可載入既有 posts endpoint。
- 指令:
cd apps/web && npm test && npm run lint && npm run build
Notes
若 live adapter 需 fetch stub,測試仍不得依賴網路。