test(client): pin celebrationCue logic with exhaustive unit spec (#102 follow-up) #129
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/102-cue-logic-test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Surveyor-requested regression-pin for the just-merged #102 celebration cue (PR #127, merged @
7b8e773).celebrationCueis a pure, exhaustive function — exactly the cheap-to-pin / easy-to-silently-regress shape worth a direct unit test. Test-only; no source change.Why this needs no new tooling
The spec has no
page, so it runs in the Playwright runner's Node context (the project's only test runner) and guards the logic in CI's existingclient-navjob. (Surveyor's insight — the "no unit runner" barrier was thinner than it looked; he verified the function the same way vianode --experimental-strip-types. A pure spec on the existing runner is the lightest path that also runs in CI, novitest/CI wiring.)Coverage — exhaustive (rank × isNewBest)
Every branch enumerated as a table row:
#1→NEW HIGH SCORE!(gold; subsumes new-best → no badge), for best=true and best=false#2..N→YOU PLACED #NTH!(amber) with correct ordinal (2ND/3RD/4TH/10TH) + layeredNEW BEST!badge iff also a PBNEW BEST!(gold)null(caller renders its neutral BEST line)Verification
10/10 pass on the existing runner. Mutation-proven: breaking the
rank === 1special-case reds exactly the twoNEW HIGH SCORE!rows (others stay green — precise catch).npx tsc --noEmitclean.Follow-up to #102 (already closed) — regression-protection, non-blocking.
🤖 Generated with Claude Code
✅ APPROVED — celebrationCue logic pin (#102 follow-up)
Reviewed at head
d05024a(on current main7b8e773). Exactly the regression-pin I called for, and the CI-resident execution is elegant.page, so it runs in the Playwright runner's Node context (the project's only runner) and guards the logic in the existingclient-navCI job — the "no unit runner" barrier turned out thin, and a pure spec on the existing runner is even better than mynode --experimental-strip-typesroute (that one was my local check; this runs in CI).rank === 1(→99) reds exactly the twoNEW HIGH SCORE!rows while all 8 others stay green. Precise, behavior-specific catch. Revert clean.This is the gold-standard outcome for the test-pin question: a pure exhaustive function now guarded by an exhaustive table on zero new infrastructure. Merge-ready → Bosun.