diff options
author | Rupinder <rupinsi1@in.ibm.com> | 2020-01-27 16:20:53 +0530 |
---|---|---|
committer | Rupinder <rupinsi1@in.ibm.com> | 2020-01-27 16:22:18 +0530 |
commit | d8f02a6b767e54f86a37343321515688952f09dc (patch) | |
tree | 26e43bbccfb75972f13db998fc2bb2ab0fb9dfd1 | |
parent | f05e06512fa8b69afc5d75c3e5aa314460371abe (diff) |
Added test case for run-report component
Written test cases for run-report component and made some changes in
form-field component
Issue-ID: PORTAL-808
Change-Id: I41a01b76c325e04efa509e47d30716e5a7b4cb65
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
2 files changed, 31 insertions, 11 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.spec.ts index eeb76e26..f491f372 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.spec.ts @@ -3,11 +3,11 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { FormFieldsComponent } from './form-fields.component'; describe('FormFieldsComponent', () => { - let component: FormFieldsComponent; + let component: FormFieldsComponent; let fixture: ComponentFixture<FormFieldsComponent>; - + beforeEach(async(() => { - TestBed.configureTestingModule({ + TestBed.configureTestingModule({ declarations: [ FormFieldsComponent ] }) .compileComponents(); @@ -25,26 +25,26 @@ describe('FormFieldsComponent', () => { it('should test ngOnInit function', () => { component.ngOnInit(); - }) + }); it('should test isLast functions', () =>{ component.formFieldsListObj = [1,2,3,4,5]; let test: Boolean = component.isLast(3); expect(test).toEqual(false); - }) + }); it('should test isFirst function', () => { let test: Boolean = component.isFirst(0); expect(test).toEqual(true); - }) + }); it('should test ngDoCheck', () => { component.sqlAsDefaultValue = true; component.ngDoCheck(); expect(component.showDefaultSQLOption).toEqual(true); - }) - - it('should test close function', () => { + }); + + it('should test close function', () => { component.close(); expect(component.closable).toEqual(false); }); @@ -55,11 +55,12 @@ describe('FormFieldsComponent', () => { }); it('should test openDialog method', () => { - expect(component.openDialog()).toHaveBeenCalled; + expect(component.openDialog).toHaveBeenCalled(); }); it('should test openSnackBar method', () => { - expect(component.openSnackBar("Just", "for testing")).toHaveBeenCalled; + component.openSnackBar("Just", "for testing"); + expect(component.openSnackBar).toHaveBeenCalled(); }) }); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.spec.ts index f1d53d9e..8e77e7b6 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.spec.ts @@ -31,4 +31,23 @@ describe('RunReportFinalTableComponent', () => { it('should compile', () => { expect(component).toBeTruthy(); }); + + it('should test ngOnInit method ', () => { + component.ngOnInit(); + expect(component.initialProcesses()).toHaveBeenCalled(); + }); + + it('should test initialProcess method', () => { + component.DashboardReportObj.length = 1; + component.initialProcesses(); + expect(component.options.scrollSpeed).toEqual(20); + }); + + it('should test showError method', () => { + component.showError("abc"); + expect(component.error).toEqual(true); + expect(component.showSpinner).toEqual(false); + }) + + }); |