feat: flip routing — customer portal at /, admin at /admin #57

Merged
ghost merged 3 commits from feat/flip-routing-customer-root into main 2026-03-19 02:47:19 +00:00
ghost commented 2026-03-19 02:13:13 +00:00 (Migrated from github.com)

Summary

  • Moves all admin dashboard routes under /admin prefix (/admin, /admin/clients, /admin/services, etc.)
  • Mounts customer portal at root / — customers get clean, shareable URLs
  • Updates admin nav links to use /admin prefix; "Customer Portal" link points to / for staff preview
  • Fixes pre-existing React 19 act compat issue in tests and adds test for portal-at-root behavior

Closes #56

Test plan

  • All existing tests updated and passing (NODE_ENV=test pnpm --filter web test)
  • Manual: visit / → should see customer portal
  • Manual: visit /admin → should see admin dashboard with appointments
  • Manual: click nav links in admin → all route to /admin/* paths
  • Manual: click "Customer Portal" in admin nav → navigates to /

🤖 Generated with Claude Code

## Summary - Moves all admin dashboard routes under `/admin` prefix (`/admin`, `/admin/clients`, `/admin/services`, etc.) - Mounts customer portal at root `/` — customers get clean, shareable URLs - Updates admin nav links to use `/admin` prefix; "Customer Portal" link points to `/` for staff preview - Fixes pre-existing React 19 `act` compat issue in tests and adds test for portal-at-root behavior Closes #56 ## Test plan - [x] All existing tests updated and passing (`NODE_ENV=test pnpm --filter web test`) - [ ] Manual: visit `/` → should see customer portal - [ ] Manual: visit `/admin` → should see admin dashboard with appointments - [ ] Manual: click nav links in admin → all route to `/admin/*` paths - [ ] Manual: click "Customer Portal" in admin nav → navigates to `/` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ghost commented 2026-03-19 02:22:38 +00:00 (Migrated from github.com)

E2E Tests Failing — Route Prefix Update Needed

The routing flip looks correct and the unit tests were properly updated. However, all 13 E2E tests are failing because they still navigate to the old routes.

The E2E tests in apps/e2e/tests/ need to be updated for the new /admin prefix:

  • navigation.spec.ts: Routes like / (appointments), /clients, /services, /staff, /invoices, /reports, /book/admin, /admin/clients, /admin/services, /admin/staff, /admin/invoices, /admin/reports, /admin/book
  • book.spec.ts: /book/admin/book
  • clients.spec.ts: /clients/admin/clients

Also consider adding an E2E test for the customer portal at / since that's the main behavioral change.

Please fix and push — unit tests and build are green, so this should just be a route prefix update in the test files. Do not merge until E2E is green.

## E2E Tests Failing — Route Prefix Update Needed The routing flip looks correct and the unit tests were properly updated. However, **all 13 E2E tests are failing** because they still navigate to the old routes. The E2E tests in `apps/e2e/tests/` need to be updated for the new `/admin` prefix: - `navigation.spec.ts`: Routes like `/` (appointments), `/clients`, `/services`, `/staff`, `/invoices`, `/reports`, `/book` → `/admin`, `/admin/clients`, `/admin/services`, `/admin/staff`, `/admin/invoices`, `/admin/reports`, `/admin/book` - `book.spec.ts`: `/book` → `/admin/book` - `clients.spec.ts`: `/clients` → `/admin/clients` Also consider adding an E2E test for the customer portal at `/` since that's the main behavioral change. Please fix and push — unit tests and build are green, so this should just be a route prefix update in the test files. **Do not merge until E2E is green.**
ghost commented 2026-03-19 02:26:09 +00:00 (Migrated from github.com)

Fixed all 13 E2E test failures. Changes in 8328f9a:

  • navigation.spec.ts: All admin routes now use /admin prefix; added customer portal smoke test at / (checks for "Paws & Reflect" branding)
  • book.spec.ts: Updated all 3 booking tests from /book/admin/book
  • clients.spec.ts: Updated all 3 client tests from /clients/admin/clients

CI run triggered — waiting for green.

Fixed all 13 E2E test failures. Changes in `8328f9a`: - **navigation.spec.ts**: All admin routes now use `/admin` prefix; added customer portal smoke test at `/` (checks for "Paws & Reflect" branding) - **book.spec.ts**: Updated all 3 booking tests from `/book` → `/admin/book` - **clients.spec.ts**: Updated all 3 client tests from `/clients` → `/admin/clients` CI run triggered — waiting for green.
ghost commented 2026-03-19 02:28:26 +00:00 (Migrated from github.com)

E2E Update — Almost There

Great work on the E2E fixes — 13/13 original failures are now passing. One new test still failing:

navigation.spec.ts:43 — "customer portal loads at root"

Error: strict mode violation: getByText('Paws & Reflect') resolved to 3 elements

The text "Paws & Reflect" appears in 3 places on the customer portal page. Fix: use a more specific locator, e.g.:

await expect(page.locator("header").getByText("Paws & Reflect")).toBeVisible();

One fix and we're green.

## E2E Update — Almost There Great work on the E2E fixes — 13/13 original failures are now passing. One new test still failing: **`navigation.spec.ts:43` — "customer portal loads at root"** ``` Error: strict mode violation: getByText('Paws & Reflect') resolved to 3 elements ``` The text "Paws & Reflect" appears in 3 places on the customer portal page. Fix: use a more specific locator, e.g.: ```ts await expect(page.locator("header").getByText("Paws & Reflect")).toBeVisible(); ``` One fix and we're green.
ghost commented 2026-03-19 02:30:57 +00:00 (Migrated from github.com)

CI is green — all 14 E2E tests passing. Ready for review.

CI is green — all 14 E2E tests passing. Ready for review.
This repo is archived. You cannot comment on pull requests.