diff --git a/e2e/tests/journeys.spec.ts b/e2e/tests/journeys.spec.ts index f955657..b366b89 100644 --- a/e2e/tests/journeys.spec.ts +++ b/e2e/tests/journeys.spec.ts @@ -43,8 +43,13 @@ 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) - await expect(page.locator('canvas').first()).toBeVisible({ timeout: 15_000 }); + // 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 }); }); test('comparing two schools shows both side by side', async ({ page }) => {