From 61ece6859029d113be641577d63ffb26d6f8cb11 Mon Sep 17 00:00:00 2001 From: Zhi Date: Sat, 13 Jun 2026 01:57:34 +0800 Subject: [PATCH] test: fix flaky partials opt-out tests by adding waitForNavigation() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two tests ('opt out of partial navigation' and 'opt out of partial navigation #2') were marked \ignore: true\ due to flakiness. Both tests click links with \ -client-nav={false}\ which trigger full-page navigations, but neither waited for the navigation to complete before asserting on the new page. The third test ('opt out of partial navigation in island') uses \Promise.all([page.waitForNavigation(), click])\ and is NOT flaky — confirming the root cause. Fix: wrap both clicks in \Promise.all([page.waitForNavigation(), click()])\ and remove the \ignore: true\ markers. Closes #3858 --- packages/fresh/tests/partials_test.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/fresh/tests/partials_test.tsx b/packages/fresh/tests/partials_test.tsx index 9b4a17d510b..c0fd68ad0fd 100644 --- a/packages/fresh/tests/partials_test.tsx +++ b/packages/fresh/tests/partials_test.tsx @@ -1413,7 +1413,6 @@ Deno.test({ Deno.test({ name: "partials - opt out of partial navigation", - ignore: true, // TODO: test is flaky fn: async () => { const app = testApp() .get("/partial", (ctx) => { @@ -1463,7 +1462,10 @@ Deno.test({ await page.locator(".increment").click(); await waitForText(page, ".output", "1"); - await page.locator(".update").click(); + await Promise.all([ + page.waitForNavigation(), + page.locator(".update").click(), + ]); await page.locator(".done").wait(); await page.waitForFunction(() => { @@ -1479,7 +1481,6 @@ Deno.test({ Deno.test({ name: "partials - opt out of partial navigation #2", - ignore: true, // TODO: test is flaky fn: async () => { const app = testApp() .get("/partial", (ctx) => { @@ -1532,7 +1533,10 @@ Deno.test({ await page.locator(".increment").click(); await waitForText(page, ".output", "1"); - await page.locator(".update").click(); + await Promise.all([ + page.waitForNavigation(), + page.locator(".update").click(), + ]); await page.waitForSelector(".done"); const url = new URL(page.url!);