Adds next-sentence suggestions while typing, weekly input insights and a personal phrase memory to the desktop app, and fixes custom instructions so they process the text instead of inserting the instruction's own wording. Local model requests are now bounded and individually cancellable. Bumps the product version to 1.5.0 (Android/iOS build 1050000), refreshes the landing and web download links, and records the new INPUT feature rows and the open verification gaps in the infrastructure map.
61 lines
1.9 KiB
TypeScript
61 lines
1.9 KiB
TypeScript
import { afterEach, describe, expect, it, vi } from 'vitest'
|
|
|
|
describe('ConfigService suggestion tuning migration', () => {
|
|
afterEach(() => {
|
|
vi.doUnmock('electron-store')
|
|
vi.resetModules()
|
|
})
|
|
|
|
it('revision 3은 새 delay와 분당 상한만 바꾸고 기존 개인 설정을 보존한다', async () => {
|
|
const savedBindings = {
|
|
'suggestion-accept': [
|
|
{ device: 'keyboard' as const, code: 65, ctrl: true, alt: false, shift: false, meta: false }
|
|
]
|
|
}
|
|
const persisted = {
|
|
suggestionTuningRevision: 3,
|
|
suggestionTriggerDelayMs: 300,
|
|
suggestionMaxRequestsPerMinute: 12,
|
|
suggestionMinPrefixChars: 17,
|
|
suggestionDailyBudget: 777,
|
|
suggestionRequestTimeoutMs: 23000,
|
|
keyBindings: savedBindings
|
|
}
|
|
|
|
class TestStore<T extends Record<string, unknown>> {
|
|
store: T
|
|
|
|
constructor(options: { defaults: T }) {
|
|
this.store = { ...options.defaults, ...persisted } as T
|
|
}
|
|
|
|
get<K extends keyof T>(key: K): T[K] {
|
|
return this.store[key]
|
|
}
|
|
|
|
set<K extends keyof T>(key: K, value: T[K]): void {
|
|
this.store[key] = value
|
|
}
|
|
|
|
delete(key: string): void {
|
|
delete this.store[key as keyof T]
|
|
}
|
|
}
|
|
|
|
vi.doMock('electron-store', () => ({ default: TestStore }))
|
|
const { configGet, initConfigService, resetInMemoryConfig } = await import(
|
|
'../../../src/main/services/ConfigService'
|
|
)
|
|
await initConfigService()
|
|
|
|
expect(configGet('suggestionTuningRevision')).toBe(4)
|
|
expect(configGet('suggestionTriggerDelayMs')).toBe(600)
|
|
expect(configGet('suggestionMaxRequestsPerMinute')).toBe(6)
|
|
expect(configGet('suggestionMinPrefixChars')).toBe(17)
|
|
expect(configGet('suggestionDailyBudget')).toBe(777)
|
|
expect(configGet('suggestionRequestTimeoutMs')).toBe(23000)
|
|
expect(configGet('keyBindings')['suggestion-accept']).toEqual(savedBindings['suggestion-accept'])
|
|
|
|
resetInMemoryConfig()
|
|
})
|
|
})
|