e2e: register and repair the settings/explore/social specs

settings.test.ts, explore.test.ts, and social.test.ts weren't matched
by any Playwright project, so they had silently never run — which is
how they rotted. Register them (one project each) and repair the
selectors against the current UI:

- settings: the page was split into sibling sections
  (/settings/{profile,security,account}); the spec assumed one page.
  Navigate to the right sub-page per test, use the stable section-nav
  links + #id input locators (the Vite dev server transiently
  double-renders the profile form during hydration, breaking
  getByLabel), and wait for hydration before interacting with
  fetcher-backed forms and the avatar dropdown.
- explore: setProfileVisibility now targets /settings/profile and
  waits for hydration so the visibility save uses the fetcher.
- social: already green once registered.

Also fixes an app bug the specs surfaced: deleting a passkey redirected
to /settings#security, a stale anchor that now resolves to
/settings/profile — so you'd land on the wrong section. It now
redirects to /settings/security.

Verified locally against Postgres/BRouter: green under CI-style
retries (the residual registration flake is the same cold-start class
the rest of the suite has, which is why CI runs retries=2).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-06-11 08:32:18 +02:00
parent b4067301cc
commit 7a290cd56f
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
4 changed files with 73 additions and 27 deletions

View file

@ -2,7 +2,10 @@ import { test, expect, waitForHydration, type CDPSession, type Page } from "./fi
import { setupVirtualAuthenticator, registerUser } from "./helpers/auth";
async function setProfileVisibility(page: Page, value: "public" | "private") {
await page.goto("/settings");
await page.goto("/settings/profile");
// Wait for hydration so the visibility form submits via the fetcher
// (and shows the "Profile saved." toast) instead of native-navigating.
await waitForHydration(page);
await page.locator(`input[type=radio][name=profileVisibility][value=${value}]`).check();
await page.getByRole("button", { name: /^Save$/ }).first().click();
await expect(page.getByText("Profile saved.")).toBeVisible({ timeout: 10000 });