test(e2e): add coverage for instruments, authz, admin and the gateway (stage 2)#1430
Merged
joshunrau merged 2 commits intoJul 21, 2026
Merged
Conversation
Stage two of the e2e work: new coverage on top of the stage-one structure, plus a pages/ layout that mirrors apps/web's TanStack route tree so each page object sits at its route's path (+ .page.ts). New specs: - instrument-completion: start a session, administer the Happiness Questionnaire, submit, and confirm the record via "View Current Subject". - authorization: GROUP_MANAGER gets the management nav; STANDARD does not and is redirected off /dashboard and /session/remote-assignment. - admin-management: ADMIN creates a group through the UI and lists users. - gateway-assignment: create a remote assignment, complete it as the patient on the gateway origin (solving the Cap proof-of-work), and confirm the clinician sees it as Complete. Supporting changes: - `authenticateAs(role)` fixture injects a role's token without navigating, so redirect probes are possible (getPageModel asserts its landing route). - Page objects for the instrument showcase and the instrument runner. Notes on the app behaviour these encode: multi-step flows navigate via sidebar clicks because the active session is memory-only and does not survive a hard navigation; and group creation deliberately asserts the success toast/redirect rather than list membership, since /admin/groups appears to be scoped to groups the actor belongs to. Verified locally: 32 passed, parallel and with CI=1 (serial). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The assignment status posts back from the gateway asynchronously and can still read "Outstanding" for a while on a slower runner (seen in CI). A single reload plus assertion retries was not enough, since retries re-query the locator rather than refetching. Retry the reload itself via expect.toPass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage 2 of the e2e work — new coverage on top of the stage-one structure (#1429), plus a
pages/layout that mirrorsapps/web's TanStack route tree.New specs
instrument-completionauthorizationGROUP_MANAGERgets the management nav;STANDARDdoes not, and is redirected off/dashboardand/session/remote-assignmentadmin-managementADMINcreates a group through the UI; lists usersgateway-assignmentSupporting changes
authenticateAs(role)fixture: injects a role's token without navigating, which redirect probes need (getPageModelasserts its landing route).pages/now mirrors the route tree 1:1 — e.g._app/session/start-session.page.ts↔_app/session/start-session.tsx— so a route tells you exactly where its page object lives.App behaviour these encode
page.goto(): the active session is memory-only and does not survive a hard navigation./admin/groupsappears to be scoped to groups the actor belongs to, and creating one does not add the creator as a member. Flagged rather than asserted.Verification
32 passed, both parallel and with
CI=1(serial).🤖 Generated with Claude Code