Skip to content

test: fix flaky partials tests missing waitForNavigation() #3858

Description

@SisyphusZheng

Problem

Two tests in packages/fresh/tests/partials_test.tsx are marked ignore: true due to flakiness:

Root Cause

Both tests click links with f-client-nav={false} (full navigation), but don't wait for the navigation to complete:

// Flaky (no navigation wait)
await page.locator(".update").click();
await page.locator(".done").wait();

// Correct (line 1592, non-flaky equivalent)
await Promise.all([
    page.waitForNavigation(),
    page.locator(".update").click(),
]);

The third test ("opt out of partial navigation in island") uses Promise.all([waitForNavigation(), click]) and is NOT marked flaky — confirming the root cause.

Fix

Wrap the click in Promise.all([page.waitForNavigation(), click()]) like the working test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions