mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
* test(ui): characterize shared migration surfaces * refactor(ui): migrate guardrail and duration controls * fix(ui): preserve duration select callback shape * fix(ui): narrow duration selection value
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
import { renderWithProviders, screen } from "../../tests/test-utils";
|
|
import { describe, expect, it } from "vitest";
|
|
import GuardrailSettingsView from "./GuardrailSettingsView";
|
|
|
|
describe("GuardrailSettingsView", () => {
|
|
it("should render", () => {
|
|
renderWithProviders(<GuardrailSettingsView globalGuardrailNames={new Set()} />);
|
|
|
|
expect(screen.getByText("Guardrails Settings")).toBeInTheDocument();
|
|
});
|
|
|
|
it("should separate active global and team-specific guardrails", () => {
|
|
renderWithProviders(
|
|
<GuardrailSettingsView
|
|
globalGuardrailNames={new Set(["global-one", "global-two"])}
|
|
teamGuardrails={["global-one", "team-one"]}
|
|
optedOutGlobalGuardrails={["global-two"]}
|
|
/>,
|
|
);
|
|
|
|
expect(screen.getByText("global-one")).toBeInTheDocument();
|
|
expect(screen.getByText("team-one")).toBeInTheDocument();
|
|
expect(screen.queryByText("global-two")).not.toBeInTheDocument();
|
|
});
|
|
|
|
it("should show when global guardrails are bypassed", () => {
|
|
renderWithProviders(<GuardrailSettingsView globalGuardrailNames={new Set(["global-one"])} killSwitchOn />);
|
|
|
|
expect(screen.getByText("Bypassed for this team")).toBeInTheDocument();
|
|
});
|
|
});
|