Files
SnapOtter/tests/e2e-analytics/privacy-page.spec.ts
T
SnapOtterandGitHub 63a03d26f2 feat: pipeline templates, analytics opt-out, 83 conversion presets, positioning + e2e modernization
Lands five integrated branches: pipeline templates (#355), analytics opt-out (#354), 83 conversion presets bringing the catalog to 240 tools (#356), self-hosted positioning (#353), and e2e modernization (#351).

Integration fixes: aligned stale web analytics tests with the opt-out/allow-list model, closed 3 CodeQL incomplete-sanitization alerts in the i18n generator, resolved settings/index/docs/format-matrix conflicts, and corrected tool counts to 240.
2026-06-28 18:57:53 +08:00

51 lines
2.0 KiB
TypeScript

import { expect, test } from "./helpers";
// The /privacy page describes the opt-out analytics model (PR #336 removed the
// old consent/opt-in flow). These assertions track the live page copy; there is
// no consent page or banner to assert anymore.
test.describe("Privacy Policy Page", () => {
test("renders at /privacy", async ({ loggedInPage: page }) => {
await page.goto("/privacy");
await expect(page.getByRole("heading", { name: "Privacy Policy", level: 1 })).toBeVisible({
timeout: 5_000,
});
});
test("mentions PostHog as analytics provider", async ({ loggedInPage: page }) => {
await page.goto("/privacy");
await expect(page.getByText(/posthog/i)).toBeVisible({ timeout: 5_000 });
});
test("mentions Sentry as error tracking provider", async ({ loggedInPage: page }) => {
await page.goto("/privacy");
await expect(page.getByText(/sentry/i)).toBeVisible({ timeout: 5_000 });
});
test("describes local processing", async ({ loggedInPage: page }) => {
await page.goto("/privacy");
await expect(page.getByRole("heading", { name: "Local Processing" })).toBeVisible({
timeout: 5_000,
});
await expect(page.getByText(/processing happens entirely on the server/i)).toBeVisible({
timeout: 5_000,
});
});
test("frames analytics as opt-out, not opt-in/consent", async ({ loggedInPage: page }) => {
await page.goto("/privacy");
// Analytics is on by default and can be turned off (the opt-out model).
await expect(page.getByRole("heading", { name: "Analytics" })).toBeVisible({ timeout: 5_000 });
await expect(page.getByText(/can be disabled/i)).toBeVisible({ timeout: 5_000 });
// No consent / opt-in wording should survive.
await expect(page.getByText(/opt.?in|consent|i agree|accept analytics/i)).toHaveCount(0);
});
test("no auth required to access privacy page", async ({ page }) => {
await page.goto("/privacy");
// Should NOT redirect to login.
await page.waitForTimeout(2000);
expect(page.url()).toContain("/privacy");
});
});