Skip to content

Commit 2b01fa0

Browse files
committed
JC1 - fixed CSVStagingExtractor tests to line up with expected responses from CSVModule
1 parent 73048fe commit 2b01fa0

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

test/extractors/CSVStagingExtractor.test.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,22 @@ describe('CSVStagingExtractor', () => {
2828
// Test that valid data works fine
2929
expect(formatTNMCategoryData(localData)).toEqual(expect.anything());
3030

31-
// Test all optional properties can be removed without throwing errors
32-
delete localData.t;
33-
delete localData.m;
34-
delete localData.n;
35-
delete localData.type;
36-
delete localData.stagingSystem;
37-
delete localData.stageGroup;
31+
// Test all optional properties can be empty without issue
32+
localData.t = '';
33+
localData.m = '';
34+
localData.n = '';
35+
localData.type = '';
36+
localData.stagingSystem = '';
37+
localData.stageGroup = '';
3838

3939
// Only including required properties is valid
4040
expect(formatTNMCategoryData(localData)).toEqual(expect.anything());
4141

4242
// Removing each required property should throw an error
43-
Object.keys(localData).forEach((key) => {
43+
const requiredKeys = ['mrn', 'conditionId', 'effectiveDate'];
44+
requiredKeys.forEach((key) => {
4445
const clonedData = _.cloneDeep(localData);
45-
delete clonedData[key];
46+
clonedData[key] = '';
4647
expect(() => formatTNMCategoryData(clonedData)).toThrow(new Error(expectedErrorString));
4748
});
4849
});

0 commit comments

Comments
 (0)