Repository navigation
fix(test): use groups not legacy role in recommendations-lookback mockUser (closes #935) - #936
Conversation
…kUser (closes #935) The mockUser helper was still supplying `role: 'admin'` after the group-membership authz migration (#912/#917). permissions.ts isAdmin() now reads user.groups, so the old fixture always yielded canEdit=false, the lookback change listener was never attached, and 11 assertions failed on the base branch. Mirror the pattern already used in recommendations-permissions.test.ts: import ADMINISTRATORS_GROUP_ID and set groups: [ADMINISTRATORS_GROUP_ID] for admin, groups: [] for non-admin roles.
|
Warning Review limit reached
More reviews will be available in 5 minutes and 19 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
closes #935
Summary
mockUserinrecommendations-lookback.test.tswas still using the pre-feat(auth): /api/auth/me/permissions endpoint + wire frontend canAccess (lift non-admin UI lockout) #917 legacyrolefieldisAdmin()readsuser.groups, so the old fixture always yieldedcanEdit === false, the lookback change listener was never attached, and 11 tests failed on the base branchADMINISTRATORS_GROUP_IDfrom../permissionsand switchedmockUserto setgroups: [ADMINISTRATORS_GROUP_ID]for admin,groups: []for non-admin roles -- mirrors the pattern inrecommendations-permissions.test.tsTest plan
npm test -- recommendations-lookbackshows 11 failed, 6 passednpm test -- recommendations-lookbackshows 17 passed, 0 failednpm run buildsucceeds with no errors