added test case for run component 95/102495/1
authorRupinder <rupinsi1@in.ibm.com>
Thu, 27 Feb 2020 12:46:38 +0000 (18:16 +0530)
committerRupinder <rupinsi1@in.ibm.com>
Thu, 27 Feb 2020 12:46:44 +0000 (18:16 +0530)
Wrote test case for run.component.spec.ts

Issue-ID: PORTAL-834
Change-Id: Ic2fe3cbf996c34c9fd5bbb22bcf6187cf311d092
Signed-off-by: Rupinder<rupinsi1@in.ibm.com>
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.component.spec.ts

index e9439dd..82eda85 100644 (file)
@@ -1,6 +1,8 @@
 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
 
 import { RunComponent } from './run.component';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { RouterTestingModule } from '@angular/router/testing';
 
 describe('RunComponent', () => {
   let component: RunComponent;
@@ -8,7 +10,8 @@ describe('RunComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ RunComponent ]
+      declarations: [ RunComponent ],
+      imports: [HttpClientTestingModule, RouterTestingModule]
     })
     .compileComponents();
   }));
@@ -22,4 +25,11 @@ describe('RunComponent', () => {
   it('should create', () => {
     expect(component).toBeTruthy();
   });
+
+  it('should test ngOnInit method', () => {
+    component.ngOnInit();
+    component.reportType !== "Dashboard";
+    expect(component.stepNo).toEqual("8");
+  });
+
 });