diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/panels/AddModelPanel.integration.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/panels/AddModelPanel.integration.test.tsx index 32db6210e70..37d4d4fd31b 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/panels/AddModelPanel.integration.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/panels/AddModelPanel.integration.test.tsx @@ -171,6 +171,12 @@ const PER_SECOND_PRICING_PAYLOAD = { input_cost_per_second: undefined, }; +const CACHE_CONTROL_PAYLOAD = { + ...EXPANDED_PAYLOAD, + cache_control: true, + cache_control_injection_points: [{ location: "message", role: "system" }], +}; + describe("AddModelPanel submit payload", () => { beforeEach(() => { vi.clearAllMocks(); @@ -248,4 +254,19 @@ describe("AddModelPanel submit payload", () => { expect(await submitAndCapturePayload(user)).toStrictEqual(PER_SECOND_PRICING_PAYLOAD); }); + + it("carries a cache control injection point chosen in the child through to the payload", async () => { + const user = setup(); + renderWithProviders(); + await fillRequiredFields(user); + await user.click(screen.getByText("Advanced Settings")); + await screen.findByText("LiteLLM Params"); + + await user.click(screen.getByLabelText(/Cache Control Injection Points/i)); + const roleCombos = await screen.findAllByRole("combobox"); + await user.click(roleCombos[roleCombos.length - 1]); + await user.click(await screen.findByRole("option", { name: "System" })); + + expect(await submitAndCapturePayload(user)).toStrictEqual(CACHE_CONTROL_PAYLOAD); + }); });