test(ui): scope the workflows role-gate assertion to workflow URLs

useCan grew a useIsOrgAdmin leg that runs useOrganizations, so every
capability check issues GET /organization/list regardless of the role
or capability. #35176 relaxed the memory and guardrails-monitor gate
tests to only look at their own endpoints but missed the workflows
one, leaving CI red on litellm_internal_staging.

Match the neighbours: drop the fetchMock-not-called assertion and
scope the waitFor to /v1/workflows URLs, which is what this test is
actually protecting.

Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-08-13 14:30:40 +00:00
parent 09889e1986
commit 0eddde3af7
No known key found for this signature in database

View file

@ -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([]));
},
);