mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 07:43:16 +10:00
## Changes Made - Refactor/optimise tests - Reduce flakiness - Add parallel tests (if there's enough CPU capacity) - Removed explicit worker count when running parallel tests. Defaults to 50% of CPU capacity. Might want to consider sharding the test across runners in the future as our tests grows.
25 lines
960 B
TypeScript
25 lines
960 B
TypeScript
import { expect, test } from '@playwright/test';
|
|
|
|
import { WEBAPP_BASE_URL } from '@documenso/lib/constants/app';
|
|
import { getUserByEmail } from '@documenso/lib/server-only/user/get-user-by-email';
|
|
import { seedUser } from '@documenso/prisma/seed/users';
|
|
|
|
import { apiSignin } from '../fixtures/authentication';
|
|
|
|
test('[USER] delete account', async ({ page }) => {
|
|
const user = await seedUser();
|
|
|
|
await apiSignin({ page, email: user.email, redirectPath: '/settings' });
|
|
|
|
await page.getByRole('button', { name: 'Delete Account' }).click();
|
|
await page.getByLabel('Confirm Email').fill(user.email);
|
|
|
|
await expect(page.getByRole('button', { name: 'Confirm Deletion' })).not.toBeDisabled();
|
|
await page.getByRole('button', { name: 'Confirm Deletion' }).click();
|
|
|
|
await page.waitForURL(`${WEBAPP_BASE_URL}/signin`);
|
|
|
|
// Verify that the user no longer exists in the database
|
|
await expect(getUserByEmail({ email: user.email })).rejects.toThrow();
|
|
});
|