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

+22 -9
View File
@@ -35,7 +35,10 @@ test.describe.serial("owner administration journeys", () => {
await signIn(page, SEEDED.owner.email, "password123");
await page.goto("/owner");
await expect(page.getByRole("heading", { name: "Dashboard" })).toBeVisible();
// The Manage hub's H1 (see (owner)/owner/page.tsx) — Dashboard content
// is shown first/most prominently inside it rather than on its own
// page, per the merged-nav brief's "Dashboard placement" requirement.
await expect(page.getByRole("heading", { name: "Manage" })).toBeVisible();
// Seeded fixtures from prisma/seed.ts: Owen Clarke has no working hours,
// and "Kids Haircut (Under 12)" has no eligible active staff member.
await expect(page.getByText("Owen Clarke has no working hours set")).toBeVisible();
@@ -294,7 +297,11 @@ test.describe.serial("owner administration journeys", () => {
// Seeded: Sam Osei has a CHECKED_IN appointment with Leo today, and sits
// exactly at the loyalty reward threshold with one AVAILABLE reward.
const card = page.locator(".rounded-jumbo").filter({ hasText: "Sam Osei" }).filter({ hasText: "Arrived" });
// This page renders agenda cards via AppointmentCard -> Card (see
// components/ui/card.tsx), whose root class is `rounded-md` — not
// `rounded-jumbo`, which was never an actual class anywhere in this
// app (see findAppointmentCard in helpers.ts, which had the same bug).
const card = page.locator(".rounded-md").filter({ hasText: "Sam Osei" }).filter({ hasText: "Arrived" });
await card.getByRole("link", { name: "View", exact: true }).click();
await expect(page.getByText(/Subtotal/)).toBeVisible();
@@ -315,23 +322,29 @@ test.describe.serial("owner administration journeys", () => {
await page.goto("/owner");
await expect(page).toHaveURL(/\/staff$/);
await expect(page.getByRole("heading", { name: "Calendar" })).toBeVisible();
await expect(page.getByRole("heading", { name: "Dashboard" })).toHaveCount(0);
await expect(page.getByRole("heading", { name: "Manage" })).toHaveCount(0);
});
test("12. the owner switches back to barber tools without losing the barber nav", async ({ page }) => {
test("12. the owner reaches barber tools straight from the merged nav — no mode switch", async ({ page }) => {
await signIn(page, SEEDED.owner.email, "password123");
await page.goto("/owner");
await page.getByRole("link", { name: "Barber Tools", exact: true }).click();
await expect(page).toHaveURL(/\/staff$/);
await expect(page.getByRole("heading", { name: "Calendar" })).toBeVisible();
await expect(page.getByRole("link", { name: "Current", exact: true })).toBeVisible();
// The old "Switch to Owner Admin"/"Switch to Barber Tools" links are
// gone (see the merged-nav brief) — an owner reaches their own barber
// tools via the same "Now" nav item a barber uses, not a mode switch.
await expect(page.getByText("Barber Tools")).toHaveCount(0);
await expect(page.getByText("Switch to Barber Tools")).toHaveCount(0);
await page.getByRole("link", { name: "Now", exact: true }).first().click();
await expect(page).toHaveURL(/\/staff\/current$/);
await expect(page.getByRole("link", { name: "Settings", exact: true }).first()).toBeVisible();
});
test("13. owner reports show real, data-backed appointment/service/staff/customer/loyalty/notification figures", async ({ page }) => {
await signIn(page, SEEDED.owner.email, "password123");
await page.goto("/owner");
await page.getByRole("link", { name: "View Reports" }).click();
// "View Reports" was the old Dashboard footer's button label; Reports is
// now one of the Manage hub's grouped sections (see (owner)/owner/page.tsx).
await page.getByRole("link", { name: "Reports", exact: true }).click();
await expect(page).toHaveURL(/\/owner\/reports/);
await expect(page.getByRole("heading", { name: "Reports", exact: true })).toBeVisible();