From dda02795d2c4b51baeaf3e2270602790ef46381c Mon Sep 17 00:00:00 2001 From: Ellen Kraffmiller Date: Fri, 22 Nov 2024 15:51:03 -0500 Subject: [PATCH] fix: unit test --- .../mappers/JSDatasetMapper.spec.ts | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/tests/component/dataset/infrastructure/mappers/JSDatasetMapper.spec.ts b/tests/component/dataset/infrastructure/mappers/JSDatasetMapper.spec.ts index 28ff1f0ff..8a66746f1 100644 --- a/tests/component/dataset/infrastructure/mappers/JSDatasetMapper.spec.ts +++ b/tests/component/dataset/infrastructure/mappers/JSDatasetMapper.spec.ts @@ -826,9 +826,55 @@ describe('JS Dataset Mapper', () => { tags: ['tag1'], categories: ['category1'] } + ], + fileChanges: [ + { + fileName: 'file1.txt', + md5: 'd41d8cd98f00b204e9800998ecf8427e', + fileId: 1, + changed: [ + { + fieldName: 'description', + oldValue: 'Old description', + newValue: 'New description' + } + ] + } + ], + filesReplaced: [ + { + oldFile: { + fileName: 'file1.txt', + MD5: 'd41d8cd98f00b204e9800998ecf8427e', + type: 'text/plain', + fileId: 1, + filePath: '/path/to/file1.txt', + description: 'Test file', + isRestricted: false, + tags: ['tag1'], + categories: ['category1'] + }, + newFile: { + fileName: 'file2.txt', + MD5: 'd41d8cd98f00b204e9800998ecf8427e', + type: 'text/plain', + fileId: 2, + filePath: '/path/to/file2.txt', + description: 'New file', + isRestricted: false, + tags: ['tag2'], + categories: ['category2'] + } + } + ], + termsOfAccess: [ + { + fieldName: 'termsOfAccess', + oldValue: 'Old terms', + newValue: 'New terms' + } ] } - const actual = JSDatasetMapper.toDatasetVersionDiff(jsDatasetVersionDiff) expect(expectedDatasetVersionDiff).to.deep.equal(actual) })