From e98380ef12a873b13c23b43a7c688a117550c042 Mon Sep 17 00:00:00 2001 From: Rupinder Date: Wed, 4 Mar 2020 19:03:26 +0530 Subject: added test case for security component Written test case for security.component.spec.ts Issue-ID: PORTAL-834 Change-Id: I63049c26e5e2d7a86bce95c665d4422eef4f18d7 Signed-off-by: Rupinder --- .../Report/security/security.component.spec.ts | 48 +++++++++++++++++++++- 1 file changed, 47 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 5afbea4b..3c3efb92 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 @@ -30,10 +30,56 @@ describe('SecurityComponent', () => { }); it('should test ngOnInit method', () => { - component.reportType === "Dashboard"; + component.reportType = "Dashboard"; component.ngOnInit(); expect(component.showSpinner).toEqual(true); + expect(component.stepNo).toEqual('2'); + + component.reportType = "test"; + component.ngOnInit(); expect(component.stepNo).toEqual('6'); }); + it('should test addUserEditAccess method', () =>{ + let reportUserId = 'test'; + let index = 1; + component.userEditAccessArr[1] = true; + component.addUserEditAccess(reportUserId, index); + + component.userEditAccessArr[1] = false; + component.addUserEditAccess(reportUserId, index); + + }); + + it('should test addRoleEditAccess method', () =>{ + let reportUserId = 'test'; + let index = 1; + component.addRoleEditAccessArr[1] = true; + component.addRoleEditAccess(reportUserId, index); + + component.addRoleEditAccessArr[1] = false; + component.addRoleEditAccess(reportUserId, index); + + }); + + it("should test addReportUser method", () => { + component.addReportUser(); + }); + + it("should test removeReportUser method", () => { + component.removeReportUser("test"); + }); + + it("should test addReportRole method", () => { + component.addReportRole(); + }); + + it("should test removeReportRole method", () => { + component.removeReportRole("test"); + }); + + it("should test saveSecurityTabData method", () => { + component.saveSecurityTabData(); + }); + }); -- cgit 1.2.3-korg