From b1fefbeea799e07df35782e4040f478443de644f Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Sat, 30 May 2026 12:58:56 -0400 Subject: [PATCH] test: make clipboard temp path expectation platform-aware (#3781) --- src/main/window/clipboard-ipc-handlers.test.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/window/clipboard-ipc-handlers.test.ts b/src/main/window/clipboard-ipc-handlers.test.ts index 2eb99778f89..dc73d2332a2 100644 --- a/src/main/window/clipboard-ipc-handlers.test.ts +++ b/src/main/window/clipboard-ipc-handlers.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { join } from 'node:path' const { removeHandlerMock, @@ -131,6 +132,10 @@ describe('registerClipboardHandlers', () => { it('saves clipboard images to a local temp file when no connection is provided', async () => { const png = Buffer.from([0, 1, 2, 3]) + const expectedPath = join( + '/tmp', + 'orca-paste-1760000000000-00000000-0000-4000-8000-000000000000.png' + ) clipboardReadImageMock.mockReturnValue({ isEmpty: () => false, toPNG: () => png @@ -140,12 +145,9 @@ describe('registerClipboardHandlers', () => { const handlers = getRegisteredHandlers() await expect(handlers.get('clipboard:saveImageAsTempFile')?.({}, undefined)).resolves.toBe( - '/tmp/orca-paste-1760000000000-00000000-0000-4000-8000-000000000000.png' - ) - expect(fsWriteFileMock).toHaveBeenCalledWith( - '/tmp/orca-paste-1760000000000-00000000-0000-4000-8000-000000000000.png', - png + expectedPath ) + expect(fsWriteFileMock).toHaveBeenCalledWith(expectedPath, png) expect(getSshFilesystemProviderMock).not.toHaveBeenCalled() })