Test: every page that shows Sign out sends strict-origin (Astra P3 on #22)
Fails on origin/main (credits and Share meeting were no-referrer); passes here. The native hand-off pages keep no-referrer and show no Sign out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+30
−0
internal/callstest/chrome_test.go+30 −0
CI passed — run details
diff --git a/internal/callstest/chrome_test.go b/internal/callstest/chrome_test.go| index ee754b6..d54c50b 100644 |
| --- a/internal/callstest/chrome_test.go |
| +++ b/internal/callstest/chrome_test.go |
| @@ -418,3 +418,33 @@ func TestEstilosChromeUsesTokensCallsDefines(t *testing.T) { |
| } |
| } |
| } |
| + |
| +// Spec §9.5, and Astra's P3 on meet #22: a page that shows Sign out sends |
| +// Referrer-Policy strict-origin, never no-referrer — in Home mode the |
| +// chained sign-out is admitted by id.* on the Referer's origin, and |
| +// no-referrer strands it on "Finish signing out". Open source and Share |
| +// meeting show the account menu, so they are strict-origin; the native |
| +// hand-off pages keep no-referrer and so show no Sign out at all. |
| +func TestPagesWithSignOutSendStrictOrigin(t *testing.T) { |
| + x, sqid, _ := memberWithMeeting(t) |
| + c := x.browser(t) |
| + c.signIn("paul@example.com") |
| + for name, rec := range map[string]*httptest.ResponseRecorder{ |
| + "Open source": c.getNav("/help/open-source"), |
| + "Share meeting": c.post("/m/"+sqid+"/share", nil), |
| + } { |
| + if !strings.Contains(rec.Body.String(), ">Sign out<") { |
| + t.Errorf("%s: no Sign out, so this check proves nothing", name) |
| + } |
| + if got := rec.Header().Get("Referrer-Policy"); got != "strict-origin" { |
| + t.Errorf("%s shows Sign out with Referrer-Policy %q, want strict-origin", name, got) |
| + } |
| + } |
| + // Any page with Sign out and no-referrer is the bug, wherever it is. |
| + for _, path := range []string{"/", "/settings", "/m/" + sqid + "/join", "/meetings/" + sqid + "/settings", "/no/such/page"} { |
| + rec := c.getNav(path) |
| + if strings.Contains(rec.Body.String(), ">Sign out<") && rec.Header().Get("Referrer-Policy") == "no-referrer" { |
| + t.Errorf("GET %s shows Sign out under no-referrer", path) |
| + } |
| + } |
| +} |