From: Rupinder Date: Thu, 27 Feb 2020 11:45:53 +0000 (+0530) Subject: wrote test cases for security component X-Git-Tag: 3.0.0~62^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=275f2f69553abcf91d9329184da8a254b9930e1f;p=portal%2Fsdk.git 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 --- 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'); + }); + });