This commit is contained in:
@@ -129,3 +129,37 @@ func TestResearchDiagnosticAPI(t *testing.T) {
|
||||
t.Fatalf("unexpected status: %#v", status)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSettingsPanelContentIsScrollable(t *testing.T) {
|
||||
broker := activity.New(4)
|
||||
h := (&Server{Broker: broker}).Handler()
|
||||
|
||||
res := httptest.NewRecorder()
|
||||
h.ServeHTTP(res, httptest.NewRequest(http.MethodGet, "/", nil))
|
||||
if res.Code != http.StatusOK {
|
||||
t.Fatalf("GET / returned %d: %s", res.Code, res.Body.String())
|
||||
}
|
||||
body := res.Body.String()
|
||||
if !strings.Contains(body, `class="settings-scroll"`) {
|
||||
t.Fatal("settings panel is missing its scroll container")
|
||||
}
|
||||
if !strings.Contains(body, `class="settings-footer"`) {
|
||||
t.Fatal("settings footer is missing")
|
||||
}
|
||||
|
||||
res = httptest.NewRecorder()
|
||||
h.ServeHTTP(res, httptest.NewRequest(http.MethodGet, "/app.css", nil))
|
||||
if res.Code != http.StatusOK {
|
||||
t.Fatalf("GET /app.css returned %d: %s", res.Code, res.Body.String())
|
||||
}
|
||||
css := res.Body.String()
|
||||
for _, expected := range []string{
|
||||
".settings-scroll{flex:1;min-height:0;overflow-y:auto",
|
||||
"overscroll-behavior:contain",
|
||||
".settings-footer{flex:0 0 auto",
|
||||
} {
|
||||
if !strings.Contains(css, expected) {
|
||||
t.Fatalf("scroll CSS is missing %q", expected)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user