From a50796b89fc9c4b1ee61a572542f0d60428814bd Mon Sep 17 00:00:00 2001 From: bchanot Date: Mon, 16 Nov 2026 20:47:34 +0100 Subject: [PATCH] fix(app): closed filters panel has no height; e2e asserts it at 375 px --- apps/app/e2e/shell/admin-sheets-list.spec.ts | 11 ++++++++--- .../app/src/app/routes/app/admin/AdminSheetsRoute.tsx | 9 ++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/app/e2e/shell/admin-sheets-list.spec.ts b/apps/app/e2e/shell/admin-sheets-list.spec.ts index 6087a258..dbb21ea7 100644 --- a/apps/app/e2e/shell/admin-sheets-list.spec.ts +++ b/apps/app/e2e/shell/admin-sheets-list.spec.ts @@ -313,6 +313,9 @@ async function checkClosedFilters(page: Page, dict: Dict) { await expect(searchField(page, dict)).toBeVisible() await expect(page.getByLabel(dict['admin.sheets.sort_by'])).toBeVisible() await expect(filterSelect(page, dict, 'species')).toBeHidden() + await expect(countLine(page)).toBeVisible() + const box = await page.locator('#admin-sheets-filters').boundingBox() + expect(box?.height, 'the closed panel takes no height').toBeLessThanOrEqual(1) await toggle.focus() await page.keyboard.press('Tab') const inPanel = await page.evaluate(() => @@ -322,9 +325,11 @@ async function checkClosedFilters(page: Page, dict: Dict) { } /** Phone: open, filter, count on the button, close keeps them, reset. */ -async function checkPhoneFilters(page: Page, dict: Dict) { +async function checkPhoneFilters(page: Page, dict: Dict, token: string) { const toggle = filtersToggle(page, dict) await checkClosedFilters(page, dict) + // The sandbox list is long: narrow it to this run's sheets before axe scans the page. + await searchField(page, dict).fill(token) await toggle.click() await expect(toggle).toHaveAttribute('aria-expanded', 'true') for (const key of [ @@ -428,13 +433,13 @@ test.describe('official sheet list: search, sort and dates (R3)', () => { page, }) => { test.setTimeout(240_000) - const { actor } = fixtures! + const { actor, token } = fixtures! await openAdmin(page, dict, locale, actor) await page.goto('/app/admin/sheets') await expect(heading(page, dict['admin.sheets.title'])).toBeVisible() const width = page.viewportSize()?.width ?? 0 if (width > PHONE_MAX_WIDTH) return checkDesktopFilters(page, dict) - await checkPhoneFilters(page, dict) + await checkPhoneFilters(page, dict, token) }) }) } diff --git a/apps/app/src/app/routes/app/admin/AdminSheetsRoute.tsx b/apps/app/src/app/routes/app/admin/AdminSheetsRoute.tsx index 47db0e1e..00f0a9ca 100644 --- a/apps/app/src/app/routes/app/admin/AdminSheetsRoute.tsx +++ b/apps/app/src/app/routes/app/admin/AdminSheetsRoute.tsx @@ -376,9 +376,12 @@ function Filters(props: ResultsProps) { data-open={view.open} className={`${PANEL} ${state}`} > -
- - +
+ {/* the top spacing is content: a closed 0fr row clips it, padding would stay */} +
+ + +