Skip to content

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

Description

@Chucks1093

Summary

The useRelativeTime hook has no unit tests. Tests should confirm the hook returns the correct relative string at several time distances and that the output updates after the 60-second refresh interval.

Scope

  • Test a timestamp 30 seconds ago returns a string containing seconds
  • Test a timestamp 90 seconds ago returns a string containing minute
  • Test a timestamp 2 hours ago returns a string containing hours
  • Test a timestamp 3 days ago returns a string containing days
  • Advance fake timers by 60 seconds and assert the output string updates

Acceptance Criteria

  • 30 seconds ago produces a seconds-relative string
  • 90 seconds ago produces a minutes-relative string
  • 2 hours ago produces an hours-relative string
  • 3 days ago produces a days-relative string
  • Output updates after 60-second timer interval

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions