fixing frontend tests.
This commit is contained in:
parent
b8ea3c8f97
commit
18f8b36a39
|
@ -1,8 +1,76 @@
|
||||||
import { FhirResourceOutletDirective } from './fhir-resource-outlet.directive';
|
import { FhirResourceOutletDirective } from './fhir-resource-outlet.directive';
|
||||||
|
|
||||||
|
import {
|
||||||
|
ComponentFactory, ComponentRef,
|
||||||
|
EmbeddedViewRef, EnvironmentInjector,
|
||||||
|
Injector,
|
||||||
|
NgModuleRef,
|
||||||
|
TemplateRef,
|
||||||
|
Type,
|
||||||
|
ViewContainerRef
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
class TestViewContainerRef extends ViewContainerRef {
|
||||||
|
get element(): import("@angular/core").ElementRef<any> {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
get injector(): import("@angular/core").Injector {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
get parentInjector(): import("@angular/core").Injector {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
clear(): void {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
get(index: number): import("@angular/core").ViewRef {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
get length(): number {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
// createEmbeddedView<C>(templateRef: import("@angular/core").TemplateRef<C>, context?: C, index?: number): import("@angular/core").EmbeddedViewRef<C> {
|
||||||
|
// throw new Error("Method not implemented.");
|
||||||
|
// }
|
||||||
|
// createComponent<C>(componentFactory: import("@angular/core").ComponentFactory<C>, index?: number, injector?: import("@angular/core").Injector, projectableNodes?: any[][], ngModule?: import("@angular/core").NgModuleRef<any>): import("@angular/core").ComponentRef<C> {
|
||||||
|
// throw new Error("Method not implemented.");
|
||||||
|
// }
|
||||||
|
insert(viewRef: import("@angular/core").ViewRef, index?: number): import("@angular/core").ViewRef {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
move(viewRef: import("@angular/core").ViewRef, currentIndex: number): import("@angular/core").ViewRef {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
indexOf(viewRef: import("@angular/core").ViewRef): number {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
remove(index?: number): void {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
detach(index?: number): import("@angular/core").ViewRef {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
|
||||||
|
createComponent<C>(componentType: Type<C>, options?: { index?: number; injector?: Injector; ngModuleRef?: NgModuleRef<unknown>; environmentInjector?: EnvironmentInjector | NgModuleRef<unknown>; projectableNodes?: Node[][] }): ComponentRef<C>;
|
||||||
|
createComponent<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?: any[][], environmentInjector?: EnvironmentInjector | NgModuleRef<any>): ComponentRef<C>;
|
||||||
|
createComponent<C>(componentType, options?: { index?: number; injector?: Injector; ngModuleRef?: NgModuleRef<unknown>; environmentInjector?: EnvironmentInjector | NgModuleRef<unknown>; projectableNodes?: Node[][] } | number, injector?: Injector, projectableNodes?: any[][], environmentInjector?: EnvironmentInjector | NgModuleRef<any>): ComponentRef<C> {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
|
||||||
|
createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, options?: { index?: number; injector?: Injector }): EmbeddedViewRef<C>;
|
||||||
|
createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): EmbeddedViewRef<C>;
|
||||||
|
createEmbeddedView<C>(templateRef, context?, options?: { index?: number; injector?: Injector } | number): EmbeddedViewRef<C> {
|
||||||
|
throw new Error("Method not implemented.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
describe('FhirResourceOutletDirective', () => {
|
describe('FhirResourceOutletDirective', () => {
|
||||||
|
|
||||||
|
|
||||||
it('should create an instance', () => {
|
it('should create an instance', () => {
|
||||||
const directive = new FhirResourceOutletDirective();
|
const directive = new FhirResourceOutletDirective(new TestViewContainerRef());
|
||||||
expect(directive).toBeTruthy();
|
expect(directive).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import * as moment from 'moment'
|
import moment from "moment";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Walks thru an object (ar array) and returns the value found at the provided
|
* Walks thru an object (ar array) and returns the value found at the provided
|
||||||
|
|
|
@ -111,7 +111,7 @@ export class ReportMedicalHistoryConditionComponent implements OnInit {
|
||||||
this.encounters.push(resource as EncounterModel);
|
this.encounters.push(resource as EncounterModel);
|
||||||
|
|
||||||
(resource as EncounterModel).participant.map((participant) => {
|
(resource as EncounterModel).participant.map((participant) => {
|
||||||
let id = participant.reference
|
let id = participant.reference.reference
|
||||||
involvedInCareMap[id] = _.mergeWith(
|
involvedInCareMap[id] = _.mergeWith(
|
||||||
{},
|
{},
|
||||||
involvedInCareMap[id],
|
involvedInCareMap[id],
|
||||||
|
|
|
@ -12,11 +12,11 @@ export class CareTeamModel extends FastenDisplayModel {
|
||||||
period_start: string | undefined
|
period_start: string | undefined
|
||||||
period_end: string | undefined
|
period_end: string | undefined
|
||||||
participants: {
|
participants: {
|
||||||
reference:string
|
reference?: string,
|
||||||
display:string,
|
display?:string,
|
||||||
role:string,
|
role?:string,
|
||||||
periodStart: string,
|
periodStart?: string,
|
||||||
periodEnd: string
|
periodEnd?: string
|
||||||
}[] | undefined
|
}[] | undefined
|
||||||
category: CodableConceptModel[] | undefined
|
category: CodableConceptModel[] | undefined
|
||||||
subject: ReferenceModel | undefined
|
subject: ReferenceModel | undefined
|
||||||
|
|
|
@ -18,7 +18,7 @@ export class EncounterModel extends FastenDisplayModel {
|
||||||
participant: {
|
participant: {
|
||||||
display?: string,
|
display?: string,
|
||||||
role?: string,
|
role?: string,
|
||||||
reference?: string,
|
reference?: ReferenceModel,
|
||||||
text?: string,
|
text?: string,
|
||||||
periodStart?:string
|
periodStart?:string
|
||||||
}[] | undefined
|
}[] | undefined
|
||||||
|
@ -85,7 +85,7 @@ export class EncounterModel extends FastenDisplayModel {
|
||||||
return {
|
return {
|
||||||
role: _.get(item, 'type[0].text') || _.get(item, 'type[0].coding[0].display'),
|
role: _.get(item, 'type[0].text') || _.get(item, 'type[0].coding[0].display'),
|
||||||
display: _.get(item, 'individual.display'),
|
display: _.get(item, 'individual.display'),
|
||||||
reference: _.get(item, 'individual.reference'),
|
reference: _.get(item, 'individual'),
|
||||||
text: _.get(item, 'type[0].text'),
|
text: _.get(item, 'type[0].text'),
|
||||||
periodStart,
|
periodStart,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue