From d4c5a1723f9b9debaa7755ef85550dfeb82b80ff Mon Sep 17 00:00:00 2001 From: winewill <324803222+winewill@users.noreply.github.com> Date: Sun, 20 Sep 2026 15:36:49 +0800 Subject: [PATCH] test(desktop): isolate update UI in directory-picker preload integration --- .../tests/client-flow.client.spec.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/client/ui-directory-picker-native/tests/client-flow.client.spec.tsx b/packages/client/ui-directory-picker-native/tests/client-flow.client.spec.tsx index 11f6083a2a..2037b3edd7 100644 --- a/packages/client/ui-directory-picker-native/tests/client-flow.client.spec.tsx +++ b/packages/client/ui-directory-picker-native/tests/client-flow.client.spec.tsx @@ -23,8 +23,9 @@ vi.mock(desktopIpc.electron, () => ({ vi.mock('../../../../apps/desktop/src/preload-platform.ts', () => ({ markDocumentPlatform: vi.fn(), syncWindowFullscreen: vi.fn() })) vi.mock('../../../../apps/desktop/src/preload-theme.ts', () => ({ syncNativeTheme: vi.fn() })) vi.mock('../../../../apps/desktop/src/preload-windows.ts', () => ({ syncWindowsAppearance: vi.fn() })) +vi.mock('../../../../apps/desktop/src/preload-mandatory-overlay.ts', () => ({ installMandatoryUpdateOverlay: vi.fn() })) -afterEach(() => { cleanup(); vi.unstubAllGlobals() }) +afterEach(() => { cleanup(); vi.unstubAllGlobals(); vi.restoreAllMocks(); desktopIpc.invoke.mockReset() }) const HOLES = ['conversation.hero.workspace.directoryFlow', 'sidebar.workspaces.directoryFlow'] as const @@ -164,7 +165,9 @@ describe('directory-picker-native client half', () => { expect(b.pickDirectory).toHaveBeenCalledOnce() }) - it('consumes the actual Desktop preload bridge and sends its directory-pick IPC', async () => { + it.each(['win32', 'darwin'] as const)('consumes the actual Desktop preload directory bridge on %s', async (platform) => { + vi.spyOn(process, 'platform', 'get').mockReturnValue(platform) + vi.resetModules() vi.stubGlobal('location', new URL('dsh-app://app/')) // Desktop's preload is typechecked by its own compiler program. const preload = '../../../../apps/desktop/src/preload-app.ts'