Files
glenloch-media/e2e/settings.spec.ts
2026-11-20 04:07:02 +00:00

35 lines
1.2 KiB
TypeScript

import { test, expect } from "@playwright/test";
import { signInAs, resetDb, BASE } from "./dev";
/** Admin email identity settings persist in the database, not env files. */
test.describe("email settings", () => {
test.beforeAll(async ({ browser }) => {
const context = await browser.newContext();
const page = await context.newPage();
await resetDb(page);
await context.close();
});
test("admin can edit the sender and notification inbox", async ({ page }) => {
await page.setViewportSize({ width: 1024, height: 900 });
await signInAs(page, "admin@glenloch.local");
await page.goto(`${BASE}/settings`);
await page.getByLabel("From address").fill("notifications@glenloch.local");
await page
.getByLabel("Admin notifications (optional)")
.fill("ops@glenloch.local");
await page.getByRole("button", { name: "Save email settings" }).click();
await expect(page.getByText(/Saved\. New notifications/)).toBeVisible();
await page.reload();
await expect(page.getByLabel("From address")).toHaveValue(
"notifications@glenloch.local",
);
await expect(page.getByLabel("Admin notifications (optional)")).toHaveValue(
"ops@glenloch.local",
);
});
});