diff --git a/ui/litellm-dashboard/src/components/shared/copyable_badge.test.tsx b/ui/litellm-dashboard/src/components/shared/copyable_badge.test.tsx index 7be7ff6825f..c5d6c3ea547 100644 --- a/ui/litellm-dashboard/src/components/shared/copyable_badge.test.tsx +++ b/ui/litellm-dashboard/src/components/shared/copyable_badge.test.tsx @@ -22,12 +22,6 @@ const renderBadge = (value: string, maxWidthClassName?: string) => , ); -const openTooltip = (value: string) => { - const trigger = screen.getByText(value).parentElement!; - fireEvent.pointerEnter(trigger, { pointerType: "mouse" }); - fireEvent.mouseEnter(trigger); -}; - describe("CopyableBadge", () => { it("renders the value truncated in the badge", () => { renderBadge("app-aigateway-inference-producttech-product-default"); @@ -36,22 +30,15 @@ describe("CopyableBadge", () => { expect(label.className).toContain("max-w-[130px]"); }); - it("reveals the full value and copies it from the hover tooltip", async () => { + it("copies the full value from the copy button on the badge", async () => { renderBadge("team-alias-long-name"); - openTooltip("team-alias-long-name"); - - const copyButton = await screen.findByRole("button", { name: "Copy team-alias-long-name" }); + const copyButton = screen.getByRole("button", { name: "Copy team-alias-long-name" }); fireEvent.click(copyButton); await waitFor(() => expect(writeText).toHaveBeenCalledWith("team-alias-long-name")); }); - it("does not expose the copy affordance until hovered", () => { - renderBadge("my-team"); - expect(screen.queryByRole("button", { name: "Copy my-team" })).not.toBeInTheDocument(); - }); - it("honors a custom max width", () => { renderBadge("short", "max-w-[120px]"); expect(screen.getByText("short").className).toContain("max-w-[120px]"); diff --git a/ui/litellm-dashboard/src/components/shared/copyable_badge.tsx b/ui/litellm-dashboard/src/components/shared/copyable_badge.tsx index f4bff803588..85a63875c73 100644 --- a/ui/litellm-dashboard/src/components/shared/copyable_badge.tsx +++ b/ui/litellm-dashboard/src/components/shared/copyable_badge.tsx @@ -20,23 +20,16 @@ export function CopyableBadge({ dataTestId, }: CopyableBadgeProps) { return ( - - - {value} - - } - /> - - {value} - - - + + + + {value} + + + {value} + + + + ); }