@@ -1108,6 +1108,28 @@ describe('DatasetsRepository', () => {
11081108
11091109 await deletePublishedDatasetViaApi ( testDatasetIds . persistentId )
11101110 } )
1111+ } )
1112+
1113+ describe ( 'getDatasetDownloadCount' , ( ) => {
1114+ test ( 'should return download count for a dataset' , async ( ) => {
1115+ const testDatasetIds = await createDataset . execute ( TestConstants . TEST_NEW_DATASET_DTO )
1116+ await publishDatasetViaApi ( testDatasetIds . numericId )
1117+ await waitForNoLocks ( testDatasetIds . numericId , 10 )
1118+ const actual = await sut . getDatasetDownloadCount ( testDatasetIds . numericId )
1119+
1120+ expect ( actual . downloadCount ) . toBe ( 0 )
1121+ } )
1122+
1123+ test ( 'should return download count including MDC data' , async ( ) => {
1124+ const testDatasetIds = await createDataset . execute ( TestConstants . TEST_NEW_DATASET_DTO )
1125+ await publishDatasetViaApi ( testDatasetIds . numericId )
1126+ await waitForNoLocks ( testDatasetIds . numericId , 10 )
1127+
1128+ const actual = await sut . getDatasetDownloadCount ( testDatasetIds . numericId , true )
1129+
1130+ expect ( actual . downloadCount ) . toBe ( 0 )
1131+ } )
1132+
11111133 test ( 'should return error when dataset does not exist' , async ( ) => {
11121134 await expect ( sut . getDatasetDownloadCount ( nonExistentTestDatasetId ) ) . rejects . toBeInstanceOf (
11131135 ReadError
@@ -1121,32 +1143,5 @@ describe('DatasetsRepository', () => {
11211143 expectedError
11221144 )
11231145 } )
1124-
1125- describe ( 'getDatasetDownloadCount' , ( ) => {
1126- test ( 'should return download count for a dataset' , async ( ) => {
1127- const testDatasetIds = await createDataset . execute ( TestConstants . TEST_NEW_DATASET_DTO )
1128- const fileMetadata = {
1129- description : 'test description' ,
1130- directoryLabel : 'directoryLabel' ,
1131- categories : [ 'category1' , 'category2' ]
1132- }
1133- await uploadFileViaApi ( testDatasetIds . numericId , testTextFile1Name , fileMetadata )
1134- await publishDatasetViaApi ( testDatasetIds . numericId )
1135- await waitForNoLocks ( testDatasetIds . numericId , 10 )
1136- const actual = await sut . getDatasetDownloadCount ( testDatasetIds . numericId )
1137-
1138- expect ( actual . downloadCount ) . toBe ( 0 )
1139- } )
1140-
1141- test ( 'should return download count including MDC data' , async ( ) => {
1142- const testDatasetIds = await createDataset . execute ( TestConstants . TEST_NEW_DATASET_DTO )
1143- await publishDatasetViaApi ( testDatasetIds . numericId )
1144- await waitForNoLocks ( testDatasetIds . numericId , 10 )
1145-
1146- const actual = await sut . getDatasetDownloadCount ( testDatasetIds . numericId , true )
1147-
1148- expect ( actual . downloadCount ) . toBe ( 0 )
1149- } )
1150- } )
11511146 } )
11521147} )
0 commit comments