From 795c03627905f4c15298fbed2239bc0cb5177a05 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 29 Aug 2026 17:26:38 -0700 Subject: [PATCH] fix(ui): drop stray text next to Close in the model connection test dialog The Add Model page's connection test dialog rendered a literal ", ]" beside the Close button, left over from converting an array of footer buttons into JSX children. --- .../components/add_model/AddModelForm.test.tsx | 15 +++++++++++++++ .../src/components/add_model/AddModelForm.tsx | 2 -- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ui/litellm-dashboard/src/components/add_model/AddModelForm.test.tsx b/ui/litellm-dashboard/src/components/add_model/AddModelForm.test.tsx index 340fd811e97..3b879da2d68 100644 --- a/ui/litellm-dashboard/src/components/add_model/AddModelForm.test.tsx +++ b/ui/litellm-dashboard/src/components/add_model/AddModelForm.test.tsx @@ -33,6 +33,7 @@ vi.mock("../networking", async () => { { model_group: "gpt-3.5-turbo", mode: "chat" }, ], }), + testConnectionRequest: vi.fn().mockResolvedValue({ status: "success" }), getProviderCreateMetadata: vi.fn().mockResolvedValue([ { provider: "OpenAI", @@ -311,6 +312,20 @@ describe("AddModelForm", () => { expect(await screen.findByRole("button", { name: "Add Model" })).toBeInTheDocument(); }); + it("shows only the Close button in the connection test dialog footer", async () => { + const mockUseAuthorized = vi.mocked(await import("@/app/(dashboard)/hooks/useAuthorized")); + mockUseAuthorized.default.mockReturnValue(mockAuthorizedUser("proxy_admin", "user-1", true)); + + renderWithProviders(); + + await userEvent.click(await screen.findByTestId("test-connect-btn")); + + const dialog = await screen.findByRole("dialog"); + const footer = dialog.querySelector('[data-slot="dialog-footer"]'); + expect(footer).not.toBeNull(); + expect(footer!.textContent?.trim()).toBe("Close"); + }); + describe("the enterprise gate on the Team-BYOK switch", () => { const renderForm = async (premiumUser: boolean) => { const mockUseAuthorized = vi.mocked(await import("@/app/(dashboard)/hooks/useAuthorized")); diff --git a/ui/litellm-dashboard/src/components/add_model/AddModelForm.tsx b/ui/litellm-dashboard/src/components/add_model/AddModelForm.tsx index b6884327a3c..ad0f749b189 100644 --- a/ui/litellm-dashboard/src/components/add_model/AddModelForm.tsx +++ b/ui/litellm-dashboard/src/components/add_model/AddModelForm.tsx @@ -476,7 +476,6 @@ const AddModelForm: React.FC = ({ /> )} - {" "} - , ]