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
48
apps/desktop/tests/main/update-dialog-preview.test.ts
Normal file
48
apps/desktop/tests/main/update-dialog-preview.test.ts
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
askConsent: vi.fn(async () => 'later' as const),
|
||||
askRestart: vi.fn(async () => 'later' as const),
|
||||
}))
|
||||
|
||||
vi.mock('../../src/main/services/update-adapters', () => ({
|
||||
createDialogPrompter: () => ({
|
||||
askConsent: mocks.askConsent,
|
||||
askRestart: mocks.askRestart,
|
||||
}),
|
||||
}))
|
||||
|
||||
import {
|
||||
UPDATE_DIALOG_PREVIEW_ARG,
|
||||
isUpdateDialogPreviewRequested,
|
||||
runUpdateDialogPreview,
|
||||
} from '../../src/main/update-dialog-preview'
|
||||
|
||||
describe('update dialog native preview', () => {
|
||||
beforeEach(() => {
|
||||
mocks.askConsent.mockClear()
|
||||
mocks.askRestart.mockClear()
|
||||
})
|
||||
|
||||
it('명시적 인자가 있을 때만 활성화된다', () => {
|
||||
expect(isUpdateDialogPreviewRequested(['electron', '.'])).toBe(false)
|
||||
expect(isUpdateDialogPreviewRequested(['D3RO Voice.exe', UPDATE_DIALOG_PREVIEW_ARG])).toBe(true)
|
||||
})
|
||||
|
||||
it('optional/mandatory consent와 restart dialog를 각각 한 번씩 보여 준다', async () => {
|
||||
await runUpdateDialogPreview()
|
||||
|
||||
expect(mocks.askConsent).toHaveBeenNthCalledWith(1, {
|
||||
version: '99.0.0-preview',
|
||||
releaseNotes: undefined,
|
||||
mandatory: false,
|
||||
})
|
||||
expect(mocks.askConsent).toHaveBeenNthCalledWith(2, {
|
||||
version: '99.0.0-preview',
|
||||
releaseNotes: undefined,
|
||||
mandatory: true,
|
||||
})
|
||||
expect(mocks.askRestart).toHaveBeenNthCalledWith(1, '99.0.0-preview', { mandatory: false })
|
||||
expect(mocks.askRestart).toHaveBeenNthCalledWith(2, '99.0.0-preview', { mandatory: true })
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue