X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=webapp-frontend%2Fsrc%2Fapp%2Fei-coordinator%2Fei-coordinator.component.spec.ts;h=4767de6db974e47d2d450985c02fdef10d63db90;hb=refs%2Fchanges%2F68%2F5668%2F5;hp=59b09e9a8d5fed96450647c51b5a914350036889;hpb=f34ec0823b56ceaf7a6073be6fc530b0d432b37d;p=portal%2Fnonrtric-controlpanel.git diff --git a/webapp-frontend/src/app/ei-coordinator/ei-coordinator.component.spec.ts b/webapp-frontend/src/app/ei-coordinator/ei-coordinator.component.spec.ts index 59b09e9..4767de6 100644 --- a/webapp-frontend/src/app/ei-coordinator/ei-coordinator.component.spec.ts +++ b/webapp-frontend/src/app/ei-coordinator/ei-coordinator.component.spec.ts @@ -18,16 +18,48 @@ * ========================LICENSE_END=================================== */ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations' +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTableModule } from '@angular/material/table'; import { EICoordinatorComponent } from './ei-coordinator.component'; +import { EIJobDataSource } from './ei-job.datasource'; +import { EIProducerDataSource } from './ei-producer.datasource'; +import { UiService } from '../services/ui/ui.service'; describe('EICoordinatorComponent', () => { let component: EICoordinatorComponent; let fixture: ComponentFixture; beforeEach(async(() => { + const jobDataSourceSpy = jasmine.createSpyObj('EIJobDataSource', [ 'loadJobs', 'eiJobs' ]); + const producerDataSourceSpy = jasmine.createSpyObj('EIProducerDataSource', [ 'loadProducers', 'eiProducers' ]); + + jobDataSourceSpy.eiJobs.and.returnValue([]); + + producerDataSourceSpy.eiProducers.and.returnValue([]); + TestBed.configureTestingModule({ - declarations: [ EICoordinatorComponent ] + imports: [ + MatIconModule, + MatTableModule, + BrowserAnimationsModule, + ReactiveFormsModule + ], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ], + declarations: [ + EICoordinatorComponent + ], + providers: [ + { provide: EIJobDataSource, useValue: jobDataSourceSpy }, + { provide: EIProducerDataSource, useValue: producerDataSourceSpy }, + UiService, + FormBuilder, + ] }) .compileComponents(); })); @@ -37,4 +69,8 @@ describe('EICoordinatorComponent', () => { component = fixture.componentInstance; fixture.detectChanges(); }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); });