fix(e2e): assert on a visible canvas — the first canvas is hidden by design
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 9m41s
PR Checks / Backend Smoke (pull_request) Successful in 5s
PR Checks / Build Backend (no push) (pull_request) Successful in 10s
PR Checks / Build Frontend (no push) (pull_request) Successful in 47s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 10s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 26s

The admissions card stacks year/trend views in one grid cell and keeps the
inactive view visibility:hidden; its canvas is first in the DOM. Use
canvas:visible instead of scrolling. Verified: full suite passes against prod.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PqGhF93UrpDNvXBLMjJENL
This commit is contained in:
Tudor
2026-07-03 14:40:13 +01:00
co-authored by Claude Fable 5
parent 4ece55b031
commit deeef23131
+5 -7
View File
@@ -43,13 +43,11 @@ test('school detail page renders name and performance data', async ({ page }) =>
await firstSchool.click();
await page.waitForURL(/\/school\//);
await expect(page.locator('h1').first()).toBeVisible();
// The detail page renders at least one chart canvas (performance history).
// Charts live below the fold and only become visible once scrolled to, so
// wait for the element, scroll it into view, then assert visibility.
const chart = page.locator('canvas').first();
await chart.waitFor({ state: 'attached', timeout: 15_000 });
await chart.scrollIntoViewIfNeeded();
await expect(chart).toBeVisible({ timeout: 15_000 });
// The detail page renders at least one *visible* chart canvas. Plain
// .first() is wrong here: the admissions card stacks its year/trend views
// in one grid cell and keeps the inactive view's canvas visibility:hidden
// by design, and that canvas comes first in the DOM.
await expect(page.locator('canvas:visible').first()).toBeVisible({ timeout: 15_000 });
});
test('comparing two schools shows both side by side', async ({ page }) => {