2022-05-12 02:21:16 +00:00
|
|
|
import { expect } from "@playwright/test";
|
|
|
|
|
|
|
|
import { test } from "../lib/fixtures";
|
|
|
|
|
|
|
|
test("Can delete user account", async ({ page, users }) => {
|
|
|
|
const user = await users.create({
|
|
|
|
username: "delete-me",
|
|
|
|
});
|
|
|
|
await user.login();
|
2022-01-14 13:49:15 +00:00
|
|
|
|
|
|
|
await page.waitForSelector("[data-testid=dashboard-shell]");
|
|
|
|
|
|
|
|
await page.goto(`/settings/profile`);
|
|
|
|
await page.click("[data-testid=delete-account]");
|
2022-01-17 18:15:18 +00:00
|
|
|
|
|
|
|
await expect(page.locator(`[data-testid=delete-account-confirm]`)).toBeVisible();
|
2022-01-14 13:49:15 +00:00
|
|
|
|
|
|
|
await Promise.all([
|
|
|
|
page.waitForNavigation({ url: "/auth/logout" }),
|
2022-01-17 18:15:18 +00:00
|
|
|
page.click("[data-testid=delete-account-confirm]"),
|
2022-01-14 13:49:15 +00:00
|
|
|
]);
|
2022-01-17 18:15:18 +00:00
|
|
|
|
|
|
|
await expect(page.locator(`[id="modal-title"]`)).toHaveText("You've been logged out");
|
2022-01-14 13:49:15 +00:00
|
|
|
});
|