test: disable auto-wait for blocked navigation

This commit is contained in:
Amruth Pillai
2026-09-06 12:32:13 +02:00
parent d7b2a843ca
commit f3622e8753
@@ -41,12 +41,11 @@ test("retries a failed autosave before leaving the builder", async ({ authPage:
await release.promise;
await route.continue();
});
const navigation = page.getByRole("button", { name: "Go to resumes dashboard", exact: true }).click();
await page.getByRole("button", { name: "Go to resumes dashboard", exact: true }).click({ noWaitAfter: true });
await arrived.promise;
expect(page.url()).toBe(url);
await expect(page.getByLabel("Name", { exact: true })).toHaveValue("Draft recovered before leaving");
release.resolve();
await navigation;
await page.waitForURL(/\/dashboard/);
await page.goto(url);
await expect(page.getByLabel("Name", { exact: true })).toHaveValue("Draft recovered before leaving");
@@ -61,8 +60,7 @@ test("retains the current draft when saving during navigation fails", async ({ a
});
await page.getByLabel("Name", { exact: true }).fill("Keep unsaved draft");
await expect(page.getByText("Your latest changes could not be saved.", { exact: true })).toBeVisible();
const blockedNavigation = page.getByRole("button", { name: "Go to resumes dashboard", exact: true }).click();
void blockedNavigation.catch(() => undefined);
await page.getByRole("button", { name: "Go to resumes dashboard", exact: true }).click({ noWaitAfter: true });
await expect.poll(() => attempts).toBe(2);
await expect(page.getByRole("status").filter({ hasText: "Couldn't save" })).toBeVisible();
expect(page.url()).toBe(url);
@@ -93,8 +91,7 @@ test("stops waiting for a slow save while preserving late acknowledgements and q
await page.getByLabel("Name", { exact: true }).fill("Slow save draft");
await page.clock.fastForward(600);
await arrived.promise;
const blockedNavigation = page.getByRole("button", { name: "Go to resumes dashboard", exact: true }).click();
void blockedNavigation.catch(() => undefined);
await page.getByRole("button", { name: "Go to resumes dashboard", exact: true }).click({ noWaitAfter: true });
await page.clock.fastForward(10000);
const slowNotice = page.getByText("Saving is taking longer than expected. Your changes are still open.", {
exact: true,