WIP fixing tests (1 failure)
This commit is contained in:
parent
627b697741
commit
8652218180
|
@ -24,6 +24,7 @@ export class MedicalSourcesCardComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
getSourceDisplayName(sourceItem: SourceListItem): string {
|
getSourceDisplayName(sourceItem: SourceListItem): string {
|
||||||
|
if(!sourceItem) return "Unknown"
|
||||||
if(sourceItem.metadata?.display) {
|
if(sourceItem.metadata?.display) {
|
||||||
return sourceItem.metadata?.display
|
return sourceItem.metadata?.display
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { BackgroundJobsComponent } from './background-jobs.component';
|
import { BackgroundJobsComponent } from './background-jobs.component';
|
||||||
|
import {HttpClientTestingModule} from '@angular/common/http/testing';
|
||||||
|
import {RouterTestingModule} from '@angular/router/testing';
|
||||||
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
|
import {HTTP_CLIENT_TOKEN} from '../../dependency-injection';
|
||||||
|
import {HttpClient} from '@angular/common/http';
|
||||||
|
|
||||||
describe('BackgroundJobsComponent', () => {
|
describe('BackgroundJobsComponent', () => {
|
||||||
let component: BackgroundJobsComponent;
|
let component: BackgroundJobsComponent;
|
||||||
|
@ -8,7 +13,14 @@ describe('BackgroundJobsComponent', () => {
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ BackgroundJobsComponent ]
|
declarations: [ BackgroundJobsComponent ],
|
||||||
|
imports: [HttpClientTestingModule],
|
||||||
|
providers: [
|
||||||
|
{
|
||||||
|
provide: HTTP_CLIENT_TOKEN,
|
||||||
|
useClass: HttpClient,
|
||||||
|
},
|
||||||
|
]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { ReportLabsComponent } from './report-labs.component';
|
||||||
import {FastenApiService} from '../../services/fasten-api.service';
|
import {FastenApiService} from '../../services/fasten-api.service';
|
||||||
import {NgbModalModule} from '@ng-bootstrap/ng-bootstrap';
|
import {NgbModalModule} from '@ng-bootstrap/ng-bootstrap';
|
||||||
import {of} from 'rxjs';
|
import {of} from 'rxjs';
|
||||||
|
import {RouterTestingModule} from '@angular/router/testing';
|
||||||
|
|
||||||
describe('ReportLabsComponent', () => {
|
describe('ReportLabsComponent', () => {
|
||||||
let component: ReportLabsComponent;
|
let component: ReportLabsComponent;
|
||||||
|
@ -12,9 +13,10 @@ describe('ReportLabsComponent', () => {
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
|
||||||
mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['getResources'])
|
mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['getResources', 'queryResources'])
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ ReportLabsComponent ],
|
declarations: [ ReportLabsComponent ],
|
||||||
|
imports: [RouterTestingModule],
|
||||||
providers: [{
|
providers: [{
|
||||||
provide: FastenApiService,
|
provide: FastenApiService,
|
||||||
useValue: mockedFastenApiService
|
useValue: mockedFastenApiService
|
||||||
|
@ -22,6 +24,7 @@ describe('ReportLabsComponent', () => {
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
mockedFastenApiService.getResources.and.returnValue(of([]));
|
mockedFastenApiService.getResources.and.returnValue(of([]));
|
||||||
|
mockedFastenApiService.queryResources.and.returnValue(of([]));
|
||||||
|
|
||||||
fixture = TestBed.createComponent(ReportLabsComponent);
|
fixture = TestBed.createComponent(ReportLabsComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|
|
@ -1,12 +1,23 @@
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { EventBusService } from './event-bus.service';
|
import { EventBusService } from './event-bus.service';
|
||||||
|
import {HttpClientTestingModule} from '@angular/common/http/testing';
|
||||||
|
import {HTTP_CLIENT_TOKEN} from '../dependency-injection';
|
||||||
|
import {HttpClient} from '@angular/common/http';
|
||||||
|
|
||||||
describe('EventBusService', () => {
|
describe('EventBusService', () => {
|
||||||
let service: EventBusService;
|
let service: EventBusService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({
|
||||||
|
imports: [HttpClientTestingModule],
|
||||||
|
providers: [
|
||||||
|
{
|
||||||
|
provide: HTTP_CLIENT_TOKEN,
|
||||||
|
useClass: HttpClient,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
});
|
||||||
service = TestBed.inject(EventBusService);
|
service = TestBed.inject(EventBusService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { ImageListGroupWidgetComponent } from './image-list-group-widget.component';
|
import { ImageListGroupWidgetComponent } from './image-list-group-widget.component';
|
||||||
|
import {FastenApiService} from '../../services/fasten-api.service';
|
||||||
|
import {HTTP_CLIENT_TOKEN} from '../../dependency-injection';
|
||||||
|
import {HttpClient} from '@angular/common/http';
|
||||||
|
import {HttpClientTestingModule} from '@angular/common/http/testing';
|
||||||
|
|
||||||
describe('ImageListGroupWidgetComponent', () => {
|
describe('ImageListGroupWidgetComponent', () => {
|
||||||
let component: ImageListGroupWidgetComponent;
|
let component: ImageListGroupWidgetComponent;
|
||||||
|
@ -8,7 +12,13 @@ describe('ImageListGroupWidgetComponent', () => {
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ ImageListGroupWidgetComponent ]
|
imports: [ ImageListGroupWidgetComponent, HttpClientTestingModule ],
|
||||||
|
providers: [
|
||||||
|
{
|
||||||
|
provide: HTTP_CLIENT_TOKEN,
|
||||||
|
useClass: HttpClient,
|
||||||
|
},
|
||||||
|
]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ describe('PatientVitalsWidgetComponent', () => {
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['queryResources'])
|
mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['queryResources'])
|
||||||
|
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [ PatientVitalsWidgetComponent, RouterTestingModule ],
|
imports: [ PatientVitalsWidgetComponent, RouterTestingModule ],
|
||||||
providers: [
|
providers: [
|
||||||
|
|
|
@ -1,16 +1,34 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { RecordsSummaryWidgetComponent } from './records-summary-widget.component';
|
import { RecordsSummaryWidgetComponent } from './records-summary-widget.component';
|
||||||
|
import {FastenApiService} from '../../services/fasten-api.service';
|
||||||
|
import {HTTP_CLIENT_TOKEN} from '../../dependency-injection';
|
||||||
|
import {HttpClient} from '@angular/common/http';
|
||||||
|
import {RouterTestingModule} from '@angular/router/testing';
|
||||||
|
import {of} from 'rxjs';
|
||||||
|
|
||||||
describe('RecordsSummaryWidgetComponent', () => {
|
describe('RecordsSummaryWidgetComponent', () => {
|
||||||
let component: RecordsSummaryWidgetComponent;
|
let component: RecordsSummaryWidgetComponent;
|
||||||
let fixture: ComponentFixture<RecordsSummaryWidgetComponent>;
|
let fixture: ComponentFixture<RecordsSummaryWidgetComponent>;
|
||||||
|
let mockedFastenApiService
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['getSummary'])
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ RecordsSummaryWidgetComponent ]
|
imports: [ RecordsSummaryWidgetComponent, RouterTestingModule ],
|
||||||
|
providers: [
|
||||||
|
{
|
||||||
|
provide: FastenApiService,
|
||||||
|
useValue: mockedFastenApiService
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provide: HTTP_CLIENT_TOKEN,
|
||||||
|
useClass: HttpClient,
|
||||||
|
}
|
||||||
|
]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
mockedFastenApiService.getSummary.and.returnValue(of({}));
|
||||||
|
|
||||||
fixture = TestBed.createComponent(RecordsSummaryWidgetComponent);
|
fixture = TestBed.createComponent(RecordsSummaryWidgetComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|
Loading…
Reference in New Issue