mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 17:17:38 +00:00
Preserve the complete credential storage, migration, IPC, Settings and rate-limit refresh change alongside standalone GLM plans, current-main database diagnostics and the reviewed unknown-backend environment correction. Keep native discovery cancellation third and selected environment fourth. Original-topic-commit:7903f1cddbOriginal-topic-commit:588117b5cfOriginal-topic-commit:dedd4f8c86Original-topic-commit:6645dae104Original-topic-commit: a25b80c02c1af7830b0e6a65e72d965b3ad98276 Restacked-from: a25b80c02c1af7830b0e6a65e72d965b3ad98276 Restacked-onto:b032867021Co-authored-by: kespineira <kespineira@users.noreply.github.com> Co-authored-by: kevimux <kevimux@users.noreply.github.com> Reported-by: pullfrog Reviewed-full-source: 849fe093073f4c1606bd65d79a0c725d955d0d1f Native-helper-source:80dbe23237Reviewed-full-current-source: 36acb57d44adb3d378c0289c8c15f7da0fda214c
24 lines
905 B
TypeScript
24 lines
905 B
TypeScript
import { describe, expect, it, vi } from 'vitest'
|
|
import { opencodeGoCredentialsApi } from './api/opencode-go-credentials-bridge'
|
|
|
|
const invoke = vi.hoisted(() => vi.fn(async () => ({ apiKeyConfigured: true })))
|
|
vi.mock('electron', () => ({ ipcRenderer: { invoke } }))
|
|
|
|
describe('OpenCode Go credential bridge', () => {
|
|
it('exposes only status and write operations', async () => {
|
|
expect(await opencodeGoCredentialsApi.getStatus()).toEqual({ apiKeyConfigured: true })
|
|
await opencodeGoCredentialsApi.saveApiKey('fake-key')
|
|
await opencodeGoCredentialsApi.clearApiKey()
|
|
expect(invoke.mock.calls).toEqual([
|
|
['opencodeGoCredentials:getStatus'],
|
|
['opencodeGoCredentials:saveApiKey', 'fake-key'],
|
|
['opencodeGoCredentials:clearApiKey']
|
|
])
|
|
expect(Object.keys(opencodeGoCredentialsApi)).toEqual([
|
|
'getStatus',
|
|
'saveApiKey',
|
|
'clearApiKey'
|
|
])
|
|
})
|
|
})
|