added test case for security component 91/102991/1
authorRupinder <rupinsi1@in.ibm.com>
Wed, 4 Mar 2020 13:33:26 +0000 (19:03 +0530)
committerRupinder <rupinsi1@in.ibm.com>
Wed, 4 Mar 2020 13:33:32 +0000 (19:03 +0530)
Written test case for security.component.spec.ts

Issue-ID: PORTAL-834
Change-Id: I63049c26e5e2d7a86bce95c665d4422eef4f18d7
Signed-off-by: Rupinder<rupinsi1@in.ibm.com>
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.spec.ts

index 5afbea4..3c3efb9 100644 (file)
@@ -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();
+  });
+
 });