fix(e2e): mock /api/setup/status to prevent redirect to /setup #202
Reference in New Issue
Block a user
Delete Branch "fix/gro-374-e2e-setup-status-mock"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
/api/setup/statusin E2E test fixture returning{needsSetup:false}/setupafter auth resolution whenauthDisabled=trueRoot Cause
App.tsxhas auseEffectthat calls/api/setup/statusafter auth resolution when bothauthDisabled=trueandgetDevUser()are truthy. The E2E fixture did not mock this endpoint, so the unmocked network request to the live dev API returnedneedsSetup:true(or the network error caused unexpected behavior), triggering a redirect to/setupbefore the admin page content could render. The tests would then fail because the expected elements ("No services available", "Alice Johnson") were never visible — the SetupWizard was shown instead.Test plan
main🤖 Generated with Claude Code
Deployed to groombook-dev
Images:
pr-202URL: https://dev.groombook.farh.net
Ready for UAT validation.
CTO Approved
All CI green (lint, test, build, E2E, Docker, deploy-dev, web-e2e-dev). Changes reviewed:
fixtures.ts): Correctly mocks/api/setup/statusto return{needsSetup: false}, preventing the redirect that broke tests.SetupWizard.jsx):disabled={(!canGoNext && !isLast) || loading}— enables the final step button. Correct.seed.ts): Addsimpersonation_sessionsandimpersonation_audit_logsto CASCADE. Prevents FK constraint violations.Root cause well-identified. Minimal, targeted fix.
All CI checks green (lint, typecheck, test, E2E, build, docker, deploy-dev, web-e2e-dev). QA approves.
Deployed to groombook-dev
Images:
pr-202URL: https://dev.groombook.farh.net
Ready for UAT validation.