fixing tests (#109)
This commit is contained in:
parent
f6fb99002e
commit
003e713ccf
|
@ -53,14 +53,14 @@ export class PractitionerComponent implements OnInit, FhirResourceComponentInter
|
||||||
// enabled: !!this.displayModel.telecom,
|
// enabled: !!this.displayModel.telecom,
|
||||||
// },
|
// },
|
||||||
];
|
];
|
||||||
for(let idCoding of this.displayModel.identifier){
|
for(let idCoding of (this.displayModel?.identifier || [])){
|
||||||
this.tableData.push({
|
this.tableData.push({
|
||||||
label: `Identifier (${idCoding.system})`,
|
label: `Identifier (${idCoding.system})`,
|
||||||
data: idCoding.display || idCoding.value,
|
data: idCoding.display || idCoding.value,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
for(let telecom of this.displayModel.telecom){
|
for(let telecom of (this.displayModel?.telecom || [])){
|
||||||
this.tableData.push({
|
this.tableData.push({
|
||||||
label: telecom.system,
|
label: telecom.system,
|
||||||
data: telecom.value,
|
data: telecom.value,
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { NlmTypeaheadComponent } from './nlm-typeahead.component';
|
import { NlmTypeaheadComponent } from './nlm-typeahead.component';
|
||||||
|
import {HttpClientTestingModule} from '@angular/common/http/testing';
|
||||||
|
import {NgbActiveModal, NgbCollapseModule, NgbTypeaheadModule} from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import {FastenApiService} from '../../services/fasten-api.service';
|
||||||
|
import {NlmClinicalTableSearchService} from '../../services/nlm-clinical-table-search.service';
|
||||||
|
|
||||||
describe('NlmTypeaheadComponent', () => {
|
describe('NlmTypeaheadComponent', () => {
|
||||||
let component: NlmTypeaheadComponent;
|
let component: NlmTypeaheadComponent;
|
||||||
|
@ -8,7 +12,27 @@ describe('NlmTypeaheadComponent', () => {
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ NlmTypeaheadComponent ]
|
imports: [
|
||||||
|
NgbTypeaheadModule
|
||||||
|
],
|
||||||
|
declarations: [ NlmTypeaheadComponent ],
|
||||||
|
providers: [{
|
||||||
|
provide: NlmClinicalTableSearchService,
|
||||||
|
useValue: jasmine.createSpyObj('NlmClinicalTableSearchService', [
|
||||||
|
'searchAllergy',
|
||||||
|
'searchAllergyReaction',
|
||||||
|
'searchCondition',
|
||||||
|
'searchCountries',
|
||||||
|
'searchMedicalContactIndividualProfession',
|
||||||
|
'searchMedicalContactIndividual',
|
||||||
|
'searchMedicalContactOrganization',
|
||||||
|
'searchMedicalContactOrganizationType',
|
||||||
|
'searchMedication',
|
||||||
|
'searchMedicationWhyStopped',
|
||||||
|
'searchProcedure',
|
||||||
|
'searchVaccine',
|
||||||
|
])
|
||||||
|
}]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
{{conditionDisplayModel?.sort_title ? conditionDisplayModel?.sort_title : (conditionGroup | fhirPath: "Condition.code.text.first()":"Condition.code.coding.display.first()")}}
|
{{conditionDisplayModel?.sort_title ? conditionDisplayModel?.sort_title : (conditionGroup | fhirPath: "Condition.code.text.first()":"Condition.code.coding.display.first()")}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
{{conditionDisplayModel?.onset_datetime | date }} <span *ngIf="conditionDisplayModel.abatement_datetime">- {{conditionDisplayModel.abatement_datetime | date}}</span>
|
{{conditionDisplayModel?.onset_datetime | date }} <span *ngIf="conditionDisplayModel?.abatement_datetime">- {{conditionDisplayModel.abatement_datetime | date}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- card-header -->
|
</div><!-- card-header -->
|
||||||
|
|
|
@ -66,6 +66,10 @@ export class ReportMedicalHistoryConditionComponent implements OnInit {
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
if(!this.conditionGroup){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
//add resources to the lookup table, ensure uniqueness.
|
//add resources to the lookup table, ensure uniqueness.
|
||||||
this.conditionDisplayModel = this.recExtractResources(this.conditionGroup)
|
this.conditionDisplayModel = this.recExtractResources(this.conditionGroup)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { ResourceCreatorComponent } from './resource-creator.component';
|
import { ResourceCreatorComponent } from './resource-creator.component';
|
||||||
|
import {HttpClientTestingModule} from '@angular/common/http/testing';
|
||||||
|
import {RouterTestingModule} from '@angular/router/testing';
|
||||||
|
import {NgbCollapseModule, NgbDatepickerModule} from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
|
||||||
describe('ResourceCreatorComponent', () => {
|
describe('ResourceCreatorComponent', () => {
|
||||||
let component: ResourceCreatorComponent;
|
let component: ResourceCreatorComponent;
|
||||||
|
@ -8,6 +11,7 @@ describe('ResourceCreatorComponent', () => {
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [HttpClientTestingModule, RouterTestingModule, NgbDatepickerModule, NgbCollapseModule],
|
||||||
declarations: [ ResourceCreatorComponent ]
|
declarations: [ ResourceCreatorComponent ]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { NlmClinicalTableSearchService } from './nlm-clinical-table-search.service';
|
import { NlmClinicalTableSearchService } from './nlm-clinical-table-search.service';
|
||||||
|
import {HttpClientTestingModule} from '@angular/common/http/testing';
|
||||||
|
|
||||||
describe('NlmClinicalTableSearchService', () => {
|
describe('NlmClinicalTableSearchService', () => {
|
||||||
let service: NlmClinicalTableSearchService;
|
let service: NlmClinicalTableSearchService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({
|
||||||
|
imports: [HttpClientTestingModule],
|
||||||
|
});
|
||||||
service = TestBed.inject(NlmClinicalTableSearchService);
|
service = TestBed.inject(NlmClinicalTableSearchService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue