]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix HttpClient Module imports in unit tests 24679/head
authorTiago Melo <tspmelo@gmail.com>
Fri, 19 Oct 2018 15:56:21 +0000 (16:56 +0100)
committerTiago Melo <tmelo@suse.com>
Tue, 23 Oct 2018 09:41:51 +0000 (10:41 +0100)
Some of the tests were importing the wrong HttpClient Module and that was
causing random errors.

Fixes: https://tracker.ceph.com/issues/36528
Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.spec.ts

index bbab68c092505f90b5aa04d2aa868109ccb216b1..ecd5b5fd1818fdff9f83ea44a34068647ee0f6bf 100644 (file)
@@ -1,4 +1,4 @@
-import { HttpClientModule } from '@angular/common/http';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { DebugElement } from '@angular/core';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 
@@ -22,7 +22,12 @@ describe('OsdDetailsComponent', () => {
   let getDetailsSpy;
 
   configureTestBed({
-    imports: [HttpClientModule, TabsModule.forRoot(), PerformanceCounterModule, SharedModule],
+    imports: [
+      HttpClientTestingModule,
+      TabsModule.forRoot(),
+      PerformanceCounterModule,
+      SharedModule
+    ],
     declarations: [OsdDetailsComponent, OsdPerformanceHistogramComponent]
   });
 
index f38575b0e9ef01fd1d90643367bab97551fff4df..a8c293b97a90fe3a71a36a64e94f41d0cf1fd4dc 100644 (file)
@@ -1,4 +1,4 @@
-import { HttpClientModule } from '@angular/common/http';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { By } from '@angular/platform-browser';
 import { RouterTestingModule } from '@angular/router/testing';
@@ -27,7 +27,7 @@ describe('OsdListComponent', () => {
 
   configureTestBed({
     imports: [
-      HttpClientModule,
+      HttpClientTestingModule,
       PerformanceCounterModule,
       TabsModule.forRoot(),
       SharedModule,
index 5f4422c67492c50eb0bad89e505a290b1c6b8719..cc1b43c39d89237e8cb269768937ba8d8ca547bf 100644 (file)
@@ -1,4 +1,4 @@
-import { HttpClientModule } from '@angular/common/http';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { RouterTestingModule } from '@angular/router/testing';
 
@@ -17,7 +17,7 @@ describe('RgwDaemonListComponent', () => {
   configureTestBed({
     declarations: [RgwDaemonListComponent, RgwDaemonDetailsComponent],
     imports: [
-      HttpClientModule,
+      HttpClientTestingModule,
       TabsModule.forRoot(),
       PerformanceCounterModule,
       SharedModule,
index b2de9733fadc9c26d7f3b9bdc45c209b880d283b..825b69203633bd56c3d92749f1bbacbbf32ef32d 100644 (file)
@@ -1,4 +1,3 @@
-import { HttpClientModule } from '@angular/common/http';
 import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 
@@ -16,7 +15,7 @@ describe('RgwUserDetailsComponent', () => {
 
   configureTestBed({
     declarations: [RgwUserDetailsComponent],
-    imports: [HttpClientTestingModule, HttpClientModule, SharedModule, TabsModule.forRoot()],
+    imports: [HttpClientTestingModule, SharedModule, TabsModule.forRoot()],
     providers: [BsModalService]
   });
 
index 6202d5425bf88920081a54a9fca3718da86f8bfc..1b000f238e81ebda3b09a33d552bd8695e873251 100644 (file)
@@ -1,5 +1,4 @@
-import { HttpClientModule } from '@angular/common/http';
-
+import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { RouterTestingModule } from '@angular/router/testing';
 
@@ -19,7 +18,7 @@ describe('GrafanaComponent', () => {
 
   configureTestBed({
     declarations: [GrafanaComponent, InfoPanelComponent, LoadingPanelComponent],
-    imports: [AlertModule.forRoot(), HttpClientModule, RouterTestingModule],
+    imports: [AlertModule.forRoot(), HttpClientTestingModule, RouterTestingModule],
     providers: [CephReleaseNamePipe, SettingsService, SummaryService]
   });