mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: analytics E2E tests for post-auth-setup consent state
The auth setup project accepts analytics consent for the admin user
before tests run. The E2E tests incorrectly expected the consent page
to appear on subsequent logins. Fixed by:
- analytics-consent: verify home loads without consent redirect instead
of expecting the consent page to appear
- analytics-privacy-policy: use getByRole("link") for PostHog/Sentry
links to avoid matching multiple elements with getByText
- analytics-no-data-leak: use page.evaluate with in-browser auth token
to toggle analytics via API instead of separate login calls that hit
the rate limiter; handle both "/" and "/analytics-consent" post-login
This commit is contained in:
@@ -37,8 +37,8 @@ test.describe("Privacy policy page", () => {
|
||||
|
||||
test("mentions PostHog and Sentry by name", async ({ page }) => {
|
||||
await page.goto("/privacy");
|
||||
await expect(page.getByText("PostHog")).toBeVisible({ timeout: 10_000 });
|
||||
await expect(page.getByText("Sentry")).toBeVisible({ timeout: 10_000 });
|
||||
await expect(page.getByRole("link", { name: "PostHog" })).toBeVisible({ timeout: 10_000 });
|
||||
await expect(page.getByRole("link", { name: "Sentry" })).toBeVisible({ timeout: 10_000 });
|
||||
});
|
||||
|
||||
test("shows correct last-updated date", async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user