@@ -338,7 +338,6 @@ describe('query-history', () => {
338338 describe ( 'handleCancel' , ( ) => {
339339 let mockCredentials : Credentials ;
340340 let mockCancelRemoteQuery : sinon . SinonStub ;
341- let mockCancelVariantAnalysis : sinon . SinonStub ;
342341 let getOctokitStub : sinon . SinonStub ;
343342
344343 beforeEach ( async ( ) => {
@@ -349,7 +348,6 @@ describe('query-history', () => {
349348 } as unknown as Credentials ;
350349 sandbox . stub ( Credentials , 'initialize' ) . resolves ( mockCredentials ) ;
351350 mockCancelRemoteQuery = sandbox . stub ( ghActionsApiClient , 'cancelRemoteQuery' ) ;
352- mockCancelVariantAnalysis = sandbox . stub ( ghActionsApiClient , 'cancelVariantAnalysis' ) ;
353351 } ) ;
354352
355353 describe ( 'if the item is in progress' , async ( ) => {
@@ -408,7 +406,7 @@ describe('query-history', () => {
408406 const inProgress1 = variantAnalysisHistory [ 1 ] ;
409407
410408 await queryHistoryManager . handleCancel ( inProgress1 , [ inProgress1 ] ) ;
411- expect ( mockCancelVariantAnalysis ) . to . have . been . calledWith ( mockCredentials , inProgress1 . variantAnalysis ) ;
409+ expect ( executeCommandSpy ) . to . have . been . calledWith ( 'codeQL.cancelVariantAnalysis' , inProgress1 . variantAnalysis . id ) ;
412410 } ) ;
413411
414412 it ( 'should cancel multiple variant analyses' , async ( ) => {
@@ -419,8 +417,8 @@ describe('query-history', () => {
419417 const inProgress2 = variantAnalysisHistory [ 3 ] ;
420418
421419 await queryHistoryManager . handleCancel ( inProgress1 , [ inProgress1 , inProgress2 ] ) ;
422- expect ( mockCancelVariantAnalysis ) . to . have . been . calledWith ( mockCredentials , inProgress1 . variantAnalysis ) ;
423- expect ( mockCancelVariantAnalysis ) . to . have . been . calledWith ( mockCredentials , inProgress2 . variantAnalysis ) ;
420+ expect ( executeCommandSpy ) . to . have . been . calledWith ( 'codeQL.cancelVariantAnalysis' , inProgress1 . variantAnalysis . id ) ;
421+ expect ( executeCommandSpy ) . to . have . been . calledWith ( 'codeQL.cancelVariantAnalysis' , inProgress2 . variantAnalysis . id ) ;
424422 } ) ;
425423 } ) ;
426424
@@ -480,7 +478,7 @@ describe('query-history', () => {
480478 const completedVariantAnalysis = variantAnalysisHistory [ 0 ] ;
481479
482480 await queryHistoryManager . handleCancel ( completedVariantAnalysis , [ completedVariantAnalysis ] ) ;
483- expect ( mockCancelVariantAnalysis ) . to . not . have . been . calledWith ( mockCredentials , completedVariantAnalysis . variantAnalysis ) ;
481+ expect ( executeCommandSpy ) . to . not . have . been . calledWith ( 'codeQL.cancelVariantAnalysis' , completedVariantAnalysis . variantAnalysis ) ;
484482 } ) ;
485483
486484 it ( 'should not cancel multiple variant analyses' , async ( ) => {
@@ -491,8 +489,8 @@ describe('query-history', () => {
491489 const failedVariantAnalysis = variantAnalysisHistory [ 2 ] ;
492490
493491 await queryHistoryManager . handleCancel ( completedVariantAnalysis , [ completedVariantAnalysis , failedVariantAnalysis ] ) ;
494- expect ( mockCancelVariantAnalysis ) . to . not . have . been . calledWith ( mockCredentials , completedVariantAnalysis . variantAnalysis ) ;
495- expect ( mockCancelVariantAnalysis ) . to . not . have . been . calledWith ( mockCredentials , failedVariantAnalysis . variantAnalysis ) ;
492+ expect ( executeCommandSpy ) . to . not . have . been . calledWith ( 'codeQL.cancelVariantAnalysis' , completedVariantAnalysis . variantAnalysis . id ) ;
493+ expect ( executeCommandSpy ) . to . not . have . been . calledWith ( 'codeQL.cancelVariantAnalysis' , failedVariantAnalysis . variantAnalysis . id ) ;
496494 } ) ;
497495 } ) ;
498496 } ) ;
0 commit comments