mirror of
https://github.com/stablyai/orca.git
synced 2026-10-17 16:02:55 +00:00
60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { resolveTerminalOrchestrationCliCommand } from './cli-command'
|
|
|
|
describe('resolveTerminalOrchestrationCliCommand', () => {
|
|
it('uses orca-ide for a pane recorded as WSL', () => {
|
|
expect(
|
|
resolveTerminalOrchestrationCliCommand({
|
|
connectionId: null,
|
|
isWsl: true,
|
|
worktreeId: 'repo::C:\\repo'
|
|
})
|
|
).toBe('orca-ide')
|
|
})
|
|
|
|
it('uses project runtime and WSL paths when restored pane metadata is unavailable', () => {
|
|
expect(
|
|
resolveTerminalOrchestrationCliCommand({
|
|
connectionId: null,
|
|
isWsl: null,
|
|
worktreeId: 'repo::C:\\repo',
|
|
projectRuntime: {
|
|
status: 'resolved',
|
|
runtime: {
|
|
kind: 'wsl',
|
|
hostPlatform: 'wsl',
|
|
projectId: 'project',
|
|
distro: 'Ubuntu',
|
|
reason: 'project-override',
|
|
cacheKey: 'project:wsl:Ubuntu'
|
|
}
|
|
}
|
|
})
|
|
).toBe('orca-ide')
|
|
expect(
|
|
resolveTerminalOrchestrationCliCommand({
|
|
connectionId: null,
|
|
isWsl: null,
|
|
worktreeId: 'repo::\\\\wsl.localhost\\Ubuntu\\home\\alice\\repo'
|
|
})
|
|
).toBe('orca-ide')
|
|
})
|
|
|
|
it('preserves native and SSH bare-orca commands', () => {
|
|
expect(
|
|
resolveTerminalOrchestrationCliCommand({
|
|
connectionId: null,
|
|
isWsl: false,
|
|
worktreeId: 'repo::/home/alice/repo'
|
|
})
|
|
).toBe('orca')
|
|
expect(
|
|
resolveTerminalOrchestrationCliCommand({
|
|
connectionId: 'ssh-1',
|
|
isWsl: null,
|
|
worktreeId: 'repo::\\\\wsl.localhost\\Ubuntu\\home\\alice\\repo'
|
|
})
|
|
).toBe('orca')
|
|
})
|
|
})
|