@ -101,11 +101,11 @@ describe(StorageTemplateService.name, () => {
. mockResolvedValue ( assetStub . livePhotoMotionAsset ) ;
when ( assetMock . getByIds )
. calledWith ( [ assetStub . livePhotoStillAsset . id ] )
. calledWith ( [ assetStub . livePhotoStillAsset . id ] , { exifInfo : true } )
. mockResolvedValue ( [ assetStub . livePhotoStillAsset ] ) ;
when ( assetMock . getByIds )
. calledWith ( [ assetStub . livePhotoMotionAsset . id ] )
. calledWith ( [ assetStub . livePhotoMotionAsset . id ] , { exifInfo : true } )
. mockResolvedValue ( [ assetStub . livePhotoMotionAsset ] ) ;
when ( moveMock . create )
@ -140,8 +140,8 @@ describe(StorageTemplateService.name, () => {
await expect ( sut . handleMigrationSingle ( { id : assetStub.livePhotoStillAsset.id } ) ) . resolves . toBe ( true ) ;
expect ( assetMock . getByIds ) . toHaveBeenCalledWith ( [ assetStub . livePhotoStillAsset . id ] );
expect ( assetMock . getByIds ) . toHaveBeenCalledWith ( [ assetStub . livePhotoMotionAsset . id ] );
expect ( assetMock . getByIds ) . toHaveBeenCalledWith ( [ assetStub . livePhotoStillAsset . id ] , { exifInfo : true } );
expect ( assetMock . getByIds ) . toHaveBeenCalledWith ( [ assetStub . livePhotoMotionAsset . id ] , { exifInfo : true } );
expect ( storageMock . checkFileExists ) . toHaveBeenCalledTimes ( 2 ) ;
expect ( assetMock . save ) . toHaveBeenCalledWith ( {
id : assetStub.livePhotoStillAsset.id ,
@ -172,7 +172,9 @@ describe(StorageTemplateService.name, () => {
. calledWith ( { id : assetStub.image.id , originalPath : newPath } )
. mockResolvedValue ( assetStub . image ) ;
when ( assetMock . getByIds ) . calledWith ( [ assetStub . image . id ] ) . mockResolvedValue ( [ assetStub . image ] ) ;
when ( assetMock . getByIds )
. calledWith ( [ assetStub . image . id ] , { exifInfo : true } )
. mockResolvedValue ( [ assetStub . image ] ) ;
when ( moveMock . update )
. calledWith ( {
@ -190,7 +192,7 @@ describe(StorageTemplateService.name, () => {
await expect ( sut . handleMigrationSingle ( { id : assetStub.image.id } ) ) . resolves . toBe ( true ) ;
expect ( assetMock . getByIds ) . toHaveBeenCalledWith ( [ assetStub . image . id ] );
expect ( assetMock . getByIds ) . toHaveBeenCalledWith ( [ assetStub . image . id ] , { exifInfo : true } );
expect ( storageMock . checkFileExists ) . toHaveBeenCalledTimes ( 3 ) ;
expect ( storageMock . rename ) . toHaveBeenCalledWith ( assetStub . image . originalPath , newPath ) ;
expect ( moveMock . update ) . toHaveBeenCalledWith ( {
@ -227,7 +229,9 @@ describe(StorageTemplateService.name, () => {
. calledWith ( { id : assetStub.image.id , originalPath : newPath } )
. mockResolvedValue ( assetStub . image ) ;
when ( assetMock . getByIds ) . calledWith ( [ assetStub . image . id ] ) . mockResolvedValue ( [ assetStub . image ] ) ;
when ( assetMock . getByIds )
. calledWith ( [ assetStub . image . id ] , { exifInfo : true } )
. mockResolvedValue ( [ assetStub . image ] ) ;
when ( moveMock . update )
. calledWith ( {
@ -245,7 +249,7 @@ describe(StorageTemplateService.name, () => {
await expect ( sut . handleMigrationSingle ( { id : assetStub.image.id } ) ) . resolves . toBe ( true ) ;
expect ( assetMock . getByIds ) . toHaveBeenCalledWith ( [ assetStub . image . id ] );
expect ( assetMock . getByIds ) . toHaveBeenCalledWith ( [ assetStub . image . id ] , { exifInfo : true } );
expect ( storageMock . checkFileExists ) . toHaveBeenCalledTimes ( 3 ) ;
expect ( storageMock . stat ) . toHaveBeenCalledWith ( previousFailedNewPath ) ;
expect ( storageMock . rename ) . toHaveBeenCalledWith ( previousFailedNewPath , newPath ) ;
@ -275,7 +279,9 @@ describe(StorageTemplateService.name, () => {
. calledWith ( { id : assetStub.image.id , originalPath : newPath } )
. mockResolvedValue ( assetStub . image ) ;
when ( assetMock . getByIds ) . calledWith ( [ assetStub . image . id ] ) . mockResolvedValue ( [ assetStub . image ] ) ;
when ( assetMock . getByIds )
. calledWith ( [ assetStub . image . id ] , { exifInfo : true } )
. mockResolvedValue ( [ assetStub . image ] ) ;
when ( moveMock . create )
. calledWith ( {
@ -294,7 +300,7 @@ describe(StorageTemplateService.name, () => {
await expect ( sut . handleMigrationSingle ( { id : assetStub.image.id } ) ) . resolves . toBe ( true ) ;
expect ( assetMock . getByIds ) . toHaveBeenCalledWith ( [ assetStub . image . id ] );
expect ( assetMock . getByIds ) . toHaveBeenCalledWith ( [ assetStub . image . id ] , { exifInfo : true } );
expect ( storageMock . checkFileExists ) . toHaveBeenCalledTimes ( 1 ) ;
expect ( storageMock . stat ) . toHaveBeenCalledWith ( newPath ) ;
expect ( moveMock . create ) . toHaveBeenCalledWith ( {
@ -340,7 +346,9 @@ describe(StorageTemplateService.name, () => {
. calledWith ( { id : assetStub.image.id , originalPath : newPath } )
. mockResolvedValue ( assetStub . image ) ;
when ( assetMock . getByIds ) . calledWith ( [ assetStub . image . id ] ) . mockResolvedValue ( [ assetStub . image ] ) ;
when ( assetMock . getByIds )
. calledWith ( [ assetStub . image . id ] , { exifInfo : true } )
. mockResolvedValue ( [ assetStub . image ] ) ;
when ( moveMock . update )
. calledWith ( {
@ -358,7 +366,7 @@ describe(StorageTemplateService.name, () => {
await expect ( sut . handleMigrationSingle ( { id : assetStub.image.id } ) ) . resolves . toBe ( true ) ;
expect ( assetMock . getByIds ) . toHaveBeenCalledWith ( [ assetStub . image . id ] );
expect ( assetMock . getByIds ) . toHaveBeenCalledWith ( [ assetStub . image . id ] , { exifInfo : true } );
expect ( storageMock . checkFileExists ) . toHaveBeenCalledTimes ( 3 ) ;
expect ( storageMock . stat ) . toHaveBeenCalledWith ( previousFailedNewPath ) ;
expect ( storageMock . rename ) . not . toHaveBeenCalled ( ) ;