@@ -21,7 +21,7 @@ describe('FHIRAdverseEventExtractor', () => {
21
21
test ( 'sets study based on BASE_STUDY if not provided' , ( ) => {
22
22
expect ( extractor . study ) . toEqual ( baseStudy ) ;
23
23
} ) ;
24
- test ( 'sets status if provided' , ( ) => {
24
+ test ( 'sets study if provided' , ( ) => {
25
25
expect ( extractorWithStudy . study ) . toEqual ( MOCK_STUDIES ) ;
26
26
} ) ;
27
27
} ) ;
@@ -38,27 +38,25 @@ describe('FHIRAdverseEventExtractor', () => {
38
38
expect ( params ) . not . toHaveProperty ( 'study' ) ;
39
39
} ) ;
40
40
41
- test ( 'should add study when set to param values' , async ( ) => {
42
- // Create spy
43
- const { baseFHIRModule } = extractorWithStudy ;
44
- const baseFHIRModuleSearchSpy = jest . spyOn ( baseFHIRModule , 'search' ) ;
45
- baseFHIRModuleSearchSpy
46
- . mockReturnValue ( examplePatientBundle ) ;
47
-
48
- const params = await extractorWithStudy . parametrizeArgsForFHIRModule ( { mrn : MOCK_MRN } ) ;
49
- expect ( params ) . toHaveProperty ( 'study' ) ;
50
- expect ( params . study ) . toEqual ( extractorWithStudy . study ) ;
51
- } ) ;
52
-
53
- test ( 'should delete patient after its value is moved to subject' , async ( ) => {
54
- // Create spy
55
- const { baseFHIRModule } = extractorWithStudy ;
56
- const baseFHIRModuleSearchSpy = jest . spyOn ( baseFHIRModule , 'search' ) ;
57
- baseFHIRModuleSearchSpy
58
- . mockReturnValue ( examplePatientBundle ) ;
59
-
60
- const params = await extractorWithStudy . parametrizeArgsForFHIRModule ( { mrn : MOCK_MRN } ) ;
61
- expect ( params ) . not . toHaveProperty ( 'patient' ) ;
41
+ describe ( 'pass in optional study parameter' , ( ) => {
42
+ beforeEach ( ( ) => {
43
+ // Create spy
44
+ const { baseFHIRModule } = extractorWithStudy ;
45
+ const baseFHIRModuleSearchSpy = jest . spyOn ( baseFHIRModule , 'search' ) ;
46
+ baseFHIRModuleSearchSpy
47
+ . mockReturnValue ( examplePatientBundle ) ;
48
+ } ) ;
49
+
50
+ test ( 'should add study when set to param values' , async ( ) => {
51
+ const params = await extractorWithStudy . parametrizeArgsForFHIRModule ( { mrn : MOCK_MRN } ) ;
52
+ expect ( params ) . toHaveProperty ( 'study' ) ;
53
+ expect ( params . study ) . toEqual ( extractorWithStudy . study ) ;
54
+ } ) ;
55
+
56
+ test ( 'should delete patient after its value is moved to subject' , async ( ) => {
57
+ const params = await extractorWithStudy . parametrizeArgsForFHIRModule ( { mrn : MOCK_MRN } ) ;
58
+ expect ( params ) . not . toHaveProperty ( 'patient' ) ;
59
+ } ) ;
62
60
} ) ;
63
61
} ) ;
64
62
} ) ;
0 commit comments