-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathonboarding-invocation.e2e.ts
More file actions
69 lines (64 loc) · 1.82 KB
/
Copy pathonboarding-invocation.e2e.ts
File metadata and controls
69 lines (64 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import {
createSession,
navigateToPlugins,
selectIdeAndOnboard,
readInvocation,
} from './testing-framework/index.js';
const IDE_CASES = [
{
name: 'Claude Code',
downPresses: 0,
command: 'claude',
expectedArgs: ['--print', '--output-format', 'stream-json', '--verbose'],
expectedPromptSnippets: [
'Confidence SDK',
'/analyze-project',
'existing codebase',
'mcp__confidence-flags__',
],
},
{
name: 'Cursor',
downPresses: 1,
command: 'cursor',
expectedArgs: ['--print', '--output-format', 'stream-json', '--approve-mcps', '--auto-review'],
expectedPromptSnippets: [
'Confidence SDK',
'.cursor/skills/analyze-project/SKILL.md',
'existing codebase',
'mcp__confidence-flags__',
],
firstArg: 'agent',
},
{
name: 'Codex',
downPresses: 2,
command: 'codex',
expectedArgs: ['exec', '--json', '--sandbox', 'workspace-write', '-'],
expectedPromptSnippets: [
'Confidence SDK',
'/analyze-project',
'existing codebase',
'confidence-flags:',
],
},
] as const;
describe.each(IDE_CASES)('$name onboarding invocation', (ide) => {
it(`spawns ${ide.command} with the correct args and onboarding prompt`, async () => {
using session = createSession();
await navigateToPlugins(session);
await selectIdeAndOnboard(session, ide.downPresses);
const invocation = readInvocation(session.cwd);
expect(invocation.command).toBe(ide.command);
for (const arg of ide.expectedArgs) {
expect(invocation.args).toContain(arg);
}
if ('firstArg' in ide) {
expect(invocation.args[0]).toBe(ide.firstArg);
}
for (const snippet of ide.expectedPromptSnippets) {
expect(invocation.prompt).toContain(snippet);
}
expect(invocation.prompt).toContain(session.cwd);
});
});