Wrap the top bar's buttons onto a second row when narrow (closes #272)
Check / check (pull_request) Skipped
Check / check (pull_request) Skipped
The top bar's two sides were held apart only by justify-between, with no gap and no wrapping, so at 390 px "by @sneak" ended where the New App button began. The bar's row now wraps and has a gap: in a window too narrow for one row, New App and Logout move to a second row; on wider windows the bar looks as before. Model: opus-5-5
This commit is contained in:
@@ -52,3 +52,26 @@ func TestDashboardTableFitsCard(t *testing.T) {
|
||||
assert.Contains(t, cellTag, "whitespace-normal")
|
||||
assert.Contains(t, cellTag, "break-all")
|
||||
}
|
||||
|
||||
// TestTopBarWrapsWhenNarrow checks that the top bar keeps a gap between the
|
||||
// µPaaS title and the New App and Logout buttons, and puts the buttons on a
|
||||
// second row in a window too narrow for one, instead of letting them meet.
|
||||
func TestTopBarWrapsWhenNarrow(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCtx := setupTestHandlers(t)
|
||||
|
||||
request := httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/", nil)
|
||||
recorder := httptest.NewRecorder()
|
||||
|
||||
testCtx.handlers.HandleDashboard().ServeHTTP(recorder, request)
|
||||
|
||||
require.Equal(t, http.StatusOK, recorder.Code)
|
||||
|
||||
_, afterNav, found := strings.Cut(recorder.Body.String(), `<nav class="app-bar">`)
|
||||
require.True(t, found, "dashboard has no top bar")
|
||||
|
||||
rowTag, _, _ := strings.Cut(strings.TrimSpace(afterNav), ">")
|
||||
assert.Contains(t, rowTag, "flex-wrap")
|
||||
assert.Contains(t, rowTag, "gap-")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user