Skip to content

Commit 160e2d9

Browse files
authored
Merge pull request BerriAI#23098 from BerriAI/litellm_org_admin_team_fix
[Fix] UI - Agents: fix stale test assertions after AgentsPanel table refactor
2 parents 5acb25f + 81b2231 commit 160e2d9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ui/litellm-dashboard/src/components/agents.test.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ vi.mock("./agents/agent_card_grid", () => ({
2020
),
2121
}));
2222

23+
// Note: agents.tsx no longer uses AgentCardGrid — it renders a Table directly.
24+
2325
vi.mock("./agents/agent_info", () => ({
2426
default: () => <div data-testid="agent-info" />,
2527
}));
@@ -54,19 +56,19 @@ describe("AgentsPanel", () => {
5456
expect(screen.queryByText("+ Add New Agent")).not.toBeInTheDocument();
5557
});
5658

57-
it("should pass isAdmin=true to AgentCardGrid for admin role", async () => {
59+
it("should show Actions column header for admin role", async () => {
5860
render(<AgentsPanel accessToken="test-token" userRole="Admin" />);
5961
await waitFor(() => {
60-
const grid = screen.getByTestId("agent-card-grid");
61-
expect(grid).toHaveAttribute("data-is-admin", "true");
62+
expect(screen.getByRole("columnheader", { name: /actions/i })).toBeInTheDocument();
6263
});
6364
});
6465

65-
it("should pass isAdmin=false to AgentCardGrid for internal user role", async () => {
66+
it("should not show Actions column header for internal user role", async () => {
6667
render(<AgentsPanel accessToken="test-token" userRole="Internal User" />);
6768
await waitFor(() => {
68-
const grid = screen.getByTestId("agent-card-grid");
69-
expect(grid).toHaveAttribute("data-is-admin", "false");
69+
expect(screen.queryByRole("columnheader", { name: /actions/i })).not.toBeInTheDocument();
70+
// confirm table is rendered (not still loading)
71+
expect(screen.getByRole("table")).toBeInTheDocument();
7072
});
7173
});
7274

0 commit comments

Comments
 (0)