Commit 00578a96a1
Verified · cmc ci/build: success ci/test: success
Layout: unified · split
e2e/runnerweb_test.go +4 −1
| @@ -35,8 +35,11 @@ func TestRunnerSettingsWeb(t *testing.T) { | |||
| 35 | } | 35 | } |
| 36 | fp := out[strings.Index(out, "SHA256:"):] | 36 | fp := out[strings.Index(out, "SHA256:"):] |
| 37 | fp = fp[:strings.Index(fp, `"`)] | 37 | fp = fp[:strings.Index(fp, `"`)] |
| 38 | // html/template writes + as + in text and attributes, and a | ||
| 39 | // fingerprint is base64, so the page shows the escaped form. | ||
| 40 | shown := strings.ReplaceAll(fp, "+", "+") | ||
| 38 | _, body = browserGet(t, alice, settings) | 41 | _, body = browserGet(t, alice, settings) |
| 39 | if !strings.Contains(body, fp) || !strings.Contains(body, `value="runner-remove"`) { | 42 | if !strings.Contains(body, shown) || !strings.Contains(body, `value="runner-remove"`) { |
| 40 | t.Fatalf("attached runner not listed:\n%s", body) | 43 | t.Fatalf("attached runner not listed:\n%s", body) |
| 41 | } | 44 | } |
| 42 | if status, _ := browserPost(t, alice, settings, url.Values{"field": {"runner-remove"}, "fingerprint": {fp}}); status != 200 { | 45 | if status, _ := browserPost(t, alice, settings, url.Values{"field": {"runner-remove"}, "fingerprint": {fp}}); status != 200 { |