diff --git a/e2e/tests/journeys.spec.ts b/e2e/tests/journeys.spec.ts index b366b89..1a7e6ac 100644 --- a/e2e/tests/journeys.spec.ts +++ b/e2e/tests/journeys.spec.ts @@ -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 }) => {