From: Tiago Melo Date: Fri, 2 Mar 2018 12:14:57 +0000 (+0000) Subject: mgr/dashboard_v2: add mocked service provider for TcmuIscsiService X-Git-Tag: v13.0.2~35^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F20775%2Fhead;p=ceph.git mgr/dashboard_v2: add mocked service provider for TcmuIscsiService This removes the warnings shown when running the tests with PhantomJS. Signed-off-by: Tiago Melo --- diff --git a/src/pybind/mgr/dashboard_v2/frontend/src/app/ceph/block/iscsi/iscsi.component.spec.ts b/src/pybind/mgr/dashboard_v2/frontend/src/app/ceph/block/iscsi/iscsi.component.spec.ts index c0f4c3646632..78c19b072475 100644 --- a/src/pybind/mgr/dashboard_v2/frontend/src/app/ceph/block/iscsi/iscsi.component.spec.ts +++ b/src/pybind/mgr/dashboard_v2/frontend/src/app/ceph/block/iscsi/iscsi.component.spec.ts @@ -1,18 +1,29 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { AppModule } from '../../../app.module'; +import { TcmuIscsiService } from '../../../shared/services/tcmu-iscsi.service'; import { IscsiComponent } from './iscsi.component'; describe('IscsiComponent', () => { let component: IscsiComponent; let fixture: ComponentFixture; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [AppModule] + const fakeService = { + tcmuiscsi: () => { + return new Promise(function(resolve, reject) { + return; + }); + }, + }; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [AppModule], + providers: [{ provide: TcmuIscsiService, useValue: fakeService }] + }).compileComponents(); }) - .compileComponents(); - })); + ); beforeEach(() => { fixture = TestBed.createComponent(IscsiComponent);