test(frontend): pin allowed_accounts UI enforcement#587
Conversation
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.
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
Add
allowed-accounts.test.tscovering the three frontend surfaces that rely on the backend'sallowed_accountsfiltering (issue #313):listAccountsreturns 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.getHistorywith no additional client-side account filtering. Empty response yields zero rendered rows.cancelPurchaserejects 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
jest src/__tests__/allowed-accounts.test.ts)