]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard_v2: add mocked service provider for TcmuIscsiService 20775/head
authorTiago Melo <tmelo@suse.com>
Fri, 2 Mar 2018 12:14:57 +0000 (12:14 +0000)
committerTiago Melo <tmelo@suse.com>
Wed, 7 Mar 2018 12:25:36 +0000 (12:25 +0000)
This removes the warnings shown when running the tests with PhantomJS.

Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard_v2/frontend/src/app/ceph/block/iscsi/iscsi.component.spec.ts

index c0f4c36466322e10cf48b8c8bd0f4660b618f82f..78c19b072475846b7bc1c253533880402821bd39 100644 (file)
@@ -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<IscsiComponent>;
 
-  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);