package calendartest import ( "net/http" "strings" "testing" ) // Standalone (no Home), signing out lands on a real page: the estilo // signed-out door at /signed-out, as Home mode's sign-out does, rather than // back on the sign-in form as if nothing happened. /signed-out used to 404 // without Home (Fable 5.1 follow-up finding 4 on #17). func TestStandaloneSignOutLandsOnTheSignedOutPage(t *testing.T) { app, session := signedIn(t, "someone@example.com") h := app.Handler() rec := postAs(t, h, session, "/signout", nil) if rec.Code != http.StatusSeeOther || rec.Header().Get("Location") != "/signed-out" { t.Fatalf("POST /signout: %d to %q, want 303 to /signed-out", rec.Code, rec.Header().Get("Location")) } if after := getAs(t, h, session, "/day/2026-09-24"); after.Code != http.StatusSeeOther { t.Fatalf("the session survived sign-out: GET a view answered %d", after.Code) } page := get(t, h, "/signed-out") body := page.Body.String() if page.Code != http.StatusOK || !strings.HasPrefix(page.Header().Get("Content-Type"), "text/html") { t.Fatalf("GET /signed-out: %d %s", page.Code, page.Header().Get("Content-Type")) } for _, want := range []string{ "Signed out · Calendar", "estilo-door", // The door's words (estilo chrome.English), not the app's. "

You’re signed out

", "You’ve signed out of Calendar on this device.", `Sign in`, } { if !strings.Contains(body, want) { t.Errorf("/signed-out is missing %q:\n%s", want, body) } } // The page that IS signing out shows nothing in the bar's corner. if strings.Contains(body, "estilo-bar-signin") || strings.Contains(body, "estilo-account") { t.Error("/signed-out drew a Sign in button or an account menu in the bar") } }