test(e2e): accept both paginated and legacy session-list shapes #201
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-183-sessions-e2e-shape-transition"
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?
The account-sessions e2e probe asserts the session list returned by GET /users/me/sessions. The suite runs against a live deployment and, on a pull_request, the PR's code is never deployed (e2e.yml runs a /health reachability check, not a deploy), so the test always runs against whatever staging currently serves.
BUNYIP-177 (PR #200) reshaped this endpoint from the legacy
{ data: { sessions: [...] } }envelope to the paginated{ data: { items: [...], ... } }envelope and updated the assertion to readdata.items. Against staging still serving the legacy shape,data.itemsis undefined, the list falls back to[], and the "expected at least one active session" assertion fails with 0 (run #852).Read the list from
data.itemsfirst and fall back todata.sessions, so the assertion passes regardless of which shape the deployment currently serves. This survives the window between merge and deploy for any response-shape change to this endpoint, and is the pattern the paginated PR should adopt.#BUNYIP-183