WS-NA: Temporal Migration (PR 1: Adds test coverage)#14099
Open
Isabella-Mitchell wants to merge 17 commits into
Open
WS-NA: Temporal Migration (PR 1: Adds test coverage)#14099Isabella-Mitchell wants to merge 17 commits into
Isabella-Mitchell wants to merge 17 commits into
Conversation
| timestamp: beforeDSTStart, | ||
| format: 'D MMMM YYYY, HH:mm z', | ||
| timezone, | ||
| locale, |
Contributor
Author
There was a problem hiding this comment.
Note, uses default locale since other tests in this file use this
| expect( | ||
| formatTimestamp({ | ||
| datetimeLocale: services.news.default.datetimeLocale, | ||
| timezone: services.news.default.timezone, |
Contributor
Author
There was a problem hiding this comment.
Note, gets datetimeLocale and timezone from the service config (similar to the other tests above)
Contributor
There was a problem hiding this comment.
Pull request overview
Adds additional timestamp edge-case coverage (DST boundaries, offset timezones, and non‑Latin locales) to de-risk the upcoming migration from Moment.js to Temporal, plus a small service timezone fix.
Changes:
- Expanded
formatUnixTimestampunit tests to cover DST transitions, unusual offsets, and non‑Latin locale formatting. - Added ArticleTimestamp edge-case tests and a Chromatic-only story to visually validate timezone/locale output across services.
- Corrected Azeri timezone identifier casing (
Asia/Baku) to align with stricter IANA validation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/lib/config/services/azeri.ts | Fixes timezone identifier casing for Azeri service config. |
| src/app/legacy/psammead/psammead-timestamp-container/src/utilities/index.test.js | Adds broader timezone/locale test coverage and attempts to improve cleanup of mocked time sources. |
| src/app/legacy/containers/ArticleTimestamp/timeFormatTests/timeFormat.test.js | Adds deterministic edge-case timestamp formatting assertions (DST/offsets). |
| src/app/legacy/containers/ArticleTimestamp/timeFormatTests/testUtils.js | Introduces a helper to format arbitrary timestamps for edge-case tests without fixtures. |
| src/app/legacy/containers/ArticleTimestamp/timeFormatTests/README.md | Clarifies DST wording in documentation. |
| src/app/legacy/containers/ArticleTimestamp/index.stories.jsx | Adds a Chromatic-only multi-service timezone/locale comparison story. |
Louis-Matsika
approved these changes
Jul 17, 2026
louisearchibald
approved these changes
Jul 17, 2026
pvaliani
approved these changes
Jul 17, 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.
Resolves JIRA: WS-NA - 10% time. See plan
Summary
Increases test coverage for edge cases and timezones in preparation for migrating the psammead-timestamp-container from moment to temporal.
Code changes
src/app/legacy/containers/ArticleTimestamp
formatTimestamphelper function used by new edge case testssrc/app/legacy/psammead/psammead-timestamp-container/src/utilities/index.test.js
src/app/lib/config/services/azeri.ts
Testing
Useful Links