mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-16 21:53:07 +00:00
* Changes from fix/restoring-view * feat: Add resume query safety checks and optimize store selectors * feat: Improve session management and model normalization * refactor: Extract prompt building logic and handle file path parsing for renames
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { CursorProvider } from '@/providers/cursor-provider.js';
|
|
|
|
describe('cursor-provider.ts', () => {
|
|
describe('buildCliArgs', () => {
|
|
it('adds --resume when sdkSessionId is provided', () => {
|
|
const provider = Object.create(CursorProvider.prototype) as CursorProvider & {
|
|
cliPath?: string;
|
|
};
|
|
provider.cliPath = '/usr/local/bin/cursor-agent';
|
|
|
|
const args = provider.buildCliArgs({
|
|
prompt: 'Continue the task',
|
|
model: 'gpt-5',
|
|
cwd: '/tmp/project',
|
|
sdkSessionId: 'cursor-session-123',
|
|
});
|
|
|
|
const resumeIndex = args.indexOf('--resume');
|
|
expect(resumeIndex).toBeGreaterThan(-1);
|
|
expect(args[resumeIndex + 1]).toBe('cursor-session-123');
|
|
});
|
|
|
|
it('does not add --resume when sdkSessionId is omitted', () => {
|
|
const provider = Object.create(CursorProvider.prototype) as CursorProvider & {
|
|
cliPath?: string;
|
|
};
|
|
provider.cliPath = '/usr/local/bin/cursor-agent';
|
|
|
|
const args = provider.buildCliArgs({
|
|
prompt: 'Start a new task',
|
|
model: 'gpt-5',
|
|
cwd: '/tmp/project',
|
|
});
|
|
|
|
expect(args).not.toContain('--resume');
|
|
});
|
|
});
|
|
});
|