wrote test cases for security component 91/102491/1
authorRupinder <rupinsi1@in.ibm.com>
Thu, 27 Feb 2020 11:45:53 +0000 (17:15 +0530)
committerRupinder <rupinsi1@in.ibm.com>
Thu, 27 Feb 2020 11:45:57 +0000 (17:15 +0530)
Written test case for security.component.spec.ts

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

index b7f186b..5afbea4 100644 (file)
@@ -1,6 +1,10 @@
 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
 
 import { SecurityComponent } from './security.component';
+import { FormsModule } from '@angular/forms';
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { componentRefresh } from '@angular/core/src/render3/instructions';
 
 describe('SecurityComponent', () => {
   let component: SecurityComponent;
@@ -8,7 +12,9 @@ describe('SecurityComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ SecurityComponent ]
+      schemas: [CUSTOM_ELEMENTS_SCHEMA],
+      declarations: [ SecurityComponent ],
+      imports: [FormsModule, HttpClientTestingModule]
     })
     .compileComponents();
   }));
@@ -22,4 +28,12 @@ describe('SecurityComponent', () => {
   it('should create', () => {
     expect(component).toBeTruthy();
   });
+
+  it('should test ngOnInit method', () => {
+      component.reportType === "Dashboard";
+      component.ngOnInit();
+      expect(component.showSpinner).toEqual(true);
+      expect(component.stepNo).toEqual('6');
+  });
+
 });