Skip to content

test: match the forced token refresh URL in the logout tests - #860

Open
dealerweb wants to merge 1 commit into
bulwarkmail:mainfrom
dealerweb:fix/logout-test-force-url
Open

test: match the forced token refresh URL in the logout tests#860
dealerweb wants to merge 1 commit into
bulwarkmail:mainfrom
dealerweb:fix/logout-test-force-url

Conversation

@dealerweb

Copy link
Copy Markdown
Contributor

Summary

refreshAccessToken now skips the server-side token cache by default and appends force=true to its PUT (part of the shorter auth waterfall). The logout redirect tests still mock the bare slot URL, so every refresh hits the mock's unexpected-call guard — three tests fail on main. This brings the mocks in line with the new URL.

Changes

  • Match the PUT on /api/auth/token?slot=0&force=true in the fetch mocks and call-count filters of stores/__tests__/auth-store-logout.test.ts; the DELETE paths are unchanged.

Related issues

None — test-only follow-up to the auth waterfall change.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactor / code quality improvement
  • Chore / dependency update / CI change

Checklist

  • I have read the Contributing Guide
  • My code follows the project's code style and conventions
  • I have run npm run typecheck && npm run lint and there are no errors
  • The build passes (npm run build)
  • I have tested my changes locally
  • I have added or updated documentation if needed
  • I have updated translations (locales/) if my changes affect user-facing text
  • I have included screenshots or a screen recording for UI changes

Screenshots / demo

No UI involved — test-only change.

Notes for reviewers

  • Reproduce on main: npx vitest run stores/__tests__/auth-store-logout.test.ts fails 3 of 6 with "Unexpected fetch call: PUT /api/auth/token?slot=0&force=true"; 6/6 green with this change.
  • The force=true default itself looks intentional (documented inline in refreshAccessToken); this PR only aligns the tests.

The shorter auth waterfall makes refreshAccessToken skip the server-side
token cache by default, appending force=true to the PUT. The logout
redirect tests still mocked the bare slot URL, so every refresh hit the
mock's unexpected-call guard and three tests failed. Match the PUT on
the forced URL; the DELETE paths are unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant