Skip to content

Add unit tests for the time-ago formatter returning the correct human-readable string for various timestamp inputs #749

Description

@Chucks1093

Summary

The time-ago formatter converts a UTC timestamp to a human-readable string (e.g. '2 minutes ago', '3 days ago'). Unit tests should cover all time buckets and confirm the formatter handles future timestamps and the exact boundary values.

Scope

  • Test a timestamp 30 seconds ago returns 'just now'
  • Test a timestamp 5 minutes ago returns '5 minutes ago'
  • Test a timestamp 2 hours ago returns '2 hours ago'
  • Test a timestamp 3 days ago returns '3 days ago'
  • Test a future timestamp returns 'just now' (no negative values)

Acceptance Criteria

  • 30 seconds ago returns 'just now'
  • 5 minutes ago returns '5 minutes ago'
  • 2 hours ago returns '2 hours ago'
  • 3 days ago returns '3 days ago'
  • Future timestamp returns 'just now'

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions