Files
aiturk-hermes-ide/apps/desktop/electron/is-hatti-settings.test.ts
T
yilsem 557e619499
Server CI and Windows package / verify (push) Successful in 2m42s
Server CI and Windows package / windows-package (push) Successful in 6m21s
feat(codex-link): AITURK work routing setting and beta.40
- Default routing rule (user decision, 15 Oct 2026): repeating/scheduled work goes to the AITURK IDE bot as a cron job; coding stays in Codex (itself or its subagents); 'Codex' or 'sen yap' keeps everything in Codex.
- Settings > Codex Bağlama: choice (recommended / send large work / never / custom text) with a text box and restore-default; written to bridge.json aiturk_hat.
- Bridge re-reads aiturk_hat when bridge.json changes: no restart. IDE apply keeps aiturk_hat instead of wiping it.
- Bridge version 20, IDE 1.0.0-beta.40. Jev untouched.
2026-10-15 02:18:18 +03:00

25 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, it } from 'vitest'
import { readIsHatti, writeIsHatti } from './is-hatti-settings'
describe('AITURK iş hattı settings', () => {
it('defaults to the recommended rule and reads older files the way the bridge does', () => {
expect(readIsHatti(null)).toEqual({ secim: 'onerilen', talimat: '' })
expect(readIsHatti('{"aiturk_hat":{"enabled":false}}').secim).toBe('kapali')
expect(readIsHatti('{"aiturk_hat":{"talimat":"x"}}')).toEqual({ secim: 'ozel', talimat: 'x' })
expect(readIsHatti('bozuk').secim).toBe('onerilen')
})
it('writes only aiturk_hat and keeps everything else', () => {
const raw = '{"port":8795,"aiturk_hat":{"enabled":false,"komut":"k"}}'
const out = JSON.parse(writeIsHatti(raw, { secim: 'buyuk', talimat: '' }))
expect(out).toEqual({ port: 8795, aiturk_hat: { komut: 'k', secim: 'buyuk', talimat: '' } })
})
it('rejects an empty custom text and unknown choices', () => {
expect(() => writeIsHatti(null, { secim: 'ozel', talimat: ' ' })).toThrow()
expect(() => writeIsHatti(null, { secim: 'x', talimat: '' })).toThrow()
expect(() => writeIsHatti('{bozuk', { secim: 'onerilen', talimat: '' })).toThrow()
})
})