File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -28,21 +28,22 @@ describe('CSVStagingExtractor', () => {
28
28
// Test that valid data works fine
29
29
expect ( formatTNMCategoryData ( localData ) ) . toEqual ( expect . anything ( ) ) ;
30
30
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 = '' ;
38
38
39
39
// Only including required properties is valid
40
40
expect ( formatTNMCategoryData ( localData ) ) . toEqual ( expect . anything ( ) ) ;
41
41
42
42
// Removing each required property should throw an error
43
- Object . keys ( localData ) . forEach ( ( key ) => {
43
+ const requiredKeys = [ 'mrn' , 'conditionId' , 'effectiveDate' ] ;
44
+ requiredKeys . forEach ( ( key ) => {
44
45
const clonedData = _ . cloneDeep ( localData ) ;
45
- delete clonedData [ key ] ;
46
+ clonedData [ key ] = '' ;
46
47
expect ( ( ) => formatTNMCategoryData ( clonedData ) ) . toThrow ( new Error ( expectedErrorString ) ) ;
47
48
} ) ;
48
49
} ) ;
You can’t perform that action at this time.
0 commit comments