---
id: w8/m3/t007
title: Test coverage — loading, empty month, unit display
worker: worker8
status: done
estimate: 45m
depends_on: [w8/m3/t005]
---

## Objective

Meaningful tests for the page's real behavior: unit conversions (seconds→hours, seconds→minutes, bytes→GB, boundary values), zero-month zero-state, loading and 503-unavailable states, and that per-service rows render from per-service data (regression guard against the phantom-service class of bug from w5/m10). No snapshot-everything.

## Context

- Standing closing task (`.claude/commands/pm.md`); follow the dashboard's existing component-test setup (see `dashboard/CLAUDE.md`).

## Steps

1. Unit tests for the formatting helpers.
2. Component tests for the four states over mocked query results.
3. Dashboard test/lint suite green.

## Files

- `dashboard/` (tests beside the new components)

## Acceptance criteria

- [ ] Failure/empty states tested, not just the happy path; conversions covered at boundaries (0, sub-unit, large).

## Out of scope

- Backend tests (w8/m2/t008 owns those).
