mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 12:03:23 +00:00
fix(coding-agent): guard clipboard native load
This commit is contained in:
parent
ad8026f821
commit
287a0b606d
3 changed files with 28 additions and 21 deletions
|
|
@ -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");
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue