Skip to content

test(frontend): pin allowed_accounts UI enforcement#587

Open
cristim wants to merge 1 commit into
feat/multicloud-web-frontendfrom
test/frontend-allowed-accounts-313
Open

test(frontend): pin allowed_accounts UI enforcement#587
cristim wants to merge 1 commit into
feat/multicloud-web-frontendfrom
test/frontend-allowed-accounts-313

Conversation

@cristim
Copy link
Copy Markdown
Member

@cristim cristim commented May 20, 2026

Summary

Add allowed-accounts.test.ts covering the three frontend surfaces that rely on the backend's allowed_accounts filtering (issue #313):

  • Account chip (3 tests): when listAccounts returns a filtered subset the chip option list contains exactly those accounts plus the All Accounts sentinel. Disallowed accounts never appear. Zero-account case yields only the sentinel.
  • History list (2 tests): the UI renders exactly the rows returned by getHistory with no additional client-side account filtering. Empty response yields zero rendered rows.
  • 403 on Cancel (1 test): when cancelPurchase rejects with a 403 (disallowed account accessed via deep link or stale tab) the handler surfaces a user-friendly error toast instead of an unhandled exception.

Closes #313

Test plan

  • All 6 new tests pass (jest src/__tests__/allowed-accounts.test.ts)
  • Pre-commit hooks pass

Add allowed-accounts.test.ts covering the three frontend surfaces that
rely on the backend's allowed_accounts filtering:

1. Account chip: when listAccounts returns a filtered subset the chip
   option list contains exactly those accounts plus the All Accounts
   sentinel. Disallowed accounts never appear. Zero-account case yields
   only the sentinel.

2. History list: the UI renders exactly the rows returned by getHistory
   with no additional client-side account filtering. Empty response
   yields zero rendered rows.

3. 403 on Cancel: when cancelPurchase rejects with a 403 (disallowed
   account accessed via deep link or stale tab) the handler surfaces a
   user-friendly error toast instead of an unhandled exception.
@cristim cristim added triaged Item has been triaged priority/p2 Backlog-worthy severity/medium Moderate harm urgency/this-quarter Within the quarter impact/many Affects most users labels May 20, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Warning

Rate limit exceeded

@cristim has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 47 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 711270c2-9d13-4e28-ae39-207d9ee66490

📥 Commits

Reviewing files that changed from the base of the PR and between bc8831b and 418e850.

📒 Files selected for processing (1)
  • frontend/src/__tests__/allowed-accounts.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/frontend-allowed-accounts-313

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

@cristim
Copy link
Copy Markdown
Member Author

cristim commented May 20, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

✅ Actions performed

Review triggered.

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 added type/chore Maintenance / non-user-visible effort/m Days labels May 20, 2026
@cristim
Copy link
Copy Markdown
Member Author

cristim commented May 22, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

✅ Actions performed

Review triggered.

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
Copy link
Copy Markdown
Member Author

cristim commented May 22, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

✅ Actions performed

Review triggered.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/m Days impact/many Affects most users priority/p2 Backlog-worthy severity/medium Moderate harm triaged Item has been triaged type/chore Maintenance / non-user-visible urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant