diff --git a/src/main/orca-profiles/profile-cloud-dev-auth.ts b/src/main/orca-profiles/profile-cloud-dev-auth.ts index 137696e17ce..2383cea6d40 100644 --- a/src/main/orca-profiles/profile-cloud-dev-auth.ts +++ b/src/main/orca-profiles/profile-cloud-dev-auth.ts @@ -1,5 +1,8 @@ import { randomUUID } from 'node:crypto' -import type { OrcaCloudCapabilities, OrcaCloudOrgSummary } from '../../shared/orca-profiles' +import type { + OrcaCloudCapabilities, + OrcaCloudOrgSummary +} from '../../shared/orca-profiles' import type { OrcaCloudSessionExchangeResponse } from './profile-cloud-session-exchange' const DEV_SESSION_TTL_MS = 7 * 24 * 60 * 60 * 1000 diff --git a/src/main/orca-profiles/profile-cloud-service-auth-retry.test.ts b/src/main/orca-profiles/profile-cloud-service-auth-retry.test.ts index 9db1d830986..045f31359f8 100644 --- a/src/main/orca-profiles/profile-cloud-service-auth-retry.test.ts +++ b/src/main/orca-profiles/profile-cloud-service-auth-retry.test.ts @@ -138,7 +138,9 @@ describe('Orca cloud profile auth-failure retry', () => { safeStorageMock.encryptString.mockReset() safeStorageMock.isEncryptionAvailable.mockReset() safeStorageMock.decryptString.mockImplementation((value: Buffer) => value.toString('utf-8')) - safeStorageMock.encryptString.mockImplementation((value: string) => Buffer.from(value, 'utf-8')) + safeStorageMock.encryptString.mockImplementation((value: string) => + Buffer.from(value, 'utf-8') + ) safeStorageMock.isEncryptionAvailable.mockReturnValue(true) vi.unstubAllEnvs() vi.stubEnv('ORCA_CLOUD_API_URL', '') diff --git a/src/main/orca-profiles/profile-cloud-service-refresh.test.ts b/src/main/orca-profiles/profile-cloud-service-refresh.test.ts index 075573eea3a..e2e8fcbc1d4 100644 --- a/src/main/orca-profiles/profile-cloud-service-refresh.test.ts +++ b/src/main/orca-profiles/profile-cloud-service-refresh.test.ts @@ -123,7 +123,9 @@ describe('Orca cloud profile service session refresh', () => { safeStorageMock.encryptString.mockReset() safeStorageMock.isEncryptionAvailable.mockReset() safeStorageMock.decryptString.mockImplementation((value: Buffer) => value.toString('utf-8')) - safeStorageMock.encryptString.mockImplementation((value: string) => Buffer.from(value, 'utf-8')) + safeStorageMock.encryptString.mockImplementation((value: string) => + Buffer.from(value, 'utf-8') + ) safeStorageMock.isEncryptionAvailable.mockReturnValue(true) vi.unstubAllEnvs() vi.stubEnv('ORCA_CLOUD_API_URL', '') diff --git a/src/main/orca-profiles/profile-cloud-service.test.ts b/src/main/orca-profiles/profile-cloud-service.test.ts index 552a2ee8ea1..92e0064c2f5 100644 --- a/src/main/orca-profiles/profile-cloud-service.test.ts +++ b/src/main/orca-profiles/profile-cloud-service.test.ts @@ -114,7 +114,9 @@ describe('Orca cloud profile service', () => { safeStorageMock.encryptString.mockReset() safeStorageMock.isEncryptionAvailable.mockReset() safeStorageMock.decryptString.mockImplementation((value: Buffer) => value.toString('utf-8')) - safeStorageMock.encryptString.mockImplementation((value: string) => Buffer.from(value, 'utf-8')) + safeStorageMock.encryptString.mockImplementation((value: string) => + Buffer.from(value, 'utf-8') + ) safeStorageMock.isEncryptionAvailable.mockReturnValue(true) revokeOrcaCloudSessionMock.mockResolvedValue(undefined) vi.unstubAllEnvs() diff --git a/src/renderer/src/components/terminal-pane/terminal-ime-candidate-key-release-guard.test.ts b/src/renderer/src/components/terminal-pane/terminal-ime-candidate-key-release-guard.test.ts index c0112fa2c41..228ff9ddca6 100644 --- a/src/renderer/src/components/terminal-pane/terminal-ime-candidate-key-release-guard.test.ts +++ b/src/renderer/src/components/terminal-pane/terminal-ime-candidate-key-release-guard.test.ts @@ -55,15 +55,11 @@ describe('terminal IME candidate key release guard', () => { it('does not guard fresh keydowns, other keys, modified keypresses, or expired keypresses', () => { const releases = createTerminalImePendingCandidateKeyReleases() armTerminalImePendingCandidateKeyRelease(releases, event({ key: '2' }), 10) + expect(shouldApplyTerminalImePendingCandidateKeyRelease(event({ key: '2' }), releases, 20)).toBe( + false + ) expect( - shouldApplyTerminalImePendingCandidateKeyRelease(event({ key: '2' }), releases, 20) - ).toBe(false) - expect( - shouldApplyTerminalImePendingCandidateKeyRelease( - event({ type: 'keyup', key: '3' }), - releases, - 20 - ) + shouldApplyTerminalImePendingCandidateKeyRelease(event({ type: 'keyup', key: '3' }), releases, 20) ).toBe(false) expect( shouldApplyTerminalImePendingCandidateKeyRelease( @@ -161,18 +157,10 @@ describe('terminal IME candidate key release guard', () => { armTerminalImePendingCandidateKeyRelease(releases, event({ key: '2' }), 10) armTerminalImePendingCandidateKeyRelease(releases, event({ key: '3' }), 12) expect( - shouldApplyTerminalImePendingCandidateKeyRelease( - event({ type: 'keyup', key: '2' }), - releases, - 20 - ) + shouldApplyTerminalImePendingCandidateKeyRelease(event({ type: 'keyup', key: '2' }), releases, 20) ).toBe(true) expect( - shouldApplyTerminalImePendingCandidateKeyRelease( - event({ type: 'keyup', key: '3' }), - releases, - 20 - ) + shouldApplyTerminalImePendingCandidateKeyRelease(event({ type: 'keyup', key: '3' }), releases, 20) ).toBe(true) // The first key's keyup no longer strands the second key's pending release. clearTerminalImePendingCandidateKeyRelease(releases, event({ type: 'keyup', key: '2' })) diff --git a/src/renderer/src/components/terminal-pane/terminal-ime-composition-tracker.test.ts b/src/renderer/src/components/terminal-pane/terminal-ime-composition-tracker.test.ts index 858745afb3d..1e363adcec4 100644 --- a/src/renderer/src/components/terminal-pane/terminal-ime-composition-tracker.test.ts +++ b/src/renderer/src/components/terminal-pane/terminal-ime-composition-tracker.test.ts @@ -11,10 +11,7 @@ type TrackerHarness = { tracker: TerminalImeCompositionTracker element: HTMLElement advance: (ms: number) => void - composition: ( - type: 'compositionstart' | 'compositionupdate' | 'compositionend', - data: string - ) => void + composition: (type: 'compositionstart' | 'compositionupdate' | 'compositionend', data: string) => void input: (inputType: string) => void blur: () => void } diff --git a/src/renderer/src/components/terminal-pane/xterm-bypass-policy-non-mac.test.ts b/src/renderer/src/components/terminal-pane/xterm-bypass-policy-non-mac.test.ts index 1f3a78326cd..7e5d55e4bff 100644 --- a/src/renderer/src/components/terminal-pane/xterm-bypass-policy-non-mac.test.ts +++ b/src/renderer/src/components/terminal-pane/xterm-bypass-policy-non-mac.test.ts @@ -166,11 +166,7 @@ describe('shouldSuppressTerminalImeKeyboardEvent — Windows/Linux', () => { // Post-compositionend guard: the tracker is already inactive but the // committing key's trailing press/release must still be absorbed. const linuxPostCompositionGuard = { ...linuxIdle, candidateKeyGuardActive: true } - const windowsComposing = { - ...windowsIdle, - compositionActive: true, - candidateKeyGuardActive: true - } + const windowsComposing = { ...windowsIdle, compositionActive: true, candidateKeyGuardActive: true } it('suppresses keyboard events while Chromium reports active IME composition', () => { for (const options of [windowsIdle, linuxIdle]) { @@ -272,9 +268,9 @@ describe('shouldSuppressTerminalImeKeyboardEvent — Windows/Linux', () => { it('suppresses Space and digit keydowns and keyups while the candidate guard is active', () => { for (const options of [linuxComposing, linuxPostCompositionGuard]) { for (const key of [' ', '0', '2', '9']) { - expect(shouldSuppressTerminalImeKeyboardEvent(event({ key, code: '' }), options)).toBe( - true - ) + expect( + shouldSuppressTerminalImeKeyboardEvent(event({ key, code: '' }), options) + ).toBe(true) expect( shouldSuppressTerminalImeKeyboardEvent(event({ type: 'keyup', key, code: '' }), options) ).toBe(true) @@ -300,10 +296,7 @@ describe('shouldSuppressTerminalImeKeyboardEvent — Windows/Linux', () => { it('leaves Space and digits alone once the guard has expired', () => { for (const type of ['keydown', 'keyup', 'keypress']) { expect( - shouldSuppressTerminalImeKeyboardEvent( - event({ type, key: ' ', code: 'Space' }), - linuxIdle - ) + shouldSuppressTerminalImeKeyboardEvent(event({ type, key: ' ', code: 'Space' }), linuxIdle) ).toBe(false) expect( shouldSuppressTerminalImeKeyboardEvent( @@ -343,7 +336,10 @@ describe('shouldSuppressTerminalImeKeyboardEvent — Windows/Linux', () => { it('does not apply the Linux/Sogou candidate guard to Windows', () => { expect( - shouldSuppressTerminalImeKeyboardEvent(event({ key: ' ', code: 'Space' }), windowsComposing) + shouldSuppressTerminalImeKeyboardEvent( + event({ key: ' ', code: 'Space' }), + windowsComposing + ) ).toBe(false) expect( shouldSuppressTerminalImeKeyboardEvent( @@ -394,10 +390,7 @@ describe('shouldSuppressTerminalImeKeyboardEvent — Windows/Linux', () => { shouldPreventDefaultTerminalImeCandidateKey(event({ key: ' ', code: 'Space' }), linuxIdle) ).toBe(false) expect( - shouldPreventDefaultTerminalImeCandidateKey( - event({ key: 'a', code: 'KeyA' }), - linuxComposing - ) + shouldPreventDefaultTerminalImeCandidateKey(event({ key: 'a', code: 'KeyA' }), linuxComposing) ).toBe(false) expect( shouldPreventDefaultTerminalImeCandidateKey( diff --git a/tests/e2e/chinese-ime-chat-input-repro.spec.ts b/tests/e2e/chinese-ime-chat-input-repro.spec.ts index 8994e235cdd..02dbb03c112 100644 --- a/tests/e2e/chinese-ime-chat-input-repro.spec.ts +++ b/tests/e2e/chinese-ime-chat-input-repro.spec.ts @@ -629,9 +629,7 @@ test.describe('Chinese IME terminal chat input repro', () => { const postCompositionLog = await readImeEventLog(orcaPage) const postCompositionEndIndex = postCompositionLog.findIndex( (entry, index) => - index >= postCompositionLogStart && - entry.type === 'compositionend' && - entry.data === '再见' + index >= postCompositionLogStart && entry.type === 'compositionend' && entry.data === '再见' ) const postCompositionSelectorIndex = postCompositionLog.findIndex( (entry, index) =>