import { describe, expect, it, vi } from 'vitest' import { buildCcCommand } from '../../src/cc/ccCommand' vi.mock('../../src/cc/claudeBin', () => ({ resolveClaudeBin: () => 'claude', })) describe('buildCcCommand', () => { it('appends the prompt as a positional arg for a fresh session', () => { expect(buildCcCommand({ profilePath: '/p.json', prompt: 'hello' })) .toBe('claude --dangerously-skip-permissions --settings \'/p.json\' \'hello\'') }) it('resumes without a prompt when only a session id is given', () => { expect(buildCcCommand({ profilePath: '/p.json', resumeSessionId: 'abc' })) .toBe('claude --dangerously-skip-permissions --settings \'/p.json\' --resume abc') }) it('resumes and hands the prompt to the restored session', () => { expect(buildCcCommand({ profilePath: '/p.json', resumeSessionId: 'abc', prompt: 'go on' })) .toBe('claude --dangerously-skip-permissions --settings \'/p.json\' --resume abc \'go on\'') }) })