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}`} > -