X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fei-coordinator%2Fei-coordinator.component.spec.ts;h=3e0fbf5c257c12627c4c477a908f4b5793af6856;hb=92f286c193d0b5090129614c76601dcf02ca22b5;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..3e0fbf5 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,51 @@ * ========================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, MatTableModule } from '@angular/material'; + +import { of } from 'rxjs'; 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', [ 'connect', 'getJobs', 'disconnect' ]); + const producerDataSourceSpy = jasmine.createSpyObj('EIProducerDataSource', [ 'connect', 'loadTable', 'loadProducers', 'disconnect' ]); + + jobDataSourceSpy.connect.and.returnValue(of([])); + jobDataSourceSpy.disconnect(); + producerDataSourceSpy.connect.and.returnValue(of([])); + producerDataSourceSpy.loadProducers.and.returnValue(of([])); + producerDataSourceSpy.disconnect(); + 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 +72,8 @@ describe('EICoordinatorComponent', () => { component = fixture.componentInstance; fixture.detectChanges(); }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); });