From e7450b11ba562e265650e5543a049270d7ee06f7 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Mon, 10 Aug 2026 15:38:59 -0700 Subject: [PATCH] test(ui): drop redundant commentary from the team-list scoping tests The removed comments restated the test names and the assertions directly below them. The reasoning they carried is already recorded in the commit that introduced the fix and in the pull request body. --- .../src/app/(dashboard)/hooks/teams/useTeams.test.ts | 2 -- .../src/components/view_logs/log_filter_logic.test.tsx | 2 -- ui/litellm-dashboard/src/utils/roles.test.ts | 5 ----- 3 files changed, 9 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/hooks/teams/useTeams.test.ts b/ui/litellm-dashboard/src/app/(dashboard)/hooks/teams/useTeams.test.ts index 8980c772c9b..fa3f15124cf 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/hooks/teams/useTeams.test.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/hooks/teams/useTeams.test.ts @@ -913,8 +913,6 @@ describe("useAllTeams", () => { await waitFor(() => expect(result.current.isSuccess).toBe(true)); - // A scoped call that comes back empty is the failure this guards against: the - // 401 disappears but the page still shows no teams. expect(result.current.data).toEqual(mockTeams); expect(result.current.data?.length).toBeGreaterThan(0); expect(requestedUserId(fetchMock.mock.calls[0][0] as string)).toBe("member-7"); diff --git a/ui/litellm-dashboard/src/components/view_logs/log_filter_logic.test.tsx b/ui/litellm-dashboard/src/components/view_logs/log_filter_logic.test.tsx index 45ef1d017ac..17d26dc00f3 100644 --- a/ui/litellm-dashboard/src/components/view_logs/log_filter_logic.test.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/log_filter_logic.test.tsx @@ -210,8 +210,6 @@ describe("useLogFilterLogic", () => { await waitFor(() => expect(fetchAllTeams).toHaveBeenCalled()); expect(fetchAllTeams).toHaveBeenCalledWith("test-token", null, "member-7"); - // Without the scope the request 401s and the filter falls back to an empty - // list, so the rows matter as much as the argument. await waitFor(() => expect(result.current.allTeams).toEqual(callerTeams)); }); diff --git a/ui/litellm-dashboard/src/utils/roles.test.ts b/ui/litellm-dashboard/src/utils/roles.test.ts index 209353d3e3d..6430b8277f1 100644 --- a/ui/litellm-dashboard/src/utils/roles.test.ts +++ b/ui/litellm-dashboard/src/utils/roles.test.ts @@ -242,8 +242,6 @@ describe("roles", () => { describe("teamListScopeUserId", () => { const SESSION_USER_ID = "user-1"; - // The truth table is driven through effectiveSessionRole rather than hand-written - // labels, so it keeps holding if the raw -> display mapping ever moves. it.each(["proxy_admin", "proxy_admin_viewer", "org_admin"])( "leaves %s unscoped so the endpoint keeps returning its broad list", (rawRole) => { @@ -268,9 +266,6 @@ describe("roles", () => { }); it("keeps Org Admin broad even though all_admin_roles carries only the raw org_admin", () => { - // all_admin_roles mixes display labels with raw role names, so isAdminRole is - // false for the value useAuthorized actually supplies for an org admin. Relying - // on it here would scope org admins down to their direct memberships. expect(all_admin_roles).not.toContain(effectiveSessionRole("org_admin")); expect(isAdminRole(effectiveSessionRole("org_admin"))).toBe(false); expect(teamListScopeUserId(effectiveSessionRole("org_admin"), SESSION_USER_ID)).toBeNull();