---
id: w5/m4/t007
title: Test coverage
worker: worker5
status: todo
estimate: 30m
depends_on: [w5/m4/t005]
---

## Objective

Add meaningful tests for the behavior m4 shipped: the `services` query → view mapping (including the string `suspended` enum → badge), the loading/error/empty states, and the lifecycle-action poll-to-converge flow. Assert real behavior and failure modes; no tautological or snapshot-everything tests.

## Context

- Test convention: `__tests__` dirs adjacent to code (`dashboard/CLAUDE.md`); vitest setup + mocks in `src/test/`.
- Reference: `src/features/metrics/hooks/__tests__/use-metrics.test.ts`.

## Steps

1. Test the `Service` → row/tile mapping, including `suspended` string-enum handling.
2. Test loading/error/empty rendering branches.
3. Test the lifecycle action: mutation fires + status converges on poll; error path surfaces.

## Files

- `src/features/services/**/__tests__/*.test.ts(x)`

## Acceptance criteria

- [ ] Tests assert the mapping, the three states, and the lifecycle poll-to-converge behavior.
- [ ] `yarn test` passes.

## Out of scope

- E2E against live prod (t005 covers manual verification).
