mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
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.
This commit is contained in:
parent
ff2f06e37f
commit
795c036279
2 changed files with 15 additions and 2 deletions
|
|
@ -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(<AddModelForm {...createTestProps()} />);
|
||||
|
||||
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"));
|
||||
|
|
|
|||
|
|
@ -476,7 +476,6 @@ const AddModelForm: React.FC<AddModelFormProps> = ({
|
|||
/>
|
||||
)}
|
||||
<DialogFooter>
|
||||
{" "}
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => {
|
||||
|
|
@ -486,7 +485,6 @@ const AddModelForm: React.FC<AddModelFormProps> = ({
|
|||
>
|
||||
Close
|
||||
</Button>
|
||||
, ]
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue