From: Indrijeet kumar Date: Mon, 4 May 2020 08:50:31 +0000 (+0530) Subject: test cases in new-role-function component X-Git-Tag: 3.3.0~100^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F20%2F107020%2F3;p=portal%2Fsdk.git test cases in new-role-function component test cases in new-role-function component Issue-ID: PORTAL-813 Change-Id: Ifc3f985b2cfe99d2dc48308c1c4ae7791b54eeac Signed-off-by: Indrijeet Kumar --- diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts index 7ef63baf..32a69848 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts @@ -49,6 +49,8 @@ import { RouterTestingModule } from '@angular/router/testing'; import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component'; +import 'rxjs/add/observable/of'; + describe('NewRoleFunctionComponent', () => { let component: NewRoleFunctionComponent; @@ -73,7 +75,10 @@ describe('NewRoleFunctionComponent', () => { }) TestBed.overrideModule(BrowserDynamicTestingModule,{ set:{ - entryComponents:[ConfirmationModalComponent,InformationModalComponent] + entryComponents:[ + ConfirmationModalComponent, + InformationModalComponent + ] } }) .compileComponents(); @@ -90,6 +95,22 @@ describe('NewRoleFunctionComponent', () => { }); it('should test ngOnInit method',()=>{ + component.editRoleFunction={ + type: "type", + code: "code", + action: "action", + name: "name" + } + component.ngOnInit(); + }) + + it('should test else part of ngOnInit method',()=>{ + component.editRoleFunction={ + type: "menu", + code: "code", + action: "action", + name: "name" + } component.ngOnInit(); }) @@ -98,6 +119,7 @@ describe('NewRoleFunctionComponent', () => { }) it('should test openConfirmationModal method',()=>{ - component.openConfirmationModal("indrijeet","kumar") + component.openConfirmationModal("indrijeet","kumar"); }) + });