Skip to content

Commit a04f5d2

Browse files
committed
test(cli): update snapshots and fix model validation tests
1 parent 0abc44a commit a04f5d2

File tree

5 files changed

+466
-4
lines changed

5 files changed

+466
-4
lines changed

packages/cli/src/config/config.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ describe('loadCliConfig model selection', () => {
17731773
});
17741774

17751775
it('always prefers model from argv', async () => {
1776-
process.argv = ['node', 'script.js', '--model', 'gemini-2.5-flash-preview'];
1776+
process.argv = ['node', 'script.js', '--model', 'gemini-2.5-flash'];
17771777
const argv = await parseArguments(createTestMergedSettings());
17781778
const config = await loadCliConfig(
17791779
createTestMergedSettings({
@@ -1785,11 +1785,11 @@ describe('loadCliConfig model selection', () => {
17851785
argv,
17861786
);
17871787

1788-
expect(config.getModel()).toBe('gemini-2.5-flash-preview');
1788+
expect(config.getModel()).toBe('gemini-2.5-flash');
17891789
});
17901790

17911791
it('selects the model from argv if provided', async () => {
1792-
process.argv = ['node', 'script.js', '--model', 'gemini-2.5-flash-preview'];
1792+
process.argv = ['node', 'script.js', '--model', 'gemini-2.5-flash'];
17931793
const argv = await parseArguments(createTestMergedSettings());
17941794
const config = await loadCliConfig(
17951795
createTestMergedSettings({
@@ -1799,7 +1799,7 @@ describe('loadCliConfig model selection', () => {
17991799
argv,
18001800
);
18011801

1802-
expect(config.getModel()).toBe('gemini-2.5-flash-preview');
1802+
expect(config.getModel()).toBe('gemini-2.5-flash');
18031803
});
18041804

18051805
it('selects the default auto model if provided via auto alias', async () => {

packages/cli/src/ui/components/__snapshots__/AskUserDialog.test.tsx.snap

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ Enter to submit · Esc to cancel
1111
"
1212
`;
1313

14+
exports[`AskUserDialog > Choice question placeholder > uses default placeholder when not provided 2`] = `
15+
"Select your preferred language:
16+
17+
1. TypeScript
18+
2. JavaScript
19+
● 3. Enter a custom value
20+
21+
Enter to submit · Esc to cancel
22+
"
23+
`;
24+
1425
exports[`AskUserDialog > Choice question placeholder > uses placeholder for "Other" option when provided 1`] = `
1526
"Select your preferred language:
1627
@@ -22,6 +33,17 @@ Enter to submit · Esc to cancel
2233
"
2334
`;
2435

36+
exports[`AskUserDialog > Choice question placeholder > uses placeholder for "Other" option when provided 2`] = `
37+
"Select your preferred language:
38+
39+
1. TypeScript
40+
2. JavaScript
41+
● 3. Type another language...
42+
43+
Enter to submit · Esc to cancel
44+
"
45+
`;
46+
2547
exports[`AskUserDialog > Scroll Arrows (useAlternateBuffer: false) > shows scroll arrows correctly when useAlternateBuffer is false 1`] = `
2648
"Choose an option
2749
@@ -36,6 +58,20 @@ Enter to select · ↑/↓ to navigate · Esc to cancel
3658
"
3759
`;
3860

61+
exports[`AskUserDialog > Scroll Arrows (useAlternateBuffer: false) > shows scroll arrows correctly when useAlternateBuffer is false 2`] = `
62+
"Choose an option
63+
64+
65+
● 1. Option 1
66+
Description 1
67+
2. Option 2
68+
Description 2
69+
70+
71+
Enter to select · ↑/↓ to navigate · Esc to cancel
72+
"
73+
`;
74+
3975
exports[`AskUserDialog > Scroll Arrows (useAlternateBuffer: true) > shows scroll arrows correctly when useAlternateBuffer is true 1`] = `
4076
"Choose an option
4177
@@ -75,6 +111,45 @@ Enter to select · ↑/↓ to navigate · Esc to cancel
75111
"
76112
`;
77113

114+
exports[`AskUserDialog > Scroll Arrows (useAlternateBuffer: true) > shows scroll arrows correctly when useAlternateBuffer is true 2`] = `
115+
"Choose an option
116+
117+
● 1. Option 1
118+
Description 1
119+
2. Option 2
120+
Description 2
121+
3. Option 3
122+
Description 3
123+
4. Option 4
124+
Description 4
125+
5. Option 5
126+
Description 5
127+
6. Option 6
128+
Description 6
129+
7. Option 7
130+
Description 7
131+
8. Option 8
132+
Description 8
133+
9. Option 9
134+
Description 9
135+
10. Option 10
136+
Description 10
137+
11. Option 11
138+
Description 11
139+
12. Option 12
140+
Description 12
141+
13. Option 13
142+
Description 13
143+
14. Option 14
144+
Description 14
145+
15. Option 15
146+
Description 15
147+
16. Enter a custom value
148+
149+
Enter to select · ↑/↓ to navigate · Esc to cancel
150+
"
151+
`;
152+
78153
exports[`AskUserDialog > Text type questions > renders text input for type: "text" 1`] = `
79154
"What should we name this component?
80155

packages/cli/src/ui/components/__snapshots__/ExitPlanModeDialog.test.tsx.snap

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,33 @@ Enter to select · ↑/↓ to navigate · Ctrl+X to edit plan · Esc to cancel
2727
"
2828
`;
2929

30+
exports[`ExitPlanModeDialog > useAlternateBuffer: false > bubbles up Ctrl+C when feedback is empty while editing 2`] = `
31+
"Overview
32+
33+
Add user authentication to the CLI application.
34+
35+
Implementation Steps
36+
37+
1. Create src/auth/AuthService.ts with login/logout methods
38+
2. Add session storage in src/storage/SessionStore.ts
39+
3. Update src/commands/index.ts to check auth status
40+
4. Add tests in src/auth/__tests__/
41+
42+
Files to Modify
43+
44+
- src/index.ts - Add auth middleware
45+
- src/config.ts - Add auth configuration options
46+
47+
1. Yes, automatically accept edits
48+
Approves plan and allows tools to run automatically
49+
2. Yes, manually accept edits
50+
Approves plan but requires confirmation for each tool
51+
● 3. Type your feedback...
52+
53+
Enter to submit · Ctrl+X to edit plan · Esc to cancel
54+
"
55+
`;
56+
3057
exports[`ExitPlanModeDialog > useAlternateBuffer: false > calls onFeedback when feedback is typed and submitted 1`] = `
3158
"Overview
3259
@@ -54,6 +81,33 @@ Enter to select · ↑/↓ to navigate · Ctrl+X to edit plan · Esc to cancel
5481
"
5582
`;
5683

84+
exports[`ExitPlanModeDialog > useAlternateBuffer: false > calls onFeedback when feedback is typed and submitted 2`] = `
85+
"Overview
86+
87+
Add user authentication to the CLI application.
88+
89+
Implementation Steps
90+
91+
1. Create src/auth/AuthService.ts with login/logout methods
92+
2. Add session storage in src/storage/SessionStore.ts
93+
3. Update src/commands/index.ts to check auth status
94+
4. Add tests in src/auth/__tests__/
95+
96+
Files to Modify
97+
98+
- src/index.ts - Add auth middleware
99+
- src/config.ts - Add auth configuration options
100+
101+
1. Yes, automatically accept edits
102+
Approves plan and allows tools to run automatically
103+
2. Yes, manually accept edits
104+
Approves plan but requires confirmation for each tool
105+
● 3. Add tests
106+
107+
Enter to submit · Ctrl+X to edit plan · Esc to cancel
108+
"
109+
`;
110+
57111
exports[`ExitPlanModeDialog > useAlternateBuffer: false > displays error state when file read fails 1`] = `
58112
" Error reading plan: File not found
59113
"
@@ -140,6 +194,33 @@ Enter to select · ↑/↓ to navigate · Ctrl+X to edit plan · Esc to cancel
140194
"
141195
`;
142196

197+
exports[`ExitPlanModeDialog > useAlternateBuffer: true > bubbles up Ctrl+C when feedback is empty while editing 2`] = `
198+
"Overview
199+
200+
Add user authentication to the CLI application.
201+
202+
Implementation Steps
203+
204+
1. Create src/auth/AuthService.ts with login/logout methods
205+
2. Add session storage in src/storage/SessionStore.ts
206+
3. Update src/commands/index.ts to check auth status
207+
4. Add tests in src/auth/__tests__/
208+
209+
Files to Modify
210+
211+
- src/index.ts - Add auth middleware
212+
- src/config.ts - Add auth configuration options
213+
214+
1. Yes, automatically accept edits
215+
Approves plan and allows tools to run automatically
216+
2. Yes, manually accept edits
217+
Approves plan but requires confirmation for each tool
218+
● 3. Type your feedback...
219+
220+
Enter to submit · Ctrl+X to edit plan · Esc to cancel
221+
"
222+
`;
223+
143224
exports[`ExitPlanModeDialog > useAlternateBuffer: true > calls onFeedback when feedback is typed and submitted 1`] = `
144225
"Overview
145226
@@ -167,6 +248,33 @@ Enter to select · ↑/↓ to navigate · Ctrl+X to edit plan · Esc to cancel
167248
"
168249
`;
169250

251+
exports[`ExitPlanModeDialog > useAlternateBuffer: true > calls onFeedback when feedback is typed and submitted 2`] = `
252+
"Overview
253+
254+
Add user authentication to the CLI application.
255+
256+
Implementation Steps
257+
258+
1. Create src/auth/AuthService.ts with login/logout methods
259+
2. Add session storage in src/storage/SessionStore.ts
260+
3. Update src/commands/index.ts to check auth status
261+
4. Add tests in src/auth/__tests__/
262+
263+
Files to Modify
264+
265+
- src/index.ts - Add auth middleware
266+
- src/config.ts - Add auth configuration options
267+
268+
1. Yes, automatically accept edits
269+
Approves plan and allows tools to run automatically
270+
2. Yes, manually accept edits
271+
Approves plan but requires confirmation for each tool
272+
● 3. Add tests
273+
274+
Enter to submit · Ctrl+X to edit plan · Esc to cancel
275+
"
276+
`;
277+
170278
exports[`ExitPlanModeDialog > useAlternateBuffer: true > displays error state when file read fails 1`] = `
171279
" Error reading plan: File not found
172280
"

packages/cli/src/ui/components/__snapshots__/InputPrompt.test.tsx.snap

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,27 @@ exports[`InputPrompt > mouse interaction > should toggle paste expansion on doub
7878
"
7979
`;
8080

81+
exports[`InputPrompt > mouse interaction > should toggle paste expansion on double-click 4`] = `
82+
"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
83+
> [Pasted Text: 10 lines]
84+
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
85+
"
86+
`;
87+
88+
exports[`InputPrompt > mouse interaction > should toggle paste expansion on double-click 5`] = `
89+
"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
90+
> [Pasted Text: 10 lines]
91+
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
92+
"
93+
`;
94+
95+
exports[`InputPrompt > mouse interaction > should toggle paste expansion on double-click 6`] = `
96+
"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
97+
> [Pasted Text: 10 lines]
98+
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
99+
"
100+
`;
101+
81102
exports[`InputPrompt > snapshots > should not show inverted cursor when shell is focused 1`] = `
82103
"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
83104
> Type your message or @path/to/file

0 commit comments

Comments
 (0)