---
id: w1/m21/t007
title: Test coverage — build→publish path + edge rules + surface tests
worker: worker1
status: done
estimate: 40m
depends_on: [w1/m21/t005]
---

## Objective

Add meaningful tests for the static-site behavior: the build→object-store publish path (no Deployment created), redirect/rewrite/header application, and the API surface round-trip. Assert real behavior and failure modes.

## Context

- Operator: static-site reconcile builds and publishes; asserts no Deployment/Service.
- Edge rules: redirect returns 3xx to target; rewrite serves 200 at rewritten path; header present.
- Backend: create/read/update + routes/headers round-trip.

## Steps

1. Envtest/unit for the static-site reconcile (publish sink hit; no Deployment).
2. Tests for redirect/rewrite/header semantics (ordering, first-match).
3. Backend surface tests.

## Files

- `lego/operator/…_test.go`, `lego/backend/…_test.go`

## Acceptance criteria

- [ ] Tests fail if a static site regresses to creating a Deployment, or if edge-rule ordering breaks.
- [ ] `make test` + backend `go test ./...` green.

## Out of scope

- Non-static-site behavior.
