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:
Cursor Agent 2026-08-12 04:35:30 +00:00
parent 8bfb7772e4
commit 89d0849625
No known key found for this signature in database
3 changed files with 0 additions and 3 deletions

View file

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

View file

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

View file

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