Event wizard: how people book (whole course / pick sessions), capacity per session and per-option session mode. Session picker on the public registration page, Manual registration and the kiosk; at the door points to Manual registration. Register, tickets and My Events handle picked sessions. Adds docs/ROADMAP-v2.md and docs/HANDOVER.md so work can carry on from another machine, and a pick-sessions e2e test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
1.3 KiB
TypeScript
27 lines
1.3 KiB
TypeScript
import { test, expect, seed, loginAs, api } from "./fixtures";
|
|
|
|
type Registration = { id: string; eventId: string; registrationOptions: { sessionId?: string | null; priceSnapshot: number }[] };
|
|
|
|
test.describe("pick sessions", () => {
|
|
test("book two classes of a drop-in event; a full class can't be ticked", async ({ page }) => {
|
|
await loginAs(page, "user");
|
|
await page.goto(`/register/${seed().events.dropIn}`);
|
|
await expect(page.getByText("R50.00 per session").first()).toBeVisible();
|
|
await page.getByRole("button", { name: "+" }).first().click();
|
|
|
|
const picker = page.getByRole("group", { name: "Choose sessions" });
|
|
await expect(picker.getByText("Full")).toBeVisible();
|
|
await expect(picker.getByRole("checkbox").first()).toBeDisabled();
|
|
await picker.getByRole("checkbox").nth(1).check();
|
|
await picker.getByRole("checkbox").nth(2).check();
|
|
await expect(page.getByText("Total: R100.00")).toBeVisible();
|
|
|
|
await page.getByRole("button", { name: "Register", exact: true }).click();
|
|
await page.waitForURL(/\/registration\/success/);
|
|
|
|
const regs = await api<Registration[]>(page, "user", "GET", "/api/registrations/myregistrations");
|
|
const reg = regs.find((r) => r.eventId === seed().events.dropIn);
|
|
expect(reg?.registrationOptions.filter((o) => o.sessionId)).toHaveLength(2);
|
|
});
|
|
});
|