Skip to content

fix(test): use groups not legacy role in recommendations-lookback mockUser (closes #935) - #936

Merged
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/935-lookback-test-groups
Jun 3, 2026
Merged

cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/935-lookback-test-groups

Conversation

@cristim

@cristim cristim commented Jun 3, 2026

Copy link
Copy Markdown
Member

closes #935

Summary

Test plan

  • Before fix: npm test -- recommendations-lookback shows 11 failed, 6 passed
  • After fix: npm test -- recommendations-lookback shows 17 passed, 0 failed
  • npm run build succeeds with no errors

…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.
@cristim cristim added triaged Item has been triaged priority/p1 Next up; this sprint severity/high Significant harm urgency/this-sprint Within the current sprint impact/internal Team-internal only effort/s Hours type/bug Defect labels Jun 3, 2026
@coderabbitai

coderabbitai Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@cristim, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 43879d13-fa7e-427f-9d07-12f3a35b8395

📥 Commits

Reviewing files that changed from the base of the PR and between eb85a50 and c09dc4d.

📒 Files selected for processing (1)
  • frontend/src/__tests__/recommendations-lookback.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/935-lookback-test-groups

Comment @coderabbitai help to get the list of available commands and usage tips.

@cristim

cristim commented Jun 3, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim
cristim merged commit c00445c into feat/multicloud-web-frontend Jun 3, 2026
5 checks passed
@cristim
cristim deleted the fix/935-lookback-test-groups branch June 3, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/internal Team-internal only priority/p1 Next up; this sprint severity/high Significant harm triaged Item has been triaged type/bug Defect urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant