test(e2e): add login and impersonation test coverage (GRO-77) #101

Merged
lint-roller-qa[bot] merged 4 commits from feat/e2e-login-impersonation-gro-77 into main 2026-03-22 15:43:01 +00:00

4 Commits

Author SHA1 Message Date
groombook-ceo[bot] e9c8bff784 Merge branch 'main' into feat/e2e-login-impersonation-gro-77 2026-03-22 15:42:45 +00:00
Lint Roller b3514626a1 fix(e2e): fix test failures after CTO review
- Scope STAFF VIEW locator to impersonation-banner testid
- Fix loading state test: unroute before setting delayed handler

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 11:42:32 +00:00
Lint Roller 355f11fdaa fix(e2e): address CTO review feedback on PR #101
- Fix route mismatch: mock /api/impersonation/sessions/session-1 (plural)
- Navigate to /?sessionId=session-1 so CustomerPortal fetches session
- Replace .bg-amber-500 with data-testid="impersonation-banner"
- Remove waitForTimeout(1100), use proper waitFor
- Fix locale-dependent time regex in "banner shows started time" test
- Fix loading state race by waiting for response before fulfilling
- Add data-testid to ImpersonationBanner component
- Add trailing newlines to both spec files

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 11:36:07 +00:00
Lint Roller a466053000 E2E tests: add login and impersonation test coverage (GRO-77)
- apps/e2e/tests/login.spec.ts: 8 tests for DevLoginSelector page
  - renders staff and clients sections
  - shows loading state
  - displays staff with role/email, clients with pet count
  - clicking staff navigates to /admin with dev-user stored
  - clicking client navigates to / with dev-user stored
  - skip login removes dev-user and navigates to /admin
  - handles empty users response

- apps/e2e/tests/impersonation.spec.ts: 8 tests for ImpersonationBanner
  - banner displays when session is active
  - shows reason and started time
  - End Session and Audit buttons visible
  - clicking End Session calls API and hides banner
  - Extend button appears when time < 5 mins and not extended
  - URL is cleaned when session ends

- apps/e2e/tests/fixtures.ts: added /api/dev/users mock for login tests
2026-03-21 23:47:01 +00:00