Skip to content

fix(tests): add missing getAccessTokenClaims mock and update OIDC scope assertion

Jérôme Revillard requested to merge worktree-fix-frontend-tests into main

Summary

  • Add getAccessTokenClaims to keycloakAuthService mock in authStore.test.js and store/modules/auth.test.js
  • Update oidcConfig.test.js scope assertion to include roles (matches oidcConfig.js)
  • Use mockImplementationOnce to prevent mock return value leaking between tests

Context

mapOidcUserToState() in auth.js calls keycloakAuthService.getAccessTokenClaims() to extract realm_access.roles from the access token. The mock was missing this method, causing initialize() to throw before registerSilentRenewCallback() was reached, which made logout cleanup tests fail.

All 166 frontend tests pass.

Merge request reports

Loading