diff --git a/frontend/src/app/components/fhir/resources/allergy-intolerance/allergy-intolerance.component.spec.ts b/frontend/src/app/components/fhir/resources/allergy-intolerance/allergy-intolerance.component.spec.ts index 8377bb44..d7040be1 100644 --- a/frontend/src/app/components/fhir/resources/allergy-intolerance/allergy-intolerance.component.spec.ts +++ b/frontend/src/app/components/fhir/resources/allergy-intolerance/allergy-intolerance.component.spec.ts @@ -3,6 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { AllergyIntoleranceComponent } from './allergy-intolerance.component'; import {NgbCollapseModule} from '@ng-bootstrap/ng-bootstrap'; import {AuthService} from '../../../../services/auth.service'; +import {RouterTestingModule} from '@angular/router/testing'; describe('AllergyIntoleranceComponent', () => { let component: AllergyIntoleranceComponent; @@ -10,7 +11,7 @@ describe('AllergyIntoleranceComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [AllergyIntoleranceComponent, NgbCollapseModule], + imports: [AllergyIntoleranceComponent, NgbCollapseModule, RouterTestingModule], providers: [AuthService] }) .compileComponents(); diff --git a/frontend/src/lib/models/datatypes/human-name-model.spec.ts b/frontend/src/lib/models/datatypes/human-name-model.spec.ts index c2afc2de..adadd542 100644 --- a/frontend/src/lib/models/datatypes/human-name-model.spec.ts +++ b/frontend/src/lib/models/datatypes/human-name-model.spec.ts @@ -13,6 +13,7 @@ describe('HumanNameModel', () => { expectedHumanName.familyName = 'Windsor' expectedHumanName.suffix = '' expectedHumanName.use = 'maiden' + expectedHumanName.displayName = 'Peter, James Windsor' // expectedHumanName.header = 'Peter, James Windsor' expect(new HumanNameModel(fixture)).toEqual(expectedHumanName); diff --git a/frontend/src/lib/models/resources/allergy-intolerance-model.spec.ts b/frontend/src/lib/models/resources/allergy-intolerance-model.spec.ts index 43a9c549..e18d678c 100644 --- a/frontend/src/lib/models/resources/allergy-intolerance-model.spec.ts +++ b/frontend/src/lib/models/resources/allergy-intolerance-model.spec.ts @@ -49,6 +49,7 @@ describe('AllergyIntoleranceModel', () => { // expected.type = '' expected.category = ['medication'] expected.patient = {reference: 'Patient/example'} + expected.code = { coding: [{ system: 'http://www.nlm.nih.gov/research/umls/rxnorm', code: '7980', display: 'Penicillin G' } ] } expect(new AllergyIntoleranceModel(example2Fixture)).toEqual(expected); }); @@ -64,6 +65,7 @@ describe('AllergyIntoleranceModel', () => { // expected.type = 'allergy' // expected.category = [ 'food' ] expected.patient = {reference: 'Patient/mom'} + expected.code = { coding: [{ system: 'http://snomed.info/sct', code: '716186003', display: 'No Known Allergy (situation)' } ], text: 'NKA' } expect(new AllergyIntoleranceModel(example3Fixture)).toEqual(expected); }); @@ -133,7 +135,7 @@ describe('AllergyIntoleranceModel', () => { expected.type = 'allergy' expected.category = ['food'] expected.patient = {reference: 'Patient/example'} - + expected.code = { coding: [ { system: 'http://snomed.info/sct', code: '227493005', display: 'Cashew nuts' } ] } expect(new AllergyIntoleranceModel(example1Stu3Fixture, fhirVersions.STU3)).toEqual(expected); }); @@ -149,6 +151,7 @@ describe('AllergyIntoleranceModel', () => { // expected.type = 'allergy' expected.category = ['food'] expected.patient = {reference: 'Patient/example'} + expected.code = { coding: [{ system: 'http://snomed.info/sct', code: '227037002', display: 'Fish - dietary (substance)' }], text: 'Allergic to fresh fish. Tolerates canned fish' } expect(new AllergyIntoleranceModel(example2Stu3Fixture, fhirVersions.STU3)).toEqual(expected); }); diff --git a/frontend/src/lib/models/resources/condition-model.spec.ts b/frontend/src/lib/models/resources/condition-model.spec.ts index d1204baa..72da3136 100644 --- a/frontend/src/lib/models/resources/condition-model.spec.ts +++ b/frontend/src/lib/models/resources/condition-model.spec.ts @@ -36,7 +36,7 @@ describe('ConditionModel', () => { expected.clinical_status = 'active' // expected.dateRecorded: string | undefined expected.onset_datetime = '2012-05-24' - + expected.code = { coding: [{ system: 'http://snomed.info/sct', code: '39065001', display: 'Burn of ear' } ], text: 'Burnt Ear' } expect(new ConditionModel(example1Fixture)).toEqual(expected); }); it('should parse example2.json', () => { @@ -51,7 +51,8 @@ describe('ConditionModel', () => { expected.clinical_status = 'active' // expected.dateRecorded: string | undefined // expected.onsetDateTime = '2012-05-24' - + //@ts-ignore + expected.code = {text: 'Asthma' } expect(new ConditionModel(example2Fixture)).toEqual(expected); }); it('should parse example3.json', () => { @@ -67,6 +68,7 @@ describe('ConditionModel', () => { expected.clinical_status = 'resolved' expected.date_recorded = '2013-04-04' expected.onset_datetime = '2013-04-02' + expected.code ={ coding: [{ system: 'http://snomed.info/sct', code: '386661006', display: 'Fever' }] } expect(new ConditionModel(example3Fixture)).toEqual(expected); });