expect(component).toBeTruthy();
});
- it('testing if condition in ngOnInit method',()=>{
- component.cookieService.set('show_app_header','false');
- component.ngOnInit();
- expect(component.showHeader).toBe(false)
- })
-
describe('should test ngOnInit',()=>{
it('should validate on ngOnInit',()=>{
let spy=spyOn(headerService, 'getTopMenuItems').and.returnValue(Observable.of('you object'));
expect(component).toBeTruthy();
});
- it('testing if condition in ngOnInit method',()=>{
- component.cookieService.set('show_app_header','false');
- component.ngOnInit();
- expect(component.showHeader).toBe(false)
- })
-
-
describe('should test ngOnInit',()=>{
it('should validate on ngOnInit',()=>{
let spy=spyOn(sidebarService,'getLeftMenu').and.returnValue(Observable.of(stubData1));
expect(component).toBeTruthy();
});
- it('testing if condition in ngOnInit method',()=>{
- component.cookieService.set('show_app_header','false');
- component.ngOnInit();
- expect(component.showHeader).toBe(false)
- })
-
it('should test receiveCollapsed method',()=>{
component.receiveCollapsed(true);
expect(component.collapedSideBar).toBe(true);
expect(component).toBeTruthy();
});
- // it('should test getTotalRowCount method',()=>{
- // component.getTotalRowCount();
- // })
-
it('should test updateStatus method',()=>{
component['updateStatus']('N');
})
expect(spy).toHaveBeenCalled();
})
- it('should test getRole method',()=>{
- component.getRole("value");
- })
-
it('should test delRoleConfirmPopUp method',()=>{
component.delRoleConfirmPopUp('dummyargument');
imports: [HttpClientTestingModule]
}));
- // httpClient=TestBed.get(HttpClient);
- // httpTestingController=TestBed.get(httpTestingController);
-
it('should be created', () => {
const service: ColumnService = TestBed.get(ColumnService);
expect(service).toBeTruthy();
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LogComponent ],
- imports: [HttpClientTestingModule],
- // providers:[LogService,MockBackend,BaseRequestOptions,{
- // porvide:Http,useFactory:(backend:MockBackend,defaultOptions:BaseRequestOptions)=>{
- // return new Http(backend,defaultOptions);
- // },
- // deps:[MockBackend,BaseRequestOptions],
- // }]
+ imports: [HttpClientTestingModule]
})
.compileComponents();
}));