Files
buzz/desktop/tests/e2e/signout-screenshots.spec.ts
Bradley Axen ede2686334 fix(desktop): align data deletion labels (#2230)
## Why

The Profile settings action still says “Sign Out,” while its
confirmation action says “Delete My Data.” Both buttons trigger the same
destructive local-data wipe and should name it consistently.

## What

- Label both destructive actions “Delete my data”
- Assert the matching section and confirmation labels in the existing
Playwright coverage

## Risk Assessment

Low — copy and test assertions only; sign-out behavior is unchanged.

## References

- Follow-up to #2208
- #2216 also touches this copy and should preserve “Delete my data” when
rebased
- `just desktop-check`
- `just desktop-test` (3,275 tests)
- Desktop E2E build and sign-out Playwright spec (2 tests)

Generated with Codex

Signed-off-by: Bradley Axen <baxen@squareup.com>
2026-07-30 15:47:35 -07:00

77 lines
2.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { expect, test } from "@playwright/test";
import { installMockBridge } from "../helpers/bridge";
import { openSettings } from "../helpers/settings";
const SHOTS = "test-results/signout";
test.describe("signout screenshots", () => {
test.use({ viewport: { width: 1280, height: 900 } });
test.beforeEach(async ({ page }) => {
page.on("pageerror", (err) => {
console.error(
"PAGE ERROR:",
err.message,
err.stack?.split("\n").slice(0, 5).join("\n"),
);
});
page.on("console", (msg) => {
if (msg.type() === "error") {
console.error("CONSOLE ERROR:", msg.text().slice(0, 500));
}
});
});
test("signout-section — data deletion card in Settings › Profile", async ({
page,
}) => {
await installMockBridge(page);
await page.goto("/", { waitUntil: "domcontentloaded" });
await openSettings(page, "profile");
const section = page.getByTestId("settings-signout");
await section.scrollIntoViewIfNeeded();
await expect(
section.getByRole("button", { name: "Delete my data" }),
).toBeVisible();
// Settle animations before capture.
await page.evaluate(() =>
Promise.all(document.getAnimations().map((a) => a.finished)),
);
await page.waitForTimeout(200);
await section.screenshot({ path: `${SHOTS}/signout-section.png` });
});
test("signout-dialog — AlertDialog shown before the wipe runs", async ({
page,
}) => {
await installMockBridge(page);
await page.goto("/", { waitUntil: "domcontentloaded" });
await openSettings(page, "profile");
const section = page.getByTestId("settings-signout");
await section.scrollIntoViewIfNeeded();
// Open the confirmation dialog.
await page.getByTestId("signout-open-dialog").click();
const dialog = page.getByRole("alertdialog");
await expect(dialog).toBeVisible({ timeout: 5_000 });
await expect(dialog.getByText("Sign out and wipe all data?")).toBeVisible();
await expect(
dialog.getByRole("button", { name: "Delete my data" }),
).toBeVisible();
// Settle animations before capture.
await page.evaluate(() =>
Promise.all(document.getAnimations().map((a) => a.finished)),
);
await page.waitForTimeout(200);
await page.screenshot({ path: `${SHOTS}/signout-dialog.png` });
});
});