Skip to content

WS-NA: Temporal Migration (PR 1: Freeze current behavior with characterization tests)#14099

Draft
Isabella-Mitchell wants to merge 1 commit into
latestfrom
WS-NA-temporal-migrate-prep-tests
Draft

WS-NA: Temporal Migration (PR 1: Freeze current behavior with characterization tests)#14099
Isabella-Mitchell wants to merge 1 commit into
latestfrom
WS-NA-temporal-migrate-prep-tests

Conversation

@Isabella-Mitchell

@Isabella-Mitchell Isabella-Mitchell commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Resolves JIRA: WS-NA - 10% time. See plan

Summary

Increases test coverage in preparation for moment -> JS migration work

Code changes

What I added

Deterministic relative-time and DST edge coverage in index.test.js

  • Made the existing “9 hours ago” utility test deterministic by mocking Date.now.
  • Added DST start boundary assertions for Europe/London:
    -- 28 March 2021, 00:30 GMT
    -- 28 March 2021, 02:30 BST
  • Added DST end boundary assertions for Europe/London:
    -- 31 October 2021, 01:30 BST
    -- 31 October 2021, 01:30 GMT
  • Added threshold-boundary characterization assertions for current Moment config:
    -- 59m59s -> 59 minutes ago
    -- 60m -> an hour ago
    -- 23h59m59s -> 23 hours ago
    -- 24h -> a day ago
    -- 29d23h59m59s -> 29 days ago
    -- 30d -> a month ago
    -- 11 months -> 11 months ago
    -- 12 months -> a year ago
  • Added cleanup so moment.now is reset after tests.

Test-only helper for deterministic timestamp formatting in testUtils.js

  • Added export formatTimestamp for direct timestamp-based characterization checks without touching fixture snapshots.

DST characterization cases in timeFormat.test.js

  • Added explicit DST start/end formatting checks via the new test helper.
  • Kept existing expectedFormats matrix untouched.

Testing

  1. Unit tests pass

Useful Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant