test(web): warm up lazy Plot import before chart-links matrix

The inert-link E2E is the first spec that mounts ChartCanvas, so CI can
spend longer than the default expect timeout loading Observable Plot.
Prime the module with a safe fixture navigation before the href matrix.

Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-10-04 00:41:07 +00:00
parent 35d1f923e9
commit 301c42fa61
No known key found for this signature in database

View File

@ -4,6 +4,10 @@ import { captureScreenshot } from "./helpers";
const fixture = "/e2e/fixtures/chart-links.html";
test("chart links cannot execute script when clicked or expanded", async ({ page }, testInfo) => {
test.setTimeout(120_000);
// ChartCanvas lazy-loads Observable Plot; pay the import cost once before the matrix below.
await page.goto(`${fixture}?${new URLSearchParams({ href: "#details", inspect: "0" })}`);
await expect(page.locator("svg circle").first()).toBeVisible({ timeout: 90_000 });
for (const inspect of ["0", "1"]) {
for (const href of [
'javascript:void(document.body.dataset.plotExecuted="yes")',