---
id: w5/m7/t006
title: "Test coverage — catalog query, picker states (pre-select/disable/confirm), mutation wiring"
worker: worker5
status: done
estimate: 30m
depends_on: [w5/m7/t004]
---

## Objective

Pin the shipped behaviors with tests that fail on regression — no tautological or snapshot-everything tests.

## Context

- Backend: `instanceTypes` shape + authz guard (t001 carries first-line tests; fill gaps).
- Dashboard behaviors worth pinning (existing patterns: mocked-hook component tests in `features/services` and `features/metrics`): Settings row renders name/CPU/RAM from plan + catalog and the no-plan state; picker pre-selects the current plan; Save stays disabled until the selection changes; confirm fires `updateServicePlan` with the picked Render-spelled id; mutation error surfaces a toast, success navigates; quantity formatting ("500m" → "0.5 CPU", "2Gi" → "2 GB") unit-tested at its helper.

## Steps

1. Fill gaps t001–t004 left uncovered.
2. One adversarial case per boundary: unknown plan string in the service view (renders no-plan state, not a crash); catalog query returning empty (picker shows an honest error/empty state).

## Files

- `lego/backend/internal/apps/*_test.go`, `dashboard/src/features/services/**/__tests__/`

## Acceptance criteria

- [ ] Each behavior above has a test that fails if it regresses.
- [ ] Backend + dashboard suites green.

## Out of scope

- e2e browser suites; visual regression tooling.
