@@ -219,8 +219,6 @@ describe("handleExecCommand", () => {
219
219
spyCwd . mockRestore ( ) ;
220
220
} ) ;
221
221
222
- // --- New Tests ---
223
-
224
222
it ( "should run in sandbox if policy dictates (macOS)" , async ( ) => {
225
223
const platformSpy = vi
226
224
. spyOn ( process , "platform" , "get" )
@@ -307,10 +305,6 @@ describe("handleExecCommand", () => {
307
305
customDenyMessage : "" ,
308
306
} ) ;
309
307
310
- // Add intermediate assertion (optional, keep if helpful)
311
- expect ( mockedCanAutoApprove ) . toHaveBeenCalledTimes ( 0 ) ;
312
- expect ( mockGetCommandConfirmation ) . toHaveBeenCalledTimes ( 0 ) ;
313
-
314
308
await handleExecCommand (
315
309
mockExecInput ,
316
310
mockConfig ,
@@ -370,18 +364,16 @@ describe("handleExecCommand", () => {
370
364
expect ( result . metadata ?. [ "error" ] ) . toBeUndefined ( ) ; // Access with ['error']
371
365
expect ( result . additionalItems ) . toBeDefined ( ) ;
372
366
373
- // --- Adjust type assertion and access path ---
374
367
// The item itself has type, role, and content properties
375
368
const firstItem = result . additionalItems ?. [ 0 ] as ResponseInputItem & {
376
369
type : "message" ;
377
- role : string ; // Role is at this level
378
- content : Array < { type : string ; text : string } > ; // Content is at this level
370
+ role : string ;
371
+ content : Array < { type : string ; text : string } > ;
379
372
} ;
380
373
// Access content directly from the firstItem
381
374
expect ( firstItem ?. content [ 0 ] ?. text ) . toContain (
382
375
"No, don't do that — stop for now." ,
383
376
) ;
384
- // --- End adjustment ---
385
377
} ) ;
386
378
387
379
it ( "should abort but add custom message if user rejects with NO_CONTINUE" , async ( ) => {
@@ -411,16 +403,14 @@ describe("handleExecCommand", () => {
411
403
expect ( result . outputText ) . toBe ( "aborted" ) ;
412
404
expect ( result . additionalItems ) . toBeDefined ( ) ;
413
405
414
- // --- Adjust type assertion and access path ---
415
406
// The item itself has type, role, and content properties
416
407
const firstItem = result . additionalItems ?. [ 0 ] as ResponseInputItem & {
417
408
type : "message" ;
418
- role : string ; // Role is at this level
419
- content : Array < { type : string ; text : string } > ; // Content is at this level
409
+ role : string ;
410
+ content : Array < { type : string ; text : string } > ;
420
411
} ;
421
412
// Access content directly from the firstItem
422
413
expect ( firstItem ?. content [ 0 ] ?. text ) . toBe ( customMessage . trim ( ) ) ;
423
- // --- End adjustment ---
424
414
} ) ;
425
415
426
416
it ( 'should skip approval prompts for "always approved" commands' , async ( ) => {
@@ -661,6 +651,4 @@ describe("handleExecCommand", () => {
661
651
platformSpy . mockRestore ( ) ;
662
652
}
663
653
} ) ;
664
-
665
- // --- End New Tests ---
666
654
} ) ;
0 commit comments