+
{entry.response?.results?.length || 0}{" "}
{entry.response?.results?.length === 1 ? "result" : "results"}
{entry.latency !== undefined && (
<>
•
-
{entry.latency}ms
+
{entry.latency}ms
>
)}
•
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/search-tools/_components/SearchToolView.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/search-tools/_components/SearchToolView.test.tsx
index 049523c0254..e4b2cf62940 100644
--- a/ui/litellm-dashboard/src/app/(dashboard)/search-tools/_components/SearchToolView.test.tsx
+++ b/ui/litellm-dashboard/src/app/(dashboard)/search-tools/_components/SearchToolView.test.tsx
@@ -155,13 +155,8 @@ describe("SearchToolView", () => {
const toolNameContainer = screen.getByText("Test Search Tool").closest("div");
expect(toolNameContainer).toBeInTheDocument();
- const copyButtons = within(toolNameContainer!).getAllByRole("button");
- const nameCopyButton = copyButtons.find((button) => {
- return button.querySelector("svg") !== null;
- });
-
- expect(nameCopyButton).toBeInTheDocument();
- await user.click(nameCopyButton!);
+ const nameCopyButton = within(toolNameContainer!).getByRole("button");
+ await user.click(nameCopyButton);
await waitFor(() => {
expect(copyToClipboard).toHaveBeenCalledWith("Test Search Tool");
@@ -176,13 +171,8 @@ describe("SearchToolView", () => {
const toolIdContainer = screen.getByText("test-tool-id-123").closest("div");
expect(toolIdContainer).toBeInTheDocument();
- const copyButtons = within(toolIdContainer!).getAllByRole("button");
- const idCopyButton = copyButtons.find((button) => {
- return button.querySelector("svg") !== null;
- });
-
- expect(idCopyButton).toBeInTheDocument();
- await user.click(idCopyButton!);
+ const idCopyButton = within(toolIdContainer!).getByRole("button");
+ await user.click(idCopyButton);
await waitFor(() => {
expect(copyToClipboard).toHaveBeenCalledWith("test-tool-id-123");
@@ -197,22 +187,14 @@ describe("SearchToolView", () => {
render(
);
const toolNameContainer = screen.getByText("Test Search Tool").closest("div");
- const copyButtons = within(toolNameContainer!).getAllByRole("button");
- const nameCopyButton = copyButtons.find((button) => {
- return button.querySelector("svg") !== null;
- });
+ const nameCopyButton = within(toolNameContainer!).getByRole("button");
- expect(nameCopyButton).toBeInTheDocument();
+ expect(nameCopyButton.querySelector(".lucide-copy")).toBeInTheDocument();
- const initialSvg = nameCopyButton!.querySelector("svg");
- expect(initialSvg).toBeInTheDocument();
-
- await user.click(nameCopyButton!);
+ await user.click(nameCopyButton);
await waitFor(() => {
- const updatedSvg = nameCopyButton!.querySelector("svg");
- expect(updatedSvg).toBeInTheDocument();
- expect(nameCopyButton).toHaveClass("text-green-600");
+ expect(nameCopyButton.querySelector(".lucide-check")).toBeInTheDocument();
});
});
@@ -224,13 +206,9 @@ describe("SearchToolView", () => {
render(
);
const toolNameContainer = screen.getByText("Test Search Tool").closest("div");
- const copyButtons = within(toolNameContainer!).getAllByRole("button");
- const nameCopyButton = copyButtons.find((button) => {
- return button.querySelector("svg") !== null;
- });
+ const nameCopyButton = within(toolNameContainer!).getByRole("button");
- expect(nameCopyButton).toBeInTheDocument();
- await user.click(nameCopyButton!);
+ await user.click(nameCopyButton);
await waitFor(
() => {
@@ -239,7 +217,7 @@ describe("SearchToolView", () => {
{ timeout: 3000 },
);
- expect(nameCopyButton).not.toHaveClass("text-green-600");
+ expect(nameCopyButton.querySelector(".lucide-check")).not.toBeInTheDocument();
});
it("should render SearchToolTester when accessToken is provided", () => {
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/search-tools/_components/SearchToolView.tsx b/ui/litellm-dashboard/src/app/(dashboard)/search-tools/_components/SearchToolView.tsx
index e77234aa3a0..1f7c992aa98 100644
--- a/ui/litellm-dashboard/src/app/(dashboard)/search-tools/_components/SearchToolView.tsx
+++ b/ui/litellm-dashboard/src/app/(dashboard)/search-tools/_components/SearchToolView.tsx
@@ -1,9 +1,8 @@
import { copyToClipboard as utilCopyToClipboard } from "@/utils/dataUtils";
-import { ArrowLeftIcon } from "@heroicons/react/outline";
-import { Button, Card, Grid, Text, Title } from "@tremor/react";
-import { Button as AntdButton } from "antd";
-import { CheckIcon, CopyIcon } from "lucide-react";
+import { ArrowLeft, Check, Copy } from "lucide-react";
import React, { useState } from "react";
+import { Button } from "@/components/ui/button";
+import { Card, CardContent } from "@/components/ui/card";
import { SearchToolTester } from "./SearchToolTester";
import { AvailableSearchProvider, SearchTool } from "./types";
@@ -43,73 +42,73 @@ export const SearchToolView: React.FC
= ({
-