fix(coding-agent): guard clipboard native load

This commit is contained in:
Mario Zechner 2026-02-02 00:23:12 +01:00
parent ad8026f821
commit 287a0b606d
3 changed files with 28 additions and 21 deletions

View file

@ -17,9 +17,9 @@ vi.mock("child_process", () => {
};
});
vi.mock("@mariozechner/clipboard", () => {
vi.mock("../src/utils/clipboard-native.js", () => {
return {
default: mocks.clipboard,
clipboard: mocks.clipboard,
};
});
@ -54,7 +54,7 @@ describe("readClipboardImage", () => {
mocks.clipboard.getImageBinary.mockReset();
});
test("Wayland: uses wl-paste and never calls @mariozechner/clipboard", async () => {
test("Wayland: uses wl-paste and never calls clipboard", async () => {
mocks.clipboard.hasImage.mockImplementation(() => {
throw new Error("clipboard.hasImage should not be called on Wayland");
});
@ -107,7 +107,7 @@ describe("readClipboardImage", () => {
expect(Array.from(result?.bytes ?? [])).toEqual([9, 8]);
});
test("Non-Wayland: uses @mariozechner/clipboard", async () => {
test("Non-Wayland: uses clipboard", async () => {
mocks.spawnSync.mockImplementation(() => {
throw new Error("spawnSync should not be called for non-Wayland sessions");
});