@@ -466,37 +466,12 @@ describe('TestVariationsService', () => {
466466 ignoreAreas : JSON . parse ( testVariationSecond . ignoreAreas ) ,
467467 } ) ;
468468 expect ( testRunCreateMock ) . toHaveBeenCalledTimes ( 2 ) ;
469- expect ( buildUpdateMock ) . toHaveBeenCalledWith ( build . id , { " isRunning" : false } ) ;
469+ expect ( buildUpdateMock ) . toHaveBeenCalledWith ( build . id , { isRunning : false } ) ;
470470 } ) ;
471471
472472 it ( 'delete' , async ( ) => {
473473 const testRunId = 'test run id' ;
474474 const testVariationId = 'test variation id' ;
475- const testRun : TestRun = {
476- id : testRunId ,
477- imageName : '1592423768112.screenshot.png' ,
478- diffName : null ,
479- diffPercent : null ,
480- diffTollerancePercent : 1 ,
481- pixelMisMatchCount : null ,
482- status : 'new' ,
483- buildId : '146e7a8d-89f0-4565-aa2c-e61efabb0afd' ,
484- testVariationId : testVariationId ,
485- updatedAt : new Date ( ) ,
486- createdAt : new Date ( ) ,
487- name : 'ss2f77' ,
488- browser : 'chromium' ,
489- device : null ,
490- os : null ,
491- viewport : '1800x1600' ,
492- baselineName : null ,
493- ignoreAreas : '[]' ,
494- tempIgnoreAreas : '[]' ,
495- comment : 'some comment' ,
496- baselineBranchName : 'master' ,
497- branchName : 'develop' ,
498- merge : false ,
499- } ;
500475 const variation : TestVariation & {
501476 baselines : Baseline [ ] ;
502477 } = {
@@ -526,25 +501,17 @@ describe('TestVariationsService', () => {
526501 } ;
527502
528503 const variationDeleteMock = jest . fn ( ) ;
529- const testRunFindMany = jest . fn ( ) . mockResolvedValueOnce ( [ testRun ] ) ;
530- const testRunDeleteMock = jest . fn ( ) ;
531504 const getDetailsMock = jest . fn ( ) . mockResolvedValueOnce ( variation ) ;
532505 const deleteBaselineMock = jest . fn ( ) . mockResolvedValueOnce ( variation . baselines [ 0 ] ) ;
533506 const service = await initModule ( {
534507 variationDeleteMock,
535- testRunFindMany,
536- testRunDeleteMock,
537508 } ) ;
538509 service . getDetails = getDetailsMock ;
539510 service . deleteBaseline = deleteBaselineMock ;
540511
541512 await service . delete ( testVariationId ) ;
542513
543514 expect ( service . getDetails ) . toHaveBeenCalledWith ( testVariationId ) ;
544- expect ( testRunFindMany ) . toHaveBeenCalledWith ( {
545- where : { testVariationId } ,
546- } ) ;
547- expect ( testRunDeleteMock ) . toHaveBeenCalledWith ( testRunId ) ;
548515 expect ( service . deleteBaseline ) . toHaveBeenCalledWith ( variation . baselines [ 0 ] ) ;
549516 expect ( variationDeleteMock ) . toHaveBeenCalledWith ( {
550517 where : { id : testVariationId } ,
0 commit comments