Signed-out tab says Signed out; test Home's words on the door
Review (Fable): the signin tree's static title read "Sign in" on the signed-out page, and the test did not check Home's heading, sentence or link, nor the status and no-store.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+13
−4
internal/memoria/home_router_test.go+12 −3internal/memoria/templates/signin.html+1 −1
CI passed — run details
diff --git a/internal/memoria/home_router_test.go b/internal/memoria/home_router_test.go| index fa8b6f4..6ade219 100644 |
| --- a/internal/memoria/home_router_test.go |
| +++ b/internal/memoria/home_router_test.go |
| @@ -3,6 +3,7 @@ package memoria |
| import ( |
| "bytes" |
| "context" |
| + "html" |
| "io" |
| "log/slog" |
| "net/http" |
| @@ -382,10 +383,18 @@ func TestHomePagesStateTheModelSwitch(t *testing.T) { |
| func TestSignedOutIsTheDoor(t *testing.T) { |
| f := newHomeRouterFixture(t) |
| w := f.do("GET", "/signed-out", "") |
| - b := w.Body.String() |
| - for _, want := range []string{"estilo-door", "estilo-sky-layer", "estilo-signin", "<span>Memoria</span>", "/static/chrome.", "/static/sky."} { |
| + if w.Code != http.StatusOK || w.Header().Get("Cache-Control") != "no-store" { |
| + t.Fatalf("/signed-out: %d, Cache-Control %q", w.Code, w.Header().Get("Cache-Control")) |
| + } |
| + data := connect.Page("signedout", "") |
| + b := html.UnescapeString(w.Body.String()) |
| + for _, want := range []string{ |
| + "<div estilo-door", "estilo-sky-layer", "<section estilo-signin", "<span>Memoria</span>", |
| + "/static/chrome.", "/static/sky.", "<title>" + data.Title + " · Memoria</title>", |
| + data.Title, data.Body, `href="` + data.Action + `"`, data.ActionLabel, |
| + } { |
| if !strings.Contains(b, want) { |
| - t.Errorf("/signed-out (%d) lacks %q", w.Code, want) |
| + t.Errorf("/signed-out lacks %q", want) |
| } |
| } |
| } |
diff --git a/internal/memoria/templates/signin.html b/internal/memoria/templates/signin.html| index bbf136c..7e3a5da 100644 |
| --- a/internal/memoria/templates/signin.html |
| +++ b/internal/memoria/templates/signin.html |
| @@ -1,4 +1,4 @@ |
| -{{define "title"}}Sign in — Memoria{{end}} |
| +{{define "title"}}{{with .SignedOut}}{{.Heading}} · Memoria{{else}}Sign in — Memoria{{end}}{{end}} |
| {{/* The suite's door (estilo chrome): one card on the team's sky, the |
| app's mark and name at its head. chrome.css draws the card, sky.css |
| the sky; both are vendored from estilo (go run ./scripts/writeestilo). |