summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay
diff options
context:
space:
mode:
authorRupinder <rupinsi1@in.ibm.com>2020-03-04 19:03:26 +0530
committerRupinder <rupinsi1@in.ibm.com>2020-03-04 19:03:32 +0530
commite98380ef12a873b13c23b43a7c688a117550c042 (patch)
tree6aeac8c07672f80a3006d50d89a282fdab14afcf /ecomp-sdk/epsdk-app-overlay
parentd1cb62e4628dcc6a445b48de9f618e50e25475f4 (diff)
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<rupinsi1@in.ibm.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.spec.ts48
1 files changed, 47 insertions, 1 deletions
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();
+ });
+
});