Enhancement/cal 708 delete account (#1403)

* --WIP

* --WIP

* --WIP

* added prisma migration and delete cascade for user

* stripe customer removal and other --wip

* --wip

* added stripe user delete

* removed log remnants

* fixed signout import

* cleanup

* Changes requested

* fixed common-json apostrophe

* Simplifies account deletion logic and add e2e tests

* Cleanup

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Omar López <[email protected]>
This commit is contained in:
authored and GitHub committed 2022-01-14 13:49:15 +00:00
1 parent e5f8437282
commit fac4de1144
12 files changed
+235 -34

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
import { expect, test } from "@playwright/test";
test("Can delete user account", async ({ page }) => {
// Login to account to delete
await page.goto(`/auth/login`);
// Click input[name="email"]
await page.click('input[name="email"]');
// Fill input[name="email"]
await page.fill('input[name="email"]', `[email protected]`);
// Press Tab
await page.press('input[name="email"]', "Tab");
// Fill input[name="password"]
await page.fill('input[name="password"]', "delete-me");
// Press Enter
await page.press('input[name="password"]', "Enter");
await page.waitForSelector("[data-testid=dashboard-shell]");
await page.goto(`/settings/profile`);
await page.click("[data-testid=delete-account]");
expect(page.locator(`[data-testid=delete-account-confirm]`)).toBeVisible();
await Promise.all([
page.waitForNavigation({ url: "/auth/logout" }),
await page.click("[data-testid=delete-account-confirm]"),
]);
expect(page.locator(`[id="modal-title"]`)).toHaveText("You've been logged out");
});