From 64e0f4d5dacce960d1bad9106c3d9d7c198c22b2 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 13 Aug 2026 13:21:19 +0000 Subject: [PATCH] test(ui): scope workflows role-gate assertion to workflow endpoints Follow-up to PR #35176 which fixed the same issue in memory and guardrails-monitor. useCan now goes through useIsOrgAdmin which fetches /organization/list, so the over-broad expect(fetchMock).not.toHaveBeenCalled() in the workflows role-gate test fails on every non-admin case. The scoped assertion on /v1/workflows still enforces the gate this test exists to prove. Co-authored-by: Krrish Dholakia --- .../src/app/(dashboard)/workflows/page.integration.test.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/workflows/page.integration.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/workflows/page.integration.test.tsx index 6b332faf704..5281ba626e1 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/workflows/page.integration.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/workflows/page.integration.test.tsx @@ -46,8 +46,7 @@ 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([]); + await waitFor(() => expect(requestedUrls().filter((url) => url.includes("/v1/workflows"))).toEqual([])); }, );