|
+ {isCopyableColumn ? (
+ e.stopPropagation()}>
+
+ {String(cellValue)}
+
+
+ ) : (
+ cellValue
+ )}
+ |
+ );
+ })}
))}
diff --git a/src/test/components/TableWrapper.test.tsx b/src/test/components/TableWrapper.test.tsx
index 87cb222..7adb1a8 100644
--- a/src/test/components/TableWrapper.test.tsx
+++ b/src/test/components/TableWrapper.test.tsx
@@ -496,4 +496,201 @@ describe("TableWrapper Component", () => {
}
});
});
+
+ // ========== Copy to Clipboard Feature Tests ==========
+
+ describe("copy to clipboard functionality", () => {
+ it("should render ClipboardCopy for string columns", () => {
+ const copyableData = {
+ ...mockFieldsData,
+ fields: [
+ { name: "User ID", data_path: "user.id", data: ["12345"] },
+ { name: "Name", data_path: "user.name", data: ["John Doe"] },
+ {
+ name: "Email",
+ data_path: "user.email",
+ data: ["john@example.com"],
+ },
+ {
+ name: "Profile URL",
+ data_path: "user.url",
+ data: ["https://example.com"],
+ },
+ {
+ name: "Cluster Name",
+ data_path: "cluster.name",
+ data: ["prod-cluster-01"],
+ },
+ ],
+ };
+
+ const { container } = render(