Files
archived-orca/mobile/src/tasks/workspace-agent-selection.test.ts
T
OrcaWinandOrcaWin 77ab05bfb1 test: remove 192 low-value mobile tests (#41196)
* 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>
2026-11-11 09:49:53 -08:00

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 })
})
})