mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
fix(ui/tests): drop over-broad fetch-not-called assertion in admin-only page tests
The Workflow Runs, Memory and Guardrails Monitor page.integration tests asserted that fetchMock was never called for non-admin roles, but useCan always calls useIsOrgAdmin, which fires GET /organization/list during render regardless of the capability being checked. That call is unrelated to the page-specific request the tests actually guard against, and the follow-up filter check on the page's URL already covers that intent, so the blanket assertion just made the suite flake red on every commit. Drop the redundant waitFor so the URL-scoped filter is the single source of truth for 'no page-specific request fires'. Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
This commit is contained in:
parent
8bfb7772e4
commit
89d0849625
3 changed files with 0 additions and 3 deletions
|
|
@ -46,7 +46,6 @@ describe("Guardrails Monitor page access by role", () => {
|
|||
renderAs(userRole);
|
||||
|
||||
expect(await screen.findByText("Guardrails Monitor is only available to admin users.")).toBeInTheDocument();
|
||||
await waitFor(() => expect(fetchMock).not.toHaveBeenCalled());
|
||||
expect(requestedUrls().filter((url) => url.includes("/guardrails/usage"))).toEqual([]);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ describe("Memory page access by role", () => {
|
|||
renderAs(userRole);
|
||||
|
||||
expect(await screen.findByText("Memory is only available to admin users.")).toBeInTheDocument();
|
||||
await waitFor(() => expect(fetchMock).not.toHaveBeenCalled());
|
||||
expect(requestedUrls().filter((url) => url.includes("/v1/memory"))).toEqual([]);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ describe("Workflows page access by role", () => {
|
|||
renderAs(userRole);
|
||||
|
||||
expect(await screen.findByText("Workflow Runs is only available to admin users.")).toBeInTheDocument();
|
||||
await waitFor(() => expect(fetchMock).not.toHaveBeenCalled());
|
||||
expect(requestedUrls().filter((url) => url.includes("/v1/workflows"))).toEqual([]);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue