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:
Ryan Crabbe
2026-04-13 12:20:30 -07:00
parent 842523a918
commit 2d14e4a4ed
@@ -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 () => {