Skip to content

Add unit tests for usageLevel threshold classifier #78

Description

@tsouth89

Context

usageLevel(pct, exhausted) in apps/desktop-tauri/src/surfaces/tray/UsageBar.tsx:11 maps a percentage into normal | high | critical | exhausted (thresholds at 70 and 90, with exhausted taking priority). Pure function, no test.

Task

Export usageLevel and add unit tests (a new UsageBar.test.tsx can hold both this and the ARIA test if that issue is done together).

Acceptance criteria

  • Covers each band and both sides of the boundaries: 0, 69, 70, 89, 90, 100.
  • Covers exhausted = true overriding a low percentage.
  • Uses the existing vitest setup.

How to test

pnpm --dir apps/desktop-tauri test

Pointers

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededjavascriptPull requests that update javascript code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions