Files
orca/src/relay/remote-cli-stdin.test.ts
T
2026-06-12 13:29:13 -07:00

19 lines
895 B
TypeScript

import { describe, expect, it } from 'vitest'
import { shouldReadRemoteCliStdin } from './remote-cli-stdin'
describe('shouldReadRemoteCliStdin', () => {
it('reads stdin only for body-file stdin requests', () => {
expect(shouldReadRemoteCliStdin(['linear', 'comment', 'add', '--body-file', '-'])).toBe(true)
expect(shouldReadRemoteCliStdin(['linear', 'create', '--body-file=-'])).toBe(true)
expect(shouldReadRemoteCliStdin(['status'])).toBe(false)
expect(shouldReadRemoteCliStdin(['linear', 'comment', 'add', '--body', 'done'])).toBe(false)
expect(shouldReadRemoteCliStdin(['linear', 'issue', '--body-file', '-'])).toBe(false)
expect(
shouldReadRemoteCliStdin(['linear', 'comment', 'add', '--help', '--body-file', '-'])
).toBe(false)
expect(shouldReadRemoteCliStdin(['linear', 'comment', 'add', '--body-file', 'body.md'])).toBe(
false
)
})
})