test(issue-time): stabilize relative age fixtures across DST - #2163
Merged
Merged
Conversation
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.
Problem
The issue-age test creates “months ago” and “days ago” timestamps by changing local calendar dates. A daylight-saving transition can shift the elapsed duration by an hour, making the shared relative-time formatter correctly return
10mo agowhile the test expects11mo ago. This intermittently fails the full frontend CI suite, including the conversation Sources PR.Solution
Build these test fixtures from elapsed milliseconds, matching the formatter's 24-hour day and 30-day month definitions. Production behavior is unchanged; the test now measures the intended duration in every time zone.
Potential risks
This changes only test fixture construction. It does not change user-visible date formatting, stored data, APIs, or runtime behavior. The full repository CI suite remains to be observed on this PR before merge; the targeted test passed in both a daylight-saving time zone and UTC.
Verification
TZ=America/Los_Angeles pnpm test src/modules/WorkStation/CodeEditor/Panels/EditorPrimarySidebar/hooks/__tests__/workstationIssueHelpers.test.ts— 29 passed.TZ=UTC pnpm test src/modules/WorkStation/CodeEditor/Panels/EditorPrimarySidebar/hooks/__tests__/workstationIssueHelpers.test.ts— 29 passed.pnpm typecheck:fast— passed.git diff --cached --check— passed.