mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-01 02:02:20 +00:00
test(ui): keep agent identity form assertions type-safe
This commit is contained in:
parent
bec727d07f
commit
2b6bf317bf
2 changed files with 3 additions and 3 deletions
|
|
@ -186,7 +186,7 @@ describe("AgentInfoView update payload", () => {
|
|||
expect(screen.getByLabelText("Application (Client) ID")).toHaveValue(identity.client_id);
|
||||
expect(screen.getByRole("combobox", { name: "Identity Provider" })).toHaveTextContent("Microsoft Entra ID");
|
||||
expect(screen.getByRole("combobox", { name: "Execution Mode" })).toHaveTextContent("Autonomous");
|
||||
expect(screen.getByRole("combobox", { name: "Execution", exact: true })).toHaveTextContent("Enabled");
|
||||
expect(screen.getByRole("combobox", { name: /^Execution$/ })).toHaveTextContent("Enabled");
|
||||
fireEvent.change(screen.getByLabelText("Agent Name"), { target: { value: "Renamed agent" } });
|
||||
await save(user);
|
||||
expect(patchedPayload().agent_name).toBe("Renamed agent");
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ describe("AgentInfoView settings", () => {
|
|||
it("saves unrelated settings when the existing card has no description", async () => {
|
||||
const actual = await vi.importActual<typeof import("./agent_form_fields")>("./agent_form_fields");
|
||||
vi.mocked(AgentFormFields).mockImplementation(actual.default);
|
||||
const { description: _description, ...card } = agent.agent_card_params;
|
||||
const { description: _description, ...card } = agent.agent_card_params ?? {};
|
||||
vi.mocked(networking.getAgentInfo).mockResolvedValue({ ...agent, agent_card_params: card });
|
||||
render(<AgentInfoView agentId="agent-1" onClose={vi.fn()} accessToken="sk-test" isAdmin={true} />);
|
||||
fireEvent.click(await screen.findByRole("tab", { name: "Settings" }));
|
||||
|
|
@ -126,7 +126,7 @@ describe("AgentInfoView settings", () => {
|
|||
await waitFor(() => expect(networking.patchAgentCall).toHaveBeenCalledOnce());
|
||||
const [, , payload] = vi.mocked(networking.patchAgentCall).mock.calls[0];
|
||||
expect(payload.tpm_limit).toBe(42);
|
||||
expect(payload.agent_card_params.description).toBe("");
|
||||
expect(payload.agent_card_params?.description).toBe("");
|
||||
});
|
||||
|
||||
it("sends the newly attached access group in the update payload", async () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue