Skip to content

test: cover string/numeric timestamp inputs for useRelativeTime (#597) - #1271

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
ElizabethChi:test/597-string-number-timestamp-coverage
Oct 27, 2026
Merged

Chucks1093 merged 1 commit into
accesslayerorg:devfrom
ElizabethChi:test/597-string-number-timestamp-coverage

Conversation

@ElizabethChi

Copy link
Copy Markdown
Contributor

Summary

closes #597

#597 (useRelativeTime hook) was already implemented and merged via #616, correctly targeting dev with a Closes #597 line in its body, but GitHub never auto-closed the issue despite the merge.

The hook's type signature accepts string | number | Date timestamps, but every existing test only exercised Date objects (plus null/undefined/invalid-string), so this adds the missing coverage rather than a no-op verification PR.

Changes

  • Added two tests to useRelativeTime.test.ts: an ISO date string input and a numeric epoch-ms input, the two accepted timestamp shapes with no prior test.

Test plan

  • npx vitest run src/hooks/tests/useRelativeTime.test.ts: 11/11 passing (2 new).
  • prettier and eslint clean on the changed file.

useRelativeTime (added in accesslayerorg#616) accepts string | number | Date timestamps,
but every existing test only exercised Date objects (plus null/undefined/
invalid-string). accesslayerorg#616 merged into dev with Closes accesslayerorg#597 in its body, but
GitHub never auto-closed the issue despite the merge.

Adds coverage for an ISO date string and a numeric epoch-ms timestamp,
the two accepted input shapes that had no test.

Closes accesslayerorg#597
@Chucks1093

Copy link
Copy Markdown
Member

✅ PR Ready for Review

Due to a recent malware incident affecting our repositories, all PRs are required to pass automated security checks before being reviewed for merging.

This PR has passed all automated checks:

  • ✅ Security scan — no malicious code detected
  • ✅ No merge conflicts
  • ✅ CI checks passed

Next step: Please share this PR link in our Telegram group so a maintainer can review and merge it: https://t.me/c/accesslayerorg/8514

@Chucks1093
Chucks1093 merged commit 2f9c976 into accesslayerorg:dev Oct 27, 2026
1 check passed
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.

Add unit tests for useRelativeTime hook confirming correct output at several time distances

2 participants