Skip to content

Add focused tests for provider parsing and usage rules #3

Description

@athif23

Why

Most of the app depends on provider responses that can change over time. If one parser breaks, Usage Radar can accidentally show confusing or incomplete data.

A few focused tests would make the risky parts much easier to change with confidence.

What I want

Add tests around the small pieces of logic that decide what the user sees.

Good first targets:

  • Codex usage windows become 5h and weekly bars correctly
  • Copilot quota fallback handles percent remaining, remaining/entitlement, and missing reset timing honestly
  • OpenCode Go usage page parsing handles rolling, weekly, and optional monthly usage
  • summary selection picks the lowest percent-left bar
  • stale refresh failures keep last-known data during the grace period
  • unavailable state only takes over when data is too old or missing

Done when

  • the core parsing and display-rule helpers have test coverage
  • tests do not require real provider credentials or network calls
  • fixtures do not include real tokens, cookies, or personal account data
  • cargo test can run locally without special setup

Notes

I would rather have a small set of high-signal tests than a broad test suite that is hard to maintain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions