Move nine more misplaced unit tests to their source mirror paths - #1781
Merged
Conversation
A third batch of the same cleanup: nine test files each exercise exactly one source but lived under test/lib or another folder that mirrors nothing, so the coverage report counted their sources as untested. Moving each to its source's mirror location flips nine sources from untested to mirrored (336 -> 345): ledger-picker-dates.test.ts -> test/features/admin/ledger/picker-dates.test.ts server-refunds-ui.test.ts -> test/features/admin/attendee-page-data/refunds-ui.test.ts error-envelope.test.ts -> test/features/api/cors/error-envelope.test.ts booking-responses.test.ts -> test/features/api/helpers/booking-responses.test.ts server-attendee-form/errors... -> test/shared/db/attendees/api/errors.test.ts server-attendee-form/overbooking -> test/shared/db/attendees/atomic-update/overbooking.test.ts server-questions/question-delete -> test/shared/db/questions/tables/question-delete.test.ts listings/detail-roster.test.ts -> test/ui/templates/admin/listings/overview/detail-roster.test.ts templates/public/view-page... -> test/ui/templates/tickets/view-page.test.ts Eight of these imported a shared sibling helper by a relative path (./helpers.ts). Since the helper is used by many other tests in its original folder, it stays put; each moved test now reaches it through the existing #test/ alias instead, so the helper import resolves from the new location. No test logic changed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8LbdSHz7eSXyqY3GBSAgw
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughAdded ledger picker-date tests for empty, bounded, and today-extended ranges, and updated several test files to import shared helpers through centralized aliases. ChangesTest maintenance
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This was referenced Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A third batch of the same low-risk cleanup as #1765 and #1769. Nine unit-test files each check a single piece of code in
src/, but sat undertest/lib/(or another folder that mirrors nothing), so the coverage report treated those pieces of source as having no test at all — even though a working test existed.Each test moves to sit alongside the code it checks:
ledger-picker-dates.test.tstest/features/admin/ledger/picker-dates.test.tsserver-refunds-ui.test.tstest/features/admin/attendee-page-data/refunds-ui.test.tsroutes/api/error-envelope.test.tstest/features/api/cors/error-envelope.test.tsroutes/api/booking-responses.test.tstest/features/api/helpers/booking-responses.test.tsserver-attendee-form/errors.test.tstest/shared/db/attendees/api/errors.test.tsserver-attendee-form/overbooking.test.tstest/shared/db/attendees/atomic-update/overbooking.test.tsserver-questions/question-delete.test.tstest/shared/db/questions/tables/question-delete.test.tslistings/detail-roster.test.tstest/ui/templates/admin/listings/overview/detail-roster.test.tstemplates/public/view-page.test.tstest/ui/templates/tickets/view-page.test.tsThe one small edit
Eight of these files imported a shared sibling helper by a relative path (
./helpers.ts, or./server-refunds-helpers.ts). That helper is used by many other tests still living in its original folder, so it stays where it is. Each moved test now reaches the helper through the existing#test/project alias instead of a relative path, so the import resolves correctly from the new location. That's the only change to any file — no test logic was touched. (ledger-picker-dates.test.tshad no relative imports and moved untouched.)Result
The unit-test report now recognises nine more sources as having a mirrored test (336 → 345, 37.0%), and nine fewer as untested. All nine moved tests were run in their new locations and pass (0 failures); typecheck and lint are clean.
As with the earlier batches, these are the safe subset of the
deno task unit-tests-reportmisplaced-tests list. Remaining candidates that still need more than a rename — thebooking/modelandstripegroups, which share a widely-imported fixture — were left for a later round.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q8LbdSHz7eSXyqY3GBSAgw
Generated by Claude Code
Summary by CodeRabbit