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>;
it('should test ngOnInit method', () => {
component.reportType = "Dashboard";
component.ngOnInit();
- // expect(component.showSpinner).toEqual(true);
expect(component.stepNo).toEqual('2');
component.reportType = "test";
});
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();