mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-23 20:26:28 +00:00
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.
This commit is contained in:
@@ -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(<TeamInfoView {...defaultProps} />);
|
||||
|
||||
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 () => {
|
||||
|
||||
Reference in New Issue
Block a user