Files
orca/src/cli/terminal-format.test.ts
T
Neil 339045b150 fix(runtime): coalesce concurrent host terminal focus (#11841)
Bound exclusive host navigation to a generation-aware latest-wins
single-flight so bulk open and switch fan-out stay responsive on large
remote fleets. Add freeze repro harnesses and navigated settlement.
2026-08-03 02:18:05 -07:00

25 lines
750 B
TypeScript

import { describe, expect, it } from 'vitest'
import { formatTerminalFocus } from './terminal-format'
describe('formatTerminalFocus', () => {
it('distinguishes superseded navigation from a winning focus', () => {
expect(
formatTerminalFocus({
focus: {
handle: 'term_stale',
tabId: 'tab-stale',
worktreeId: 'worktree-1',
navigated: false
}
})
).toBe(
'Focus request for terminal term_stale was superseded or host navigation was skipped (tab tab-stale).'
)
expect(
formatTerminalFocus({
focus: { handle: 'term_winner', tabId: 'tab-winner', worktreeId: 'worktree-1' }
})
).toBe('Focused terminal term_winner (tab tab-winner).')
})
})