Ask: Add a co-located route.test.ts for POST /api/pr-fix-queue/requeue covering auth, parse validation, the not-found path, and the happy requeue.
Expected files: src/app/api/pr-fix-queue/requeue/route.test.ts, src/app/api/pr-fix-queue/requeue/route.ts
Problem: POST /api/pr-fix-queue/requeue is the only mutating API route under src/app/api/ without a co-located route.test.ts (excluding src/app/api/auth/[...nextauth], which is NextAuth's own handler). It is mutating (calls requeuePrFixItem over prisma, performs a status transition, and writes audit history). It is also a recently-introduced feature (commit 8790ae7 "Route BLOCKED PR-fix items into NEEDS_HUMAN lane and add a requeue action"), so its surface is not yet battle-tested and there is no regression net. Issue #416 set the co-located-test convention that every other route follows; this one slipped. The route's input parser (parseRequeuePrFixInput) is reached in many places (requeue from operator UI, automated tombstones), and a parse-error regression here would block the entire pr-fix-surfacing pipeline.
Evidence:
Acceptance: Add src/app/api/pr-fix-queue/requeue/route.test.ts covering: 401 unauthenticated, 400 invalid JSON, 400 parse error (missing fields), 404 item not found, 200 happy path (requeuePrFixItem returns the item, JSON response includes the item). Test must run green under npm test and follow the same vi.mock pattern used by neighbouring pr-fix-queue tests.
Ask: Add a co-located route.test.ts for POST /api/pr-fix-queue/requeue covering auth, parse validation, the not-found path, and the happy requeue.
Expected files: src/app/api/pr-fix-queue/requeue/route.test.ts, src/app/api/pr-fix-queue/requeue/route.ts
Problem: POST /api/pr-fix-queue/requeue is the only mutating API route under src/app/api/ without a co-located route.test.ts (excluding src/app/api/auth/[...nextauth], which is NextAuth's own handler). It is mutating (calls requeuePrFixItem over prisma, performs a status transition, and writes audit history). It is also a recently-introduced feature (commit 8790ae7 "Route BLOCKED PR-fix items into NEEDS_HUMAN lane and add a requeue action"), so its surface is not yet battle-tested and there is no regression net. Issue #416 set the co-located-test convention that every other route follows; this one slipped. The route's input parser (parseRequeuePrFixInput) is reached in many places (requeue from operator UI, automated tombstones), and a parse-error regression here would block the entire pr-fix-surfacing pipeline.
Evidence:
find src/app/api -name 'route.ts'returns 59 files;find src/app/api -name 'route.test.ts'returns 57. The only missing tests are requeue (mutating) and auth/[...nextauth] (NextAuth handler — exempt).Acceptance: Add src/app/api/pr-fix-queue/requeue/route.test.ts covering: 401 unauthenticated, 400 invalid JSON, 400 parse error (missing fields), 404 item not found, 200 happy path (requeuePrFixItem returns the item, JSON response includes the item). Test must run green under
npm testand follow the same vi.mock pattern used by neighbouring pr-fix-queue tests.