litellm/ui
Cursor Agent 46084632f2
test(ui): stub useCan in tests that render its transitive useQuery caller
Six tests that render components calling useCan started failing after PR
#36475 added the capability check. useCan pulls in useIsOrgAdmin, which
calls useOrganizations, which calls useQuery -- so the tests either
crashed with 'No QueryClient set' (unit tests without a provider) or
fired an unexpected /organization/list fetch that broke role-gated
'fetch not called' assertions (integration tests).

Mock useCan directly to run hasCapability against the already-mocked
useAuthorized userRole. Session-role-driven capabilities work as before;
tests that need viewDeletedTeams-style isOrgAdmin behavior already mock
useCan at file scope and are unaffected.

Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
2026-08-11 03:24:59 +00:00
..
litellm-dashboard test(ui): stub useCan in tests that render its transitive useQuery caller 2026-08-11 03:24:59 +00:00
Dockerfile chore(build): move the Admin UI toolchain to Node 24 (#35801) 2026-08-04 12:36:07 -07:00
nginx.conf fix(ui): serve /ui/assets from the nginx image instead of SPA fallback (#34066) 2026-07-21 09:22:02 -07:00