Files
aiturk-hermes-ide/apps/desktop/src/app/settings/is-hatti-settings.test.tsx
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

31 lines
1.6 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 { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'
import { afterEach, expect, it, vi } from 'vitest'
import { I18nProvider } from '@/i18n/context'
import { IsHattiSettingsView } from './is-hatti-settings'
afterEach(() => {
cleanup()
delete (window as unknown as { hermesDesktop?: unknown }).hermesDesktop
})
it('shows the custom text box only for custom text and saves the choice', async () => {
const save = vi.fn(async (s: unknown) => s)
;(window as unknown as { hermesDesktop: unknown }).hermesDesktop = {
codexLink: { getIsHatti: async () => ({ secim: 'onerilen', talimat: '' }), setIsHatti: save }
}
render(<I18nProvider configClient={null} initialLocale="tr"><IsHattiSettingsView /></I18nProvider>)
const select = await screen.findByRole('combobox', { name: 'İş dağıtımı' })
expect(screen.queryByRole('textbox')).toBeNull()
fireEvent.change(select, { target: { value: 'ozel' } })
const box = screen.getByRole('textbox', { name: 'Codex’e eklenecek kural' })
expect((screen.getByRole('button', { name: 'Kaydet' }) as HTMLButtonElement).disabled).toBe(true)
fireEvent.change(box, { target: { value: 'kendi kuralım' } })
fireEvent.click(screen.getByRole('button', { name: 'Kaydet' }))
await waitFor(() => expect(save).toHaveBeenCalledWith({ secim: 'ozel', talimat: 'kendi kuralım' }))
expect(await screen.findByText(/yeniden başlatma gerekmez/)).toBeTruthy()
fireEvent.click(screen.getByRole('button', { name: 'Varsayılana dön' }))
await waitFor(() => expect(save).toHaveBeenLastCalledWith({ secim: 'onerilen', talimat: 'kendi kuralım' }))
})