Test suite for sign-in, workspace role checks, and protected-route guards
Use this suite to check the paths that decide who may open a screen in a college workspace. It inventories the risky paths already described in this pack, states the gap for each one, and gives one matrix for allowed access, denied access, expired sessions, and role boundary cases. The checker on this page is example only and sends nothing and saves nothing. The server check on every request governs in the signed-in app.
Inventory of untested risky code in this pack
Read this table before changing a guard. Each row names the path as described in this pack, the risk if the path is wrong, what the pack already checks on a page, and the gap this suite closes. No row adds a sign-in path, a role, or a permission.
| Path | Risk if wrong | Coverage in this pack today | Gap closed by this suite |
|---|---|---|---|
| MAJIC sign-in entry and preserved destination, at /app/ with a next path | An external address, a token, or question text in the destination sends a person to the wrong place or carries private text in the page address | Sign-in and session recovery keeps a same-origin destination only and rejects an external or token destination in its tool | No matrix case for an encoded slash, a hash, a query string, or a destination that no longer exists or no longer covers the role |
| Session expiry with a typed draft | A queued question, rating, or save is auto-sent after sign-in, or a draft for one college is carried into another college | The recovery guide states no auto-send, review before send, and discard on college change | No page check for discard on college change, for a failed sign-in loop, or for session-only mode stating that no draft is kept |
| Workspace load and college confirmation | Work is added in the wrong college workspace, or an empty list is read as zero work for the correct college | First login with no workspace, Get started friction log, and the stall map state stop and switch workspace | No case for no workspace shown, wrong college shown, and load failure followed by a 401 on retry |
| Workspace role checks in Team | A pending invite is read as an active role, or a person approves a submission that person submitted or built | Role first-run checklists and the workspace member audit state active role and different approver | No boundary matrix for pending invite, role removed mid-session, role changed and Check again, and submitter as approver for a source and for an assistant |
| Protected-route guards, the 403 case | A retry loop for a step the role cannot cover, a button that does nothing, or a saved link that reopens a step after a role change | The recovery guide simulates one 403 with no retry and a named covering role | No case for Check again only after a confirmed role change, and no case for a saved link after role removal |
| Separate detail and export permissions | Full question text is viewed, or report detail is exported, without the separate permission, or the view and export are not audit logged | Set retention and access and Read reports state the separate permission and audit entry | No test links the permission to the 403 screen, the audit entry, and the filters and row count on the export record |
| Test and session-only exclusion | A test session creates a saved record, a follow record, or a count, or a session-only college claims a record was saved | Many guides state test sessions are labeled as test and excluded, and session-only mode keeps nothing after the session ends | No auth case for a test session opening a protected step and for a session-only save screen |
Scope note. This pack holds public guides only. It holds no Worker code, no route module, and no server test file, so no server path can be quoted from this pack. This suite states the cases a signed-in app test must cover from the rules already stated in the guides above. It does not change any guard.
Test matrix for allowed, denied, expired, and boundary cases
Run each case in a test college workspace with test recipients. Record the correlation ID, the response category, the route, the college, and the assistant for each result. A case passes only when the response, the screen, and the kept work all match.
| Case | Setup | Expected response and screen | Kept or cleared |
|---|---|---|---|
| A1 Allowed, valid session | Signed in, college name at the top matches the workspace, role covers Ask | 200 with data. Ask opens for a published assistant in that college | Typed question stays in its field. No failure screen |
| A2 Allowed, approver different person | Approver holds an active approver role and did not submit the source or build the assistant | 200 with data. Sources opens the source in review with approve and return actions | Approval record shows reviewer name, decision, note, and date |
| A3 Allowed, viewer opens shared collection | Viewer role assigned in Team for that college, signed in, college confirmed | 200 with data. Collection opens with source title, source link, and last checked date | No edit or approve control is shown |
| A4 Allowed, admin sets retention | College administrator role, Governance open for that college and assistant | 200 with data. Rule saves and audit entry shows who set it, when, and for which college and assistant | New chat confirms the rule applies |
| D1 Denied, no workspace | Signed in, no workspace for the college is shown | Stop screen. No work added in another college and no create workspace step | No draft carried to another college |
| D2 Denied, no role | Workspace shown, Team shows no active role for the account | Request access screen naming the college administrator and the role and task fields | No role step button is shown |
| D3 Denied, wrong college | College name at the top does not match the intended college | Stop and switch workspace before any add or open | Typed text for the wrong college is not shown in the correct college |
| D4 Denied, visitor personal question | No account, website widget, personal topic | Sign-in request or named handoff office. No student record shown in public | Public approved sources only |
| D5 Denied, role does not cover step | Student role tries to approve a source | 403. Screen names the approver role and links to Approve a source | Draft kept. No Try again loop and no button that does nothing |
| D6 Denied, no detail or export permission | Role covers Reports but separate detail or export permission is not held | 403 with a plain reason. No full question text and no export file | Counts and themes only. No audit entry for a view that did not happen |
| E1 Expired, mid-draft | Session ends while a question draft is typed in the same college | 401. Session-ended screen with correlation ID and Sign in again and continue | Draft restored after sign-in. Nothing auto-sent. Review before send |
| E2 Expired, deep link while signed out | Deep link to a valid same-origin app path opened while signed out | 401 with preserved destination named in plain words | Only same-origin path and safe filter keys. No token or question text in the destination |
| E3 Expired, unsafe destination | Destination holds an external address, a token, or question text | Destination rejected to Today with an explanation and a correlation ID | No external navigation and no private text in the page address |
| E4 Expired, failed sign-in | Sign-in fails after a 401 | Failure screen again with a new correlation ID. No bounce loop | Preserved destination kept for the next sign-in attempt |
| B1 Boundary, self-approval | Submitter tries to approve the same source or assistant | 403. Screen names a different approver role | Submission stays in review. No approval record for the submitter |
| B2 Boundary, pending invite | Approver invite sent, Team does not yet show an active role | Source cannot be submitted for approval. Invite is not ready | No approval by a pending invite |
| B3 Boundary, role removed mid-session | Covering role is removed after a screen opens | 403 on the next request. Saved link from before the change does not reopen the step | Typed text kept for the same college. Server check governs |
| B4 Boundary, role changed to cover | Role change is confirmed in Team after a 403 | Check again appears only now. Next request opens the step | No retry loop before the confirmed change |
| B5 Boundary, system view | System office governance staff open Reports in system view | Totals grouped by college only. No question text | No cross-college join and no person detail |
| B6 Boundary, test session | Test or staff preview session opens a protected step | Screen labeled as test. No saved record, no follow record, no count | Test exclusion shown where the screen can count it |
| B7 Boundary, session-only save | College uses session-only mode and a save is attempted | Screen states nothing is kept after the session ends | No saved claim is made |
| B8 Boundary, destination no longer works | Preserved destination was removed or the role no longer covers it | Failure screen for that destination with its own correlation ID and Open Today | No silent landing on a home screen with no explanation |
Run an example check on this page
Example only. Nothing entered here is sent to a server and nothing is saved. Use the result to confirm the order of checks in the matrix, then run the same case in a test college workspace. A category can be allowed only when the session is valid, the college matches, the role is active and covers the step, and any separate permission the step needs is held.
Fields marked are required.
Choose the session state for the example.
Only view and export steps need this check in this example.
Choose each field, then choose Run example check.
Checks before you ship a guard change
Run each check in a test college workspace on phone and desktop, with keyboard and screen reader. If a check fails, fix it before a live send.
- Run A1 to A4 and confirm each allowed case opens with data and no failure screen, and the audit entry matches where the guide requires one
- Run D1 to D6 and confirm each denied case names the next action, shows no button that does nothing, and keeps no work from another college
- Run E1 to E4 and confirm return to the same screen with the draft restored, nothing auto-sent, and a new correlation ID after a failed sign-in
- Run B1 to B8 and confirm self-approval and pending invite are blocked, a saved link does not reopen a step after role removal, and Check again appears only after a confirmed role change
- Confirm test sessions are labeled as test and excluded, session-only mode states its rule, and an app failure is not counted as not answered
- Confirm focus is visible, controls are at least 44 pixels high, the failure is announced once, and the heading and filters stay visible
Follow Sign-in, session, and workspace recovery for the failure screen, Role first-run checklists for the first session by role, Workspace member and role audit for orphan and duplicate checks, Set retention and access for permission rules, and Read reports for counts by college and assistant.
Next guide
Recover from a failed sign-in, session, or workspace load without losing work.