feat(codex-link): persist direct subscription and AITURK connection modes
This commit is contained in:
1 parent
049c4d1338
commit
8f53b090f7
11 files changed
+188
-17
No files matched your search
@@ -12,6 +12,7 @@ vi.mock('@/store/notifications', () => ({ notifyError }))
|
||||
|
||||
const RUNNING: CodexLinkStatus = {
|
||||
enabled: true,
|
||||
mod: 'aiturk',
|
||||
codexFound: true,
|
||||
venvReady: true,
|
||||
foreign: false,
|
||||
@@ -198,3 +199,18 @@ describe('Codex Link settings', () => {
|
||||
expect(get).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
describe('connection mode controls', () => {
|
||||
it('sends the mode and renders the saved direct preference', async () => {
|
||||
get.mockResolvedValue({ ...RUNNING, mod: 'dogrudan' })
|
||||
set.mockResolvedValue({ ...RUNNING, mod: 'aiturk' })
|
||||
renderPage()
|
||||
const direct = await screen.findByRole('radio', { name: 'Doğrudan (önerilen): abonelik modelleri köprüden bağımsız' })
|
||||
await waitFor(() => expect((direct as HTMLInputElement).checked).toBe(true))
|
||||
fireEvent.click(screen.getByRole('radio', { name: 'AITURK: combolar Codex listesinde, tüm modeller köprüden' }))
|
||||
await waitFor(() => expect(set).toHaveBeenCalledWith({ mod: 'aiturk' }))
|
||||
await waitFor(() => expect((direct as HTMLInputElement).checked).toBe(false))
|
||||
expect(screen.getByText("Codex'i yeniden başlatın")).toBeTruthy()
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user