Files
calendar/apps/web/playwright/auth/delete-account.e2e.ts
T
27623926fc test: improve flaky E2E tests (#26473)
* fix flakes

* revert

* fix

* update

* more update

* fix

* revert

---------

Co-authored-by: Anik Dhabal Babu <adhabal2002@gmail.com>
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
2026-01-08 15:52:53 +05:30

30 lines
889 B
TypeScript

import { expect } from "@playwright/test";
import { test } from "../lib/fixtures";
test.afterEach(({ users }) => users.deleteAll());
test("Can delete user account", async ({ page, users }) => {
const user = await users.create({
username: "delete-me",
});
await user.apiLogin();
await page.goto(`/settings/my-account/profile`);
await page.waitForLoadState("networkidle");
await page.waitForSelector("[data-testid=dashboard-shell]");
await page.click("[data-testid=delete-account]");
expect(user.username).toBeTruthy();
const $passwordField = page.locator("[data-testid=password]");
await $passwordField.fill(String(user.username));
await Promise.all([
page.waitForURL((url) => url.pathname === "/auth/logout"),
page.click("text=Delete my account"),
]);
await expect(page.locator(`[id="modal-title"]`)).toHaveText("You've been logged out");
});