Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Sep 6, 2023
1 parent f5c245a commit 786f2f6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ 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;
let fixture: ComponentFixture<AllergyIntoleranceComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AllergyIntoleranceComponent, NgbCollapseModule],
imports: [AllergyIntoleranceComponent, NgbCollapseModule, RouterTestingModule],
providers: [AuthService]
})
.compileComponents();
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/models/datatypes/human-name-model.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand All @@ -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);
});
Expand Down Expand Up @@ -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);
});

Expand All @@ -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);
});
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/lib/models/resources/condition-model.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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', () => {
Expand All @@ -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);
});
Expand Down

0 comments on commit 786f2f6

Please sign in to comment.