From 2d14e4a4ed61d550230bde4d4fd291e7c4afcdf8 Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Mon, 13 Apr 2026 12:20:30 -0700 Subject: [PATCH] test(ui/team): fix guardrails overview test for new component Updates the expected header text to "Guardrails Settings" to match GuardrailSettingsView's rendering, and moves the mock guardrails from team_info.guardrails (legacy top-level path that nothing reads) to team_info.metadata.guardrails where the component actually looks. Also tightens the assertion to verify the individual guardrail names appear, not just the section header. --- ui/litellm-dashboard/src/components/team/TeamInfo.test.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/litellm-dashboard/src/components/team/TeamInfo.test.tsx b/ui/litellm-dashboard/src/components/team/TeamInfo.test.tsx index f24b4e77e1..b5cc6005c9 100644 --- a/ui/litellm-dashboard/src/components/team/TeamInfo.test.tsx +++ b/ui/litellm-dashboard/src/components/team/TeamInfo.test.tsx @@ -276,15 +276,17 @@ describe("TeamInfoView", () => { it("should display guardrails in overview when present", async () => { vi.mocked(networking.teamInfoCall).mockResolvedValue( createMockTeamData({ - guardrails: ["guardrail1", "guardrail2"], + metadata: { guardrails: ["guardrail1", "guardrail2"] }, }) ); renderWithProviders(); await waitFor(() => { - expect(screen.getByText("Guardrails")).toBeInTheDocument(); + expect(screen.getByText("Guardrails Settings")).toBeInTheDocument(); }); + expect(screen.getByText("guardrail1")).toBeInTheDocument(); + expect(screen.getByText("guardrail2")).toBeInTheDocument(); }); it("should display policies in overview when present", async () => {