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:
Lucas Berger
2026-06-09 13:40:11 -04:00
parent ca9e97879f
commit 690f0b95c0
5 changed files with 20 additions and 20 deletions
@@ -16,7 +16,7 @@ dependency_graph:
affects:
- apps/pwa/src/components/ItemRow.tsx (useSortable + handle listeners)
- apps/pwa/src/routes/ListDetail.tsx (DndContext/SortableContext/useSensors/onDragEnd)
- apps/api/src/lib/rank.test.ts (precision + between-neighbors tests)
- apps/api/tests/lib/rank.test.ts (precision + between-neighbors tests)
- apps/api/tests/routes/lists.test.ts (5 LIST-03 ordering tests)
tech_stack:
added: []
@@ -32,7 +32,7 @@ key_files:
modified:
- apps/pwa/src/components/ItemRow.tsx (useSortable + handle listeners + D-14 transition)
- apps/pwa/src/routes/ListDetail.tsx (DndContext + SortableContext + useSensors + onDragEnd)
- apps/api/src/lib/rank.test.ts (2 new tests: precision + between-neighbors)
- apps/api/tests/lib/rank.test.ts (2 new tests: precision + between-neighbors)
- apps/api/tests/routes/lists.test.ts (5 new LIST-03 ordering tests)
decisions:
- "@dnd-kit/utilities not installed as direct dependency; transformToString inlined (5-line function identical to CSS.Transform.toString) to avoid adding a redundant dep"
@@ -85,7 +85,7 @@ Tested against `http://localhost:5173/lists/358` (list id 358, "Test Drag List",
## Verification Results
### API Tests
- `src/lib/rank.test.ts`: 10 passed (0 failed) — includes new precision test (100-iteration zipper inserts) and between-neighbors contract
- `tests/lib/rank.test.ts`: 10 passed (0 failed) — includes new precision test (100-iteration zipper inserts) and between-neighbors contract
- `tests/routes/lists.test.ts`: 45 passed (0 failed) — includes 5 new LIST-03 ordering tests
- Combined: 55 passed (0 failed)
@@ -118,7 +118,7 @@ No new threat surface introduced.
- `apps/pwa/src/components/ItemRow.tsx` — FOUND (useSortable imported and used)
- `apps/pwa/src/routes/ListDetail.tsx` — FOUND (DndContext, SortableContext, generateKeyBetween imported and used)
- `apps/api/src/lib/rank.test.ts` — FOUND (precision + between-neighbors tests present)
- `apps/api/tests/lib/rank.test.ts` — FOUND (precision + between-neighbors tests present)
- `apps/api/tests/routes/lists.test.ts` — FOUND (5 LIST-03 reorder tests added)
- Commit d49c5f1 (Task 1) — FOUND
- Commit ef4b115 (Task 2) — FOUND