fix(e2e): scroll detail-page chart into view before asserting #5

Merged
tudor merged 2 commits from fix/e2e-detail-chart-scroll into main 2026-07-03 13:56:00 +00:00
+5 -2
View File
@@ -43,8 +43,11 @@ test('school detail page renders name and performance data', async ({ page }) =>
await firstSchool.click(); await firstSchool.click();
await page.waitForURL(/\/school\//); await page.waitForURL(/\/school\//);
await expect(page.locator('h1').first()).toBeVisible(); await expect(page.locator('h1').first()).toBeVisible();
// The detail page renders at least one chart canvas (performance history) // The detail page renders at least one *visible* chart canvas. Plain
await expect(page.locator('canvas').first()).toBeVisible({ timeout: 15_000 }); // .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 }) => { test('comparing two schools shows both side by side', async ({ page }) => {