---
id: w6/m7/t005
title: Test coverage — meaningful tests for the behavior this milestone shipped
worker: worker6
status: done
estimate: 25m
depends_on: [w6/m7/t003]
---

## Objective

Add tests that assert the real behavior and failure modes of `own-` ids and the
member-identifier mapping — no tautological/coverage-gaming tests.

## Context

- Unit level: id-kind guard (`own` registered); store round-trip (subject→own-id stable across calls, own-id→subject reverse, unknown ⇒ not-found).
- Surface level: extend `internal/api/owners_rest_test.go` (the fake-store harness) — member `userId` is an `own-` id (prefix-checked), stable across two calls, and identical on the GraphQL/MCP paths.

## Steps

1. Store/id unit tests for t001 (stable mapping + reverse lookup + unknown).
2. Extend `owners_rest_test.go` to assert `userId` is an `own-` id and stable.

## Files

- `lego/backend/internal/store/*_test.go`, `internal/id/*_test.go`
- `lego/backend/internal/api/owners_rest_test.go`

## Acceptance criteria

- [ ] Tests assert stable `own-` mapping + reverse lookup + unknown-id not-found
- [ ] `go test ./...` (backend) green; member `userId` asserted as an `own-` id across surfaces

## Out of scope

- Live-cluster e2e (fake-store harness is the unit boundary).
