Skip to content

Commit f7d919f

Browse files
committed
Fix test expectations
1 parent 2443ee5 commit f7d919f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/runInTerminalTool.test.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { OperatingSystem } from '../../../../../../base/common/platform.js';
2121
import { Emitter } from '../../../../../../base/common/event.js';
2222
import { IChatService } from '../../../../chat/common/chatService.js';
2323
import { ShellIntegrationQuality } from '../../browser/toolTerminalCreator.js';
24+
import { ITerminalProfileResolverService } from '../../../../terminal/common/terminal.js';
2425

2526
class TestRunInTerminalTool extends RunInTerminalTool {
2627
protected override _osBackend: Promise<OperatingSystem> = Promise.resolve(OperatingSystem.Windows);
@@ -67,6 +68,9 @@ suite('RunInTerminalTool', () => {
6768
instantiationService.stub(IChatService, {
6869
onDidDisposeSession: chatServiceDisposeEmitter.event
6970
});
71+
instantiationService.stub(ITerminalProfileResolverService, {
72+
getDefaultShell: async () => 'pwsh'
73+
});
7074
workspaceService = instantiationService.invokeFunction(accessor => accessor.get(IWorkspaceContextService)) as TestContextService;
7175

7276
runInTerminalTool = store.add(instantiationService.createInstance(TestRunInTerminalTool));
@@ -150,7 +154,7 @@ suite('RunInTerminalTool', () => {
150154
command: 'rm file.txt',
151155
explanation: 'Remove a file'
152156
});
153-
assertConfirmationRequired(result, 'Run command in terminal');
157+
assertConfirmationRequired(result, 'pwsh');
154158
});
155159

156160
test('should require confirmation for commands in deny list even if in allow list', async () => {
@@ -163,7 +167,7 @@ suite('RunInTerminalTool', () => {
163167
command: 'rm dangerous-file.txt',
164168
explanation: 'Remove a dangerous file'
165169
});
166-
assertConfirmationRequired(result, 'Run command in terminal');
170+
assertConfirmationRequired(result, 'pwsh');
167171
});
168172

169173
test('should handle background commands with confirmation', async () => {
@@ -176,7 +180,7 @@ suite('RunInTerminalTool', () => {
176180
explanation: 'Start watching for file changes',
177181
isBackground: true
178182
});
179-
assertConfirmationRequired(result, 'Run command in background terminal');
183+
assertConfirmationRequired(result, 'pwsh (background terminal)');
180184
});
181185

182186
test('should auto-approve background commands in allow list', async () => {
@@ -283,7 +287,7 @@ suite('RunInTerminalTool', () => {
283287
explanation: 'Build the project'
284288
});
285289

286-
assertConfirmationRequired(result, 'Run command in terminal');
290+
assertConfirmationRequired(result, 'pwsh');
287291
ok(result!.confirmationMessages!.terminalCustomActions, 'Expected custom actions to be defined');
288292

289293
const customActions = result!.confirmationMessages!.terminalCustomActions!;
@@ -345,7 +349,7 @@ suite('RunInTerminalTool', () => {
345349
explanation: 'Build the project'
346350
});
347351

348-
assertConfirmationRequired(result, 'Run command in terminal');
352+
assertConfirmationRequired(result, 'pwsh');
349353
ok(result!.confirmationMessages!.terminalCustomActions, 'Expected custom actions to be defined');
350354

351355
const customActions = result!.confirmationMessages!.terminalCustomActions!;
@@ -361,7 +365,7 @@ suite('RunInTerminalTool', () => {
361365
explanation: 'Install dependencies and build'
362366
});
363367

364-
assertConfirmationRequired(result, 'Run command in terminal');
368+
assertConfirmationRequired(result, 'pwsh');
365369
ok(result!.confirmationMessages!.terminalCustomActions, 'Expected custom actions to be defined');
366370

367371
const customActions = result!.confirmationMessages!.terminalCustomActions!;

0 commit comments

Comments
 (0)