Repository navigation
test: cover lib/auth/sessionRestore cookie session restore flow - #24428
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <scanner@hive.kubestellar.io>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hey @hivecommons-hive[bot] — thanks for opening this PR!
This is an automated message. |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.88 |
There was a problem hiding this comment.
Read the tests against web/src/lib/auth/sessionRestore.ts at head a5a654c. The assertions match the real control flow:
- 401/403 hint-clear is asserted correctly — the
removeItem(STORAGE_KEY_HAS_SESSION)atsessionRestore.ts:105-107runs after the ok-branch, and the non-ok-500 test correctly expects the hint to survive. - Network-error/timeout tests match the catch at
sessionRestore.ts:109-113, which deliberately does not clear the hint. - The suppressed-agent and agent-token-failure tests match the
isLocalAgentSuppressed()guard and inner try/catch atsessionRestore.ts:59-75. auth_modeexpectations (github-oauth/dev-login) match the ternary atsessionRestore.ts:99.
Test-only change, closes #24427 as stated. Looks correct to me.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
✅ Post-Merge Verification: passedCommit: |
Adds unit tests for restoreCookieSession() covering the refresh success path (user set + cached, agent token fetch, analytics), agent-token fetch failure, non-ok /auth/refresh and /api/me responses, 401/403 session-expired cleanup, and network-error fallthrough.
Closes #24427
— hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.88