diff --git a/internal/api/dashboard_filter_test.go b/internal/api/dashboard_filter_test.go index 5202c51..92b77cd 100644 --- a/internal/api/dashboard_filter_test.go +++ b/internal/api/dashboard_filter_test.go @@ -74,7 +74,8 @@ func TestPageEditorOffersAddAndRemoveAll(t *testing.T) { _, region := e.platformChecker(t, uniq("eu-")) owner := e.browser(t) owner.signup("o@"+uniq("pa")+".test", uniq("pa-")) - owner.do("POST", "/api/v1/org/monitors", map[string]any{"name": "Shop", "type": "http", "target": "https://shop.test", "interval_seconds": 60, "regions": []string{region}}) + _, mon := owner.do("POST", "/api/v1/org/monitors", map[string]any{"name": "Shop", "type": "http", "target": "https://shop.test", "interval_seconds": 60, "regions": []string{region}}) + shop := mon["id"].(string) _, p := owner.do("POST", "/api/v1/org/statuspages", map[string]any{"slug": uniq("pa-"), "title": "Status"}) _, _, html := owner.page("/statuspages/" + p["id"].(string)) for _, want := range []string{`data-check-all="on"`, `data-check-all="off"`, "Add all", "Remove all"} { @@ -82,6 +83,15 @@ func TestPageEditorOffersAddAndRemoveAll(t *testing.T) { t.Errorf("the page editor lacks %q", want) } } + // Monitors not on the page get their fields from the template only + // when ticked, so thousands of them stay light. + if n := strings.Count(html, `data-field="label"`); n != 1 || !strings.Contains(html, "