You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Frontend counterpart to #307. The backend test PR pins per-account permission enforcement in the API layer; this issue covers the UI surfaces and frontend tests that must respect the same allowed_accounts constraint end-to-end.
Scope
A user with allowed_accounts: ["uuid1"] should see a UI consistent with what the API returns:
Account selectors (recommendations page, history, plans, dashboard provider/account dropdowns) only list uuid1. Disallowed accounts must not appear at all — not just be disabled.
List views (recommendations table, purchase history, plans) render only rows for uuid1. No client-side filtering relying on the user being honest — but also no flicker where disallowed rows briefly render before being hidden.
Aggregated cards (Dashboard "Potential Monthly Savings", "Effective Coverage", etc.) show aggregates over the allowed subset, matching the backend's filtered aggregate.
Mutate-by-id flows (override edits, plan saves, purchase approvals) surface a friendly error if the user attempts to act on a disallowed cloud_account_id (e.g. via deep link or stale tab) — not an unhandled 403 modal.
Empty states when the user has zero allowed accounts: dashboard renders a "no account access — contact your admin" message instead of a blank skeleton.
Acceptance criteria
Jest tests in frontend/src/__tests__/ for each list view + dashboard summary that mock the API returning a filtered subset and assert the UI renders only the allowed rows.
Jest test that mocks a 403 on a mutate-by-id path and pins the user-facing error copy.
Account-selector dropdowns are populated from the API's filtered account list, not a hardcoded full list.
No regression in dashboard render time on the filtered subset (the existing dashboard.test.ts baseline still passes).
Activity
test(frontend): pin allowed_accounts UI enforcement (#587)
cristim commentedon May 28, 2026
Verified: PR #587 (commit c6b7c61) merged into origin/feat/multicloud-web-frontend on 2026-05-27. Adds frontend/src/tests/allowed-accounts.test.ts (288 lines) pinning allowed_accounts UI enforcement per the issue's acceptance criteria.