Repository navigation
test(broadcasts): make calendar tests timezone-independent - #1176
Merged
realcodesiman merged 1 commit intoSep 14, 2026
Merged
Conversation
The suite pinned UTC instants in `schedulesAt` fixtures while the component groups rows by local day, so 3 of 27 tests failed outside a narrow timezone band. Converting the 11 fixtures alone is not enough: the `useFormatter` mock at the top of the file renders through `toISOString()`, which is UTC. While the fixtures were also UTC instants the two cancelled out; once a fixture is a local `09:15`, the mock prints its UTC projection (`07:15` at +02:00). The mock has to move to local as well, via the `format` from `date-fns` the file already imports. Verified 27/27 in seven zones: America/Hermosillo (-07), America/New_York (-04), America/Sao_Paulo (-03), UTC, Europe/Madrid (+02), Asia/Tokyo (+09), Pacific/Auckland (+12). Fixes ChatbotXIO#1153
realcodesiman
approved these changes
Sep 14, 2026
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
The suite pinned UTC instants in `schedulesAt` fixtures while the component groups rows by local day, so 3 of 27 tests failed outside a narrow timezone band. Converting the 11 fixtures alone is not enough: the `useFormatter` mock at the top of the file renders through `toISOString()`, which is UTC. While the fixtures were also UTC instants the two cancelled out; once a fixture is a local `09:15`, the mock prints its UTC projection (`07:15` at +02:00). The mock has to move to local as well, via the `format` from `date-fns` the file already imports. Verified 27/27 in seven zones: America/Hermosillo (-07), America/New_York (-04), America/Sao_Paulo (-03), UTC, Europe/Madrid (+02), Asia/Tokyo (+09), Pacific/Auckland (+12). Fixes #1153
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.
Fixes #1153.
broadcasts-calendar.test.tsxpins UTC instants in itsschedulesAtfixtures while the component groups rows by local day, so 3 of 27 tests fail outside a narrow timezone band.Converting the 11 fixtures alone is not enough, and this is the part worth flagging: the
useFormattermock at the top of the file renders throughtoISOString(), which is UTC. While the fixtures were also UTC instants the two cancelled out; once a fixture is a local09:15, the mock prints its UTC projection (07:15at +02:00). Fixtures-only takes the file from 3 failures west / 2 at +12 down to 1 failure in every zone except UTC — better, but now also broken inEurope/MadridandAsia/Tokyo, which passed before.So the mock moves to local as well, using the
formatfromdate-fnsthe file already imports.Verification
Run on this branch, one zone per run:
TZAmerica/HermosilloAmerica/New_YorkAmerica/Sao_PauloUTCEurope/MadridAsia/TokyoPacific/Aucklandultracite checkis clean. Test-only change — no production code touched.