test(e2e): drop the cycle route handlers before teardown closes the page

This commit is contained in:
Marc-André Bombeck committed 2026-07-25 22:34:03 +02:00
1 parent ec49157e85
commit c506b72002
1 file changed
+8
+8
View File
@@ -175,6 +175,14 @@ test.describe("cycle + insights mobile smoke", () => {
);
});
// These handlers call route.fetch(), which needs a live page. Teardown can
// close the context while one is still in flight, and the rejected fetch
// then fails a test that had already passed. Drop the handlers first so
// nothing is left racing the close.
test.afterEach(async ({ page }) => {
await page.unrouteAll({ behavior: "ignoreErrors" });
});
test("/insights has no horizontal scroll on Pixel-5", async ({ page }) => {
await page.goto("/insights", { waitUntil: "domcontentloaded" });
await page.waitForLoadState("networkidle");