chore: land in-progress workspace changes before 1.16.2
The tree carried uncommitted work from several areas (web push, mobile screens, admin charts, test-hygiene cleanup, CI and map docs). It is landed as one commit so the release pipeline can start from a clean tree; the desktop transcript-correction behaviour shipped in the previous commit and is unchanged here.
This commit is contained in:
parent
9c2b6a9782
commit
7fe49c437e
144 changed files with 3760 additions and 4523 deletions
58
apps/desktop/tests/main/index-update-dialog-preview.test.ts
Normal file
58
apps/desktop/tests/main/index-update-dialog-preview.test.ts
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
import { describe, expect, it, vi } from 'vitest'
|
||||
|
||||
type Listener = (...args: unknown[]) => void
|
||||
|
||||
const state = vi.hoisted(() => ({
|
||||
appListeners: new Map<string, Listener>(),
|
||||
bootstrap: vi.fn(async () => undefined),
|
||||
exit: vi.fn(),
|
||||
preview: vi.fn(async () => undefined),
|
||||
quit: vi.fn(),
|
||||
requestSingleInstanceLock: vi.fn(() => true),
|
||||
setAsDefaultProtocolClient: vi.fn(),
|
||||
setupLifecycle: vi.fn(),
|
||||
}))
|
||||
|
||||
vi.mock('electron', () => ({
|
||||
app: {
|
||||
on: vi.fn((event: string, listener: Listener) => state.appListeners.set(event, listener)),
|
||||
whenReady: vi.fn(() => Promise.resolve()),
|
||||
setAsDefaultProtocolClient: state.setAsDefaultProtocolClient,
|
||||
requestSingleInstanceLock: state.requestSingleInstanceLock,
|
||||
disableHardwareAcceleration: vi.fn(),
|
||||
commandLine: { appendSwitch: vi.fn() },
|
||||
exit: state.exit,
|
||||
quit: state.quit,
|
||||
getPath: vi.fn(() => '.'),
|
||||
},
|
||||
}))
|
||||
|
||||
vi.mock('electron-log', () => ({
|
||||
default: { error: vi.fn() },
|
||||
}))
|
||||
|
||||
vi.mock('../../src/main/app-identity', () => ({ applyAppIdentity: vi.fn() }))
|
||||
vi.mock('../../src/main/bootstrap', () => ({ bootstrap: state.bootstrap }))
|
||||
vi.mock('../../src/main/lifecycle', () => ({ setupLifecycle: state.setupLifecycle }))
|
||||
vi.mock('../../src/main/windows/WindowManager', () => ({ showMainWindow: vi.fn(() => null) }))
|
||||
vi.mock('../../src/main/services/LoggerService', () => ({
|
||||
getLogger: () => ({ info: vi.fn(), warn: vi.fn(), error: vi.fn(), debug: vi.fn() }),
|
||||
}))
|
||||
vi.mock('../../src/main/update-dialog-preview', () => ({
|
||||
isUpdateDialogPreviewRequested: () => true,
|
||||
runUpdateDialogPreview: state.preview,
|
||||
}))
|
||||
|
||||
describe('update dialog preview entrypoint', () => {
|
||||
it('protocol/lock/bootstrap을 건드리지 않고 preview 후 종료한다', async () => {
|
||||
await import('../../src/main/index')
|
||||
await vi.waitFor(() => expect(state.preview).toHaveBeenCalledTimes(1))
|
||||
|
||||
expect(state.setAsDefaultProtocolClient).not.toHaveBeenCalled()
|
||||
expect(state.requestSingleInstanceLock).not.toHaveBeenCalled()
|
||||
expect(state.bootstrap).not.toHaveBeenCalled()
|
||||
expect(state.setupLifecycle).not.toHaveBeenCalled()
|
||||
expect(state.exit).not.toHaveBeenCalled()
|
||||
expect(state.quit).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue