import { describe, expect, it, vi } from 'vitest' vi.mock('electron', () => ({ BrowserWindow: class {}, nativeTheme: { shouldUseDarkColors: true }, shell: { openExternal: vi.fn() }, app: { getPath: () => '', isPackaged: false } })) vi.mock('@electron-toolkit/utils', () => ({ is: { dev: false } })) import { buildPopupWindowOptions } from '../../../src/main/windows/popup-window-factory' const spec = { name: 'history-popup', bounds: { width: 380, height: 200 }, onClosed: () => undefined } describe('buildPopupWindowOptions', () => { it('팝업창옵션_기본팝업_포커스를빼앗지않는투명창이다', () => { const options = buildPopupWindowOptions(spec, '/preload/popup.js') expect(options).toMatchObject({ width: 380, height: 200, show: false, frame: false, transparent: true, focusable: false, alwaysOnTop: true, skipTaskbar: true }) expect(options.webPreferences).toMatchObject({ preload: '/preload/popup.js', contextIsolation: true, nodeIntegration: false, backgroundThrottling: false }) }) it('팝업창옵션_화면OCR오버레이_키를받는불투명창이되고보안설정은그대로다', () => { const options = buildPopupWindowOptions( { ...spec, name: 'screen-ocr', focusable: true, transparent: false }, '/preload/popup.js' ) expect(options).toMatchObject({ focusable: true, transparent: false, frame: false, alwaysOnTop: true }) expect(options.webPreferences).toMatchObject({ contextIsolation: true, nodeIntegration: false }) }) })