diff options
author | 2020-04-29 01:41:56 +0530 | |
---|---|---|
committer | 2020-05-03 02:22:11 +0000 | |
commit | 1cd9dcf3786f8545982a49d97be435842696eb76 (patch) | |
tree | 87440064535dd25517fd32e63e9fdfc1be5c5b39 /ecomp-sdk/epsdk-app-overlay/src/main | |
parent | db6c63ebfcce75b364ac46fbf66d800aab2fa652 (diff) |
test cases in security component
test cases in security component
Issue-ID: PORTAL-813
Change-Id: I629949ffa5e9a3e7b5330d52fb3c752acb6a919f
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main')
-rw-r--r-- | ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.spec.ts | 13 |
1 files changed, 10 insertions, 3 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 417b3a18..44a7ef1f 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 @@ -4,11 +4,11 @@ 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'; import { SecurityService } from './security.service'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/observable/of'; + describe('SecurityComponent', () => { let component: SecurityComponent; let fixture: ComponentFixture<SecurityComponent>; @@ -56,7 +56,6 @@ describe('SecurityComponent', () => { it('should test ngOnInit method', () => { component.reportType = "Dashboard"; component.ngOnInit(); - // expect(component.showSpinner).toEqual(true); expect(component.stepNo).toEqual('2'); component.reportType = "test"; @@ -91,24 +90,32 @@ describe('SecurityComponent', () => { }); it("should test addReportUser method", () => { + component.reportUser="ind"; + component.reportOwnerList=[{"name":"ind"}]; spyOn(component, 'addReportUser').and.callThrough(); component.addReportUser(); expect(component.addReportUser).toHaveBeenCalled(); }); it("should test removeReportUser method", () => { - component.removeReportUser("test"); + component.reportOwnerList=[{"name":"reportUserName"}]; + component.removeReportUser("reportUserName"); }); it("should test addReportRole method", () => { + component.reportRole="reportRole"; + component.reportRoleList=[{"name":"reportRole"}]; component.addReportRole(); }); it("should test removeReportRole method", () => { + component.reportSecurityRoles=[{"id":"roleId"}]; component.removeReportRole("test"); }); it("should test saveSecurityTabData method", () => { + component.reportOwner="reportOwner"; + component.reportOwnerList=[{"name":"reportOwner"}]; spyOn(component, 'saveSecurityTabData').and.callThrough(); component.saveSecurityTabData(); expect(component.saveSecurityTabData).toHaveBeenCalled(); |