fix-423: console tenant tests assert on rendered cells, not the whole page body
Squashed from fix-423-test-substring into main.
1 file changed,
+7
−1
internal/console/remoteinstances_test.go+7 −1
CI cancelled — superseded by a newer push — run details
diff --git a/internal/console/remoteinstances_test.go b/internal/console/remoteinstances_test.go| index 6d7408f8d..0b10e25f4 100644 |
| --- a/internal/console/remoteinstances_test.go |
| +++ b/internal/console/remoteinstances_test.go |
| @@ -197,7 +197,13 @@ func (tb *twoBoxes) page(t *testing.T, path string) string { |
| if status != http.StatusOK { |
| t.Fatalf("GET %s = %d -> %q\n%s", path, status, loc, body) |
| } |
| - return body |
| + // Every page carries the session token in its CSRF fields: 43 random |
| + // base64url characters. The tests below assert that readings such as |
| + // "v8" or "66%" are absent from the page, and a two-character string |
| + // turns up in a random 43-character token about 1 run in 100 (#423). |
| + // Blank the token, wherever it appears, so only rendered content is |
| + // matched. The assertion stays page-wide: a leak anywhere still fails. |
| + return strings.ReplaceAll(body, sessionToken(t, tb.fx, tb.browser), "SESSION-TOKEN") |
| } |
| // setUp creates the remote instance (and, with local, one on the console's |