fix(e2e): onboard the E2E fixture account so specs are not bounced to onboarding (PMS-641) #436
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-641-onboard-e2e-account"
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?
What
Onboard the E2E fixture account in
global.setup.tsso specs stop being bounced to/onboarding/profile.Why
The E2E bunyip account's userinfo carries no
given_name/family_name, so mokosh's JIT provisioning (auth::service upsert_user_from_oidc,src/modules/auth/service.rs:1819-1823) leavesprofile_completed_atNULL.profile_completedisprofile_completed_at.is_some(), and the mokosh-apps AuthGuard (mokosh-apps/src/lib.rs:96,101) redirects any incomplete user to/onboarding/profile. So on firefox/webkit the form-validation spec logged in, navigated toward/tickets/new, and landed on/onboarding/profile- the ticket form never rendered (PMS-641). Login itself succeeded; the block was the onboarding gate.Change
After the setup captures + persists the bearer, it now PUTs
/api/v1/auth/mewith a first/last name.update_userstampsprofile_completed_at = COALESCE(profile_completed_at, NOW())when both names are present (service.rs:1174-1176), so the call is idempotent (only the first run sets it) and the account stays onboarded. Usesenv.apiBaseURL+ the just-captured bearer viarequest.newContext(mirroring the sharedrequestfixture, which can't be reused here because it readstoken.txt, written on the line above).Validation
The onboarding PUT hits the existing staging
PUT /me(not a new endpoint) and persists before any spec runs, so this PR's own E2E run should go green (form-validation reaches the ticket form). Local TS typecheck was not possible (nopackage-lock.json, no offline typescript), but the added code is a faithful copy ofe2e/lib/fixtures.ts(request.newContext({baseURL, extraHTTPHeaders})) ande2e/tests/settings.spec.ts(request.put(route, {data})).Fixes PMS-641.