test(web): silence msw and jsdom log noise - #2524
Merged
Merged
Conversation
Add global MSW handlers for availability and email-updates, export scoped calendars defaults for opt-in tests, and redact jsdom Window/Event graphs from Bun expect diffs and console output.
Keep /calendars off globalHandlers to avoid calendarIds regressions and satisfy knip without exporting dead handler helpers.
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.
Summary
GET /calendars/availabilityandGET|PUT /user/email-updatesso authenticated mounts stop tripping unhandled-request errors.defaultCalendarsHandlers/defaultMockCalendarsfor opt-inserver.usewhen a test needs a default/calendarsresponse (not registered globally — a default success changes event-listcalendarIdsand breaks suite-order-dependent hook/grid tests).Window/Document/Node/Eventgraphs from Bunexpect()diffs and console output viautil.inspect.customplus an Event impl_globalObjectProxy.useStateinitializers.Simplicity
Implementation is already minimal: test-only MSW defaults, scoped calendars export for reuse, and jsdom inspect hooks with no production surface. No further simplification pass.
Automated validation
bun test:web— 1506 pass / 0 failbun lint— cleanIndependent review
Fresh diff review flagged global
/calendarsas a regression risk (8 failing tests when registered globally). Addressed by scoping calendars to exporteddefaultCalendarsHandlersinstead ofglobalHandlers; full suite green after change. jsdom Proxy/inspect hooks reviewed safe (no assertion regressions).Test plan
bun test:webbun test:web -- packages/web/src/views/Week/components/Grid/MainGrid/MainGrid.test.tsx packages/web/src/views/Week/components/Grid/MainGrid/MainGridBusyPeriods.test.tsx packages/web/src/views/Week/components/Grid/MainGrid/eventReadOnlyInteraction.test.tsx packages/web/src/views/Week/hooks/shortcuts/useWeekShortcuts.test.tsxbun lint