From 5fbcd48ce31b459e574cb29addd63a65005ad095 Mon Sep 17 00:00:00 2001 From: Sean Date: Fri, 30 Oct 2026 01:07:09 +0800 Subject: [PATCH 1/3] fix: make copy controls compact and title case --- website-src/src/components/CopyButton.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website-src/src/components/CopyButton.jsx b/website-src/src/components/CopyButton.jsx index e71c8543..f3e7e6fa 100644 --- a/website-src/src/components/CopyButton.jsx +++ b/website-src/src/components/CopyButton.jsx @@ -15,7 +15,7 @@ export default function CopyButton({ text, className = "", size = "default", - label = "copy", + label = "Copy", ariaLabel, variant = "outline", }) { From 10cb189b7a8b4a7409a5927d1ee012bbbdc75984 Mon Sep 17 00:00:00 2001 From: Sean Date: Fri, 30 Oct 2026 01:07:15 +0800 Subject: [PATCH 2/3] fix: make copy controls compact and title case --- website-src/src/components/BundleDetail.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website-src/src/components/BundleDetail.jsx b/website-src/src/components/BundleDetail.jsx index 1920565a..b48a31fa 100644 --- a/website-src/src/components/BundleDetail.jsx +++ b/website-src/src/components/BundleDetail.jsx @@ -88,7 +88,7 @@ export default function BundleDetail({ bundle }) { )} From 17f4a4b6d327f2791e2965265fe6405f503b58b7 Mon Sep 17 00:00:00 2001 From: Sean Date: Fri, 30 Oct 2026 01:07:25 +0800 Subject: [PATCH 3/3] test: cover exact clipboard and inline copy controls --- .../src/__tests__/copy-button.test.jsx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 website-src/src/__tests__/copy-button.test.jsx diff --git a/website-src/src/__tests__/copy-button.test.jsx b/website-src/src/__tests__/copy-button.test.jsx new file mode 100644 index 00000000..4be541ea --- /dev/null +++ b/website-src/src/__tests__/copy-button.test.jsx @@ -0,0 +1,24 @@ +/** @vitest-environment jsdom */ +import { afterEach, describe, expect, it, vi } from "vitest"; +import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react"; +import CopyButton from "../components/CopyButton.jsx"; + +afterEach(() => { cleanup(); vi.restoreAllMocks(); }); + +describe("CopyButton", () => { + it("uses title-case Copy with an icon and copies the exact command", async () => { + const writeText = vi.fn().mockResolvedValue(undefined); + Object.defineProperty(navigator, "clipboard", { configurable: true, value: { writeText } }); + const command = "npm install -g agent-skill-manager"; + render(); + const button = screen.getByRole("button", { name: "Copy to clipboard" }); + expect(button.textContent).toBe("Copy"); + expect(button.querySelector("svg")).not.toBeNull(); + fireEvent.click(button); + await waitFor(() => expect(button.textContent).toContain("copied!")); + expect(writeText).toHaveBeenCalledWith(command); + expect(button.querySelector("svg")).not.toBeNull(); + fireEvent.click(button); + await waitFor(() => expect(writeText).toHaveBeenCalledTimes(2)); + }); +});