Staff / Owner

Merged staff and owner settings
This commit is contained in:
Stefan Lazic committed 2026-08-05 16:35:52 +01:00
1 parent cf3a28f3cd
commit 3300045d9e
23 files changed
+693 -236

No files matched your search

+18 -2
View File
@@ -11,6 +11,10 @@ export const SEEDED = {
// first in the suite, so this is safe there).
secondCustomer: { email: "sam.osei@example.com", password: "password123", name: "Sam Osei" },
owner: { email: "marcus@blakeheritage.co.uk", name: "Marcus Reed" },
// Provisioned by global-setup.ts via scripts/ensure-super-admin.ts, not
// prisma/seed.ts — a Super Administrator deliberately has no StaffProfile
// (see isSuperAdmin) and stays out of the dev/demo seed data on purpose.
superAdmin: { email: "superadmin@blakeheritage.co.uk", password: "password123", name: "Super Admin" },
barberHaircutOnly: { email: "leo@blakeheritage.co.uk", name: "Leo Vance" },
barberSkinfadeBeard: { email: "jamie@blakeheritage.co.uk", name: "Jamie Wallace" },
services: {
@@ -98,9 +102,21 @@ export async function completeBookingFlow(
await expect(page.getByRole("heading", { name: "You're all set!" })).toBeVisible();
}
/** Locates a specific appointment card on /appointments by its rendered service + barber text, scoping later actions (Reschedule/Cancel/Book Again) to that one card so they can't accidentally hit a different appointment. */
/**
* Locates a specific appointment card on /appointments by its rendered
* service + barber text, scoping later actions (Reschedule/Cancel/Book
* Again) to that one card so they can't accidentally hit a different
* appointment. Cards there render via AppointmentCard -> Card (see
* components/ui/card.tsx), whose root class is `rounded-md` — not
* `rounded-jumbo`, which was never an actual class in this app (confirmed:
* zero matches anywhere in the rendered page). Every test using this
* helper (2, 3, 4, 5, 6 in customer-journeys.spec.ts) was therefore always
* timing out on a selector that could never match, not on any real
* booking/query/rendering bug — same root cause already found and fixed
* in owner-journeys.spec.ts's own loyalty-redemption test.
*/
export function findAppointmentCard(page: Page, serviceName: string, staffName: string) {
return page.locator(".rounded-jumbo").filter({ hasText: serviceName }).filter({ hasText: `with ${staffName}` });
return page.locator(".rounded-md").filter({ hasText: serviceName }).filter({ hasText: `with ${staffName}` });
}
export function uniqueEmail(prefix: string): string {