refactor(04): move rank.test.ts into tests/ mirror dir (convention + dist hygiene)
src/lib/rank.test.ts was the last co-located API test. The API tsconfig excludes tests/ from the build, so all test files belong there; a test in src/ gets compiled into dist/ and vitest then runs the stale compiled copy (the source of phantom '22 todo' and dist sourcemap warnings). Moving it to tests/lib/ matches convention and leaves zero test files in src/, so the production build no longer emits test artifacts. Updated rank.test.ts path refs in phase-04 plan docs.
This commit is contained in:
@@ -21,7 +21,7 @@ dependency_graph:
|
||||
- apps/api/src/routes/lists.ts (item routes added, listItemsRouter exported)
|
||||
- apps/api/src/index.ts (listItemsRouter mounted at /api/list-items)
|
||||
- apps/api/src/lib/rank.ts (new)
|
||||
- apps/api/src/lib/rank.test.ts (new)
|
||||
- apps/api/tests/lib/rank.test.ts (new)
|
||||
- apps/api/tests/routes/lists.test.ts (item route tests added)
|
||||
- apps/pwa/src/api/listsClient.ts (item functions added)
|
||||
- apps/pwa/src/routes/ListDetail.tsx (placeholder replaced with real implementation)
|
||||
@@ -41,7 +41,7 @@ tech_stack:
|
||||
key_files:
|
||||
created:
|
||||
- apps/api/src/lib/rank.ts
|
||||
- apps/api/src/lib/rank.test.ts
|
||||
- apps/api/tests/lib/rank.test.ts
|
||||
- apps/pwa/src/components/ItemRow.tsx
|
||||
- apps/pwa/src/components/AddItemInput.tsx
|
||||
modified:
|
||||
@@ -80,7 +80,7 @@ metrics:
|
||||
|
||||
| Task | Name | Commit | Files |
|
||||
|------|------|--------|-------|
|
||||
| RED | Failing tests for item routes + rank helpers | b1dc9b8 | tests/routes/lists.test.ts, src/lib/rank.test.ts |
|
||||
| RED | Failing tests for item routes + rank helpers | b1dc9b8 | tests/routes/lists.test.ts, tests/lib/rank.test.ts |
|
||||
| GREEN | rank.ts + item endpoints + listItemsRouter + index.ts mount | 5e31514 | rank.ts, lists.ts, index.ts |
|
||||
| 2 | ListDetail + ItemRow + AddItemInput + listsClient item fns | 6da9c2a | 5 files (2 new, 3 modified) |
|
||||
|
||||
@@ -107,7 +107,7 @@ Ran against `http://localhost:5173/lists/284` (list id 284, Test Groceries) with
|
||||
## Verification Results
|
||||
|
||||
### API Tests
|
||||
- `tests/routes/lists.test.ts + src/lib/rank.test.ts`: 48 passed (0 failed)
|
||||
- `tests/routes/lists.test.ts + tests/lib/rank.test.ts`: 48 passed (0 failed)
|
||||
- rank.ts pure unit tests: 8 passed (rankForAppend/rankBetween ordering/stability)
|
||||
- Item POST assigns rank "a0" for first item; subsequent items rank > prior — PASS
|
||||
- Per-field PATCH zod refine (exactly one field) — two-field body → 400 — PASS
|
||||
@@ -152,7 +152,7 @@ No new threat surface beyond the plan's trust boundaries.
|
||||
## Self-Check: PASSED
|
||||
|
||||
- `apps/api/src/lib/rank.ts` — FOUND
|
||||
- `apps/api/src/lib/rank.test.ts` — FOUND
|
||||
- `apps/api/tests/lib/rank.test.ts` — FOUND
|
||||
- `apps/api/src/routes/lists.ts` (POST /:id/items route) — FOUND
|
||||
- `apps/api/src/index.ts` (listItemsRouter mounted at /api/list-items) — FOUND
|
||||
- `apps/pwa/src/components/ItemRow.tsx` — FOUND
|
||||
|
||||
Reference in New Issue
Block a user