Replace waitForLoadState("networkidle") in e2e helpers

The SSE connection to /api/events (added with notifications) keeps the
network in-flight forever, so `networkidle` never resolves. Each save
in the affected helpers timed out at 30s × 3 retries, which both broke
the run and made it suspiciously long.

Switched to explicit waits:
- "Profile saved." text after settings save (notifications + public-content + social)
- "No pending follow requests." after Approve (social.test.ts)
- toBeHidden poll for the Mark all read button (notifications)
- toBeVisible poll for the empty-state copy after Approve (notifications)

These are all the affected `networkidle` call sites in e2e. The
fetcher.Form pattern stays — once the action commits, the page
revalidates and the post-state element appears.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-04-26 01:37:37 +02:00
parent e61179ab27
commit abb754e6a5
3 changed files with 18 additions and 10 deletions

View file

@ -33,7 +33,8 @@ async function setProfileVisibility(page: Page, value: "public" | "private") {
// in the Private radio's helper sentence).
await page.locator(`input[type=radio][name=profileVisibility][value=${value}]`).check();
await page.getByRole("button", { name: /^Save$/ }).first().click();
await page.waitForLoadState("networkidle");
// SSE keeps the network busy; wait for the save confirmation instead.
await expect(page.getByText("Profile saved.")).toBeVisible({ timeout: 10000 });
}
// WebAuthn + parallel workers + shared local Postgres race; serialize.
@ -126,8 +127,8 @@ test.describe("Social follows + /feed", () => {
await bPage.goto("/follows/requests");
await expect(bPage.getByText(`@${aUsername}`)).toBeVisible();
await bPage.getByRole("button", { name: "Approve" }).click();
await bPage.waitForLoadState("networkidle");
// Empty state after approval.
// Empty state after approval. The text-visibility assertion below
// already polls; explicit networkidle would hang on SSE.
await expect(bPage.getByText(/No pending follow requests/i)).toBeVisible();
// A reloads B's profile — now sees full content (no stub) + Unfollow.