mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
test(dictation): drop casts from the shortcut mode tests
This commit is contained in:
@@ -109,18 +109,15 @@ describe('createMainWindow', () => {
|
||||
|
||||
voice.dictationMode = 'auto'
|
||||
const autoPreventDefault = vi.fn()
|
||||
windowHandlers['before-input-event'](
|
||||
{ preventDefault: autoPreventDefault } as never,
|
||||
dictationInput as never
|
||||
)
|
||||
windowHandlers['before-input-event']({ preventDefault: autoPreventDefault }, dictationInput)
|
||||
expect(autoPreventDefault).not.toHaveBeenCalled()
|
||||
expect(webContents.send).not.toHaveBeenCalledWith('ui:dictationKeyDown')
|
||||
|
||||
voice.dictationMode = 'toggle'
|
||||
const composingPreventDefault = vi.fn()
|
||||
windowHandlers['before-input-event'](
|
||||
{ preventDefault: composingPreventDefault } as never,
|
||||
{ ...dictationInput, isComposing: true } as never
|
||||
{ preventDefault: composingPreventDefault },
|
||||
{ ...dictationInput, isComposing: true }
|
||||
)
|
||||
expect(composingPreventDefault).not.toHaveBeenCalled()
|
||||
expect(webContents.send).not.toHaveBeenCalledWith('ui:dictationKeyDown')
|
||||
|
||||
@@ -5,6 +5,7 @@ import { createRoot, type Root } from 'react-dom/client'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { DictationState } from '../../../../shared/speech-types'
|
||||
import type { GlobalSettings } from '../../../../shared/global-settings-types'
|
||||
import { getDefaultSettings, getDefaultVoiceSettings } from '../../../../shared/constants'
|
||||
import { useHoldDictationGesture } from './use-hold-dictation-gesture'
|
||||
|
||||
const originalUserAgent = navigator.userAgent
|
||||
@@ -26,13 +27,10 @@ function setUserAgent(userAgent: string): void {
|
||||
|
||||
function holdSettings(): GlobalSettings {
|
||||
return {
|
||||
...getDefaultSettings('/home/test'),
|
||||
terminalShortcutPolicy,
|
||||
voice: {
|
||||
enabled: true,
|
||||
sttModel: 'test-model',
|
||||
dictationMode
|
||||
}
|
||||
} as GlobalSettings
|
||||
voice: { ...getDefaultVoiceSettings(), enabled: true, sttModel: 'test-model', dictationMode }
|
||||
}
|
||||
}
|
||||
|
||||
function Probe(): null {
|
||||
|
||||
Reference in New Issue
Block a user