Skip to content

Commit 32b47de

Browse files
committed
fix: change the order of a testcase
1 parent 78d2719 commit 32b47de

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

test/integration/files/FilesRepository.test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,42 @@ describe('FilesRepository', () => {
576576
})
577577
})
578578

579+
describe('updateFileMetadata', () => {
580+
test('should return error when file does not exist', async () => {
581+
const nonExistentFiledId = 4000
582+
const testFileMetadata = {
583+
description: 'My description bbb.',
584+
categories: ['Data'],
585+
restrict: false
586+
}
587+
const errorExpected = new WriteError(`[400] Error attempting get the requested data file.`)
588+
589+
await expect(sut.updateFileMetadata(nonExistentFiledId, testFileMetadata)).rejects.toThrow(
590+
errorExpected
591+
)
592+
})
593+
594+
test('should update file metadata when file exists', async () => {
595+
const getDatasetFilesResponse = await sut.getDatasetFiles(
596+
testDatasetIds.numericId,
597+
latestDatasetVersionId,
598+
false,
599+
FileOrderCriteria.NAME_AZ
600+
)
601+
602+
const fileId = getDatasetFilesResponse.files[0].id
603+
const testFileMetadata = {
604+
description: 'My description bbb.',
605+
categories: ['Data'],
606+
restrict: false
607+
}
608+
609+
const actual = await sut.updateFileMetadata(fileId, testFileMetadata)
610+
611+
expect(actual).toBeUndefined()
612+
})
613+
})
614+
579615
describe('getFileUploadDestination', () => {
580616
const testCollectionAlias = 'getFileUploadDestinationsTestCollection'
581617
let testDataset2Ids: CreatedDatasetIdentifiers

0 commit comments

Comments
 (0)