package console import ( "net/http" "testing" ) // Final review carry item: a console with no deployment bucket answers its // operator doors with the door's own failure sentence and a 503, instead of // panicking in the store read. func TestOperatorDoorsWithNoDeploymentBucket(t *testing.T) { fx := legacyFixture(t, "code-no-bucket") fx.srv.cfg.Releases = nil for _, c := range []struct { path string body map[string]any want string }{ {"/api/cli/system/seeds-floor", map[string]any{"min_release": "v0.27.0"}, "could not publish the seeds floor. Try again."}, {"/api/cli/system/legacy-routes", map[string]any{"name": "shop", "to": "cdef/shop"}, "could not read the legacy route assignments. Try again."}, } { st, out := postJSON(t, fx.ts.URL+c.path, c.body, fx.owner) if st != http.StatusServiceUnavailable || str(t, out, "error") != c.want { t.Errorf("%s = %d %v, want 503 %q", c.path, st, out, c.want) } } }