From 275f2f69553abcf91d9329184da8a254b9930e1f Mon Sep 17 00:00:00 2001 From: Rupinder Date: Thu, 27 Feb 2020 17:15:53 +0530 Subject: wrote test cases for security component Written test case for security.component.spec.ts Issue-ID: PORTAL-834 Change-Id: I9260825f17957e35ed1b34db1524abb67a325b58 Signed-off-by: Rupinder --- .../Report/security/security.component.spec.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp') diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.spec.ts index b7f186b9..5afbea4b 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.spec.ts @@ -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'); + }); + }); -- cgit 1.2.3-korg