@@ -884,7 +884,7 @@ describe('FilesRepository', () => {
884884 await expect ( sut . getFileHasBeenDeleted ( nonExistentFiledId ) ) . rejects . toThrow ( expectedError )
885885 } )
886886
887- test ( 'should return True when the dataset is published and the file has not been deleted' , async ( ) => {
887+ test ( 'should return correctly when the file has or has not been deleted, in a published dataset ' , async ( ) => {
888888 await uploadFileViaApi ( deleFileTestDatasetIds . numericId , testTextFile1Name ) . catch ( ( ) => {
889889 throw new Error ( `Error while uploading file ${ testTextFile1Name } ` )
890890 } )
@@ -902,13 +902,13 @@ describe('FilesRepository', () => {
902902 )
903903 fileId = datasetFiles . files [ 0 ] . id
904904
905- const notDeleted = await sut . getFileHasBeenDeleted ( fileId )
906- expect ( notDeleted ) . toBe ( false )
905+ const fileHasNotBeenDeleted = await sut . getFileHasBeenDeleted ( fileId )
906+ expect ( fileHasNotBeenDeleted ) . toBe ( false )
907907
908908 await sut . deleteFile ( fileId )
909909
910- const hasBeenDeleted = await sut . getFileHasBeenDeleted ( fileId )
911- expect ( hasBeenDeleted ) . toBe ( true )
910+ const fileHasBeenDeleted = await sut . getFileHasBeenDeleted ( fileId )
911+ expect ( fileHasBeenDeleted ) . toBe ( true )
912912 } )
913913
914914 test ( 'should return True when file has been replaced' , async ( ) => {
@@ -928,8 +928,7 @@ describe('FilesRepository', () => {
928928 const originalFileId = datasetFiles . files [ 0 ] . id
929929
930930 const createTestFileUploadDestination = async ( file : File , testDatasetId : number ) => {
931- const filesRepository = new FilesRepository ( )
932- const destination = await filesRepository . getFileUploadDestination ( testDatasetId , file )
931+ const destination = await sut . getFileUploadDestination ( testDatasetId , file )
933932 destination . urls . forEach ( ( destinationUrl , index ) => {
934933 destination . urls [ index ] = destinationUrl . replace ( 'localstack' , 'localhost' )
935934 } )
0 commit comments