mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
* test: remove thin mobile forwarding and inventory checks * test: remove 60 more low-value mobile checks * test: remove 120 low-value mobile task and document checks --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
54 lines
1.6 KiB
TypeScript
54 lines
1.6 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { resolveWorkspaceAgentSelection } from './workspace-agent-selection'
|
|
|
|
describe('workspace agent selection', () => {
|
|
it('keeps automatic selection current while create selection is active', () => {
|
|
expect(
|
|
resolveWorkspaceAgentSelection({
|
|
selectionActive: true,
|
|
settings: { defaultTuiAgent: 'codex' },
|
|
detectedAgentIds: new Set(['claude', 'codex']),
|
|
agent: null,
|
|
overridden: false
|
|
})
|
|
).toEqual({ agent: 'codex', overridden: false })
|
|
})
|
|
|
|
it('preserves a valid user override', () => {
|
|
expect(
|
|
resolveWorkspaceAgentSelection({
|
|
selectionActive: true,
|
|
settings: { defaultTuiAgent: 'claude' },
|
|
detectedAgentIds: new Set(['claude', 'codex']),
|
|
agent: 'codex',
|
|
overridden: true
|
|
})
|
|
).toEqual({ agent: 'codex', overridden: true })
|
|
})
|
|
|
|
it('falls back when a user override is unavailable after detection settles', () => {
|
|
expect(
|
|
resolveWorkspaceAgentSelection({
|
|
selectionActive: true,
|
|
settings: { defaultTuiAgent: 'codex' },
|
|
detectedAgentIds: new Set(['claude']),
|
|
agent: 'codex',
|
|
overridden: true
|
|
})
|
|
).toEqual({ agent: 'claude', overridden: false })
|
|
})
|
|
|
|
it('does not repair inactive selection state', () => {
|
|
expect(
|
|
resolveWorkspaceAgentSelection({
|
|
selectionActive: false,
|
|
settings: { defaultTuiAgent: 'codex' },
|
|
detectedAgentIds: new Set(['codex']),
|
|
agent: null,
|
|
overridden: false
|
|
})
|
|
).toEqual({ agent: null, overridden: false })
|
|
})
|
|
})
|