Skip to content
File

Blob: tests/e2e/admin-flow.spec.ts

typescript25 lines
1import { expect, test } from "playwright/test";
2import { addDomain, getDomainCard, makeDomainName, signInAdmin, stubTurnstile } from "./helpers";
3 
4test("@smoke signs in, manages a domain, and shows reserved permanent inboxes", async ({ page }) => {
5 const domain = makeDomainName("admin-flow");
6 
7 await stubTurnstile(page);
8 await signInAdmin(page);
9 await addDomain(page, domain);
10 
11 const domainCard = getDomainCard(page, domain);
12 await expect(domainCard).toContainText("active");
13 
14 await domainCard.getByRole("button", { name: "Disable" }).click();
15 await expect(domainCard).toContainText("disabled");
16 
17 await domainCard.getByRole("button", { name: "Enable" }).click();
18 await expect(domainCard).toContainText("active");
19 
20 await expect(page.getByText(`admin@${domain}`, { exact: true })).toBeVisible();
21 await expect(page.getByText(`postmaster@${domain}`, { exact: true })).toBeVisible();
22 await expect(page.getByText(`abuse@${domain}`, { exact: true })).toBeVisible();
23 await expect(page.getByText(`webmaster@${domain}`, { exact: true })).toBeVisible();
24});