Ask: Add a direct unit test for transitionIssueStatus covering the two-status-labels edge case it exists to fix.
Expected files: src/lib/issue-status.test.ts
Problem: src/lib/issue-status.ts documents that the helper exists because five API routes used to remove only the first status/* label, leaving stale labels on GitHub while the Prisma cache moved on. The helper's core guarantee — remove every existing status/* label, add exactly the target — is only exercised indirectly through route tests whose fixtures always start from a single status label. No test feeds it two status labels, so the exact regression the helper was written to prevent could return unnoticed. The file has no dedicated test suite at all.
Evidence:
src/lib/issue-status.ts: transitionIssueStatus removes all status/* labels before adding the target
src/app/api/issues/status/route.test.ts: fixtures are single-status only (["status/backlog"], ["status/in-progress"], ["priority/p0","status/backlog","type/bug"]); the multi-status case never appears
- No
src/lib/issue-status.test.ts exists
Acceptance:
- A test calls
transitionIssueStatus with labels containing two status/* entries (e.g. ["status/backlog","status/in-progress","type/bug"]) and asserts both are removed via removeIssueLabel and only the target is added
- Assert the returned label set is
non-status labels + target
- Full suite still passes
Ask: Add a direct unit test for transitionIssueStatus covering the two-status-labels edge case it exists to fix.
Expected files: src/lib/issue-status.test.ts
Problem:
src/lib/issue-status.tsdocuments that the helper exists because five API routes used to remove only the firststatus/*label, leaving stale labels on GitHub while the Prisma cache moved on. The helper's core guarantee — remove every existingstatus/*label, add exactly the target — is only exercised indirectly through route tests whose fixtures always start from a single status label. No test feeds it two status labels, so the exact regression the helper was written to prevent could return unnoticed. The file has no dedicated test suite at all.Evidence:
src/lib/issue-status.ts:transitionIssueStatusremoves allstatus/*labels before adding the targetsrc/app/api/issues/status/route.test.ts: fixtures are single-status only (["status/backlog"],["status/in-progress"],["priority/p0","status/backlog","type/bug"]); the multi-status case never appearssrc/lib/issue-status.test.tsexistsAcceptance:
transitionIssueStatuswith labels containing twostatus/*entries (e.g.["status/backlog","status/in-progress","type/bug"]) and asserts both are removed viaremoveIssueLabeland only the target is addednon-status labels + target