feat(website): people and roles, messages with the YouTube feed, simple events
People: Owners and Admins add someone by email (people.ensure through Accounts), change roles, remove access; only Owners touch Owners, nobody changes themselves, a lower role ends sessions at once. Messages: from a YouTube channel or playlist every hour (public feed, no key) or by hand with a YouTube or Spotify link; own publish, hide. Simple events: own publish, cancel, remove. Tests and e2e with axe on the new screens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -132,9 +132,24 @@ test("a Viewer sees the admin but can't publish", async ({ page, context }) => {
|
||||
await expect(page.getByRole("button", { name: /Publish/ })).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("the admin's screens are accessible", async ({ page, context }) => {
|
||||
test("an event added and published shows on the site at once (its own Publish)", async ({ page, context }) => {
|
||||
await signIn(context);
|
||||
for (const path of ["/admin", "/admin/template", "/admin/pages", "/admin/ministries", "/admin/leaders", "/admin/media", "/admin/publish"]) {
|
||||
await page.goto("/admin/events");
|
||||
await page.getByRole("button", { name: "Add an event" }).click();
|
||||
await page.getByLabel("Title").fill("Prayer breakfast");
|
||||
await page.getByLabel("Date", { exact: true }).fill(new Date(Date.now() + 3 * 864e5).toISOString().slice(0, 10));
|
||||
await page.getByLabel("Where", { exact: true }).fill("The hall");
|
||||
await page.getByRole("button", { name: "Save" }).click();
|
||||
await expect(page.getByText("Not published").first()).toBeVisible();
|
||||
await page.getByRole("listitem").filter({ hasText: "Prayer breakfast" }).getByRole("button", { name: "Publish" }).click();
|
||||
await expect(page.getByText("On the site now.")).toBeVisible();
|
||||
await page.goto("/events");
|
||||
await expect(page.getByRole("link", { name: "Prayer breakfast" })).toBeVisible();
|
||||
});
|
||||
|
||||
test("the admin's screens are accessible", async ({ page, context }) => {
|
||||
await signIn(context, "owner");
|
||||
for (const path of ["/admin", "/admin/template", "/admin/pages", "/admin/ministries", "/admin/leaders", "/admin/messages", "/admin/events", "/admin/media", "/admin/publish", "/admin/people"]) {
|
||||
await page.goto(path);
|
||||
await expect(page.getByRole("heading", { level: 1 })).toBeVisible();
|
||||
const axe = await new AxeBuilder({ page }).withTags(["wcag2a", "wcag2aa", "wcag21aa", "wcag22aa"]).analyze();
|
||||
|
||||
Reference in New Issue
Block a user