diff options
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/run/run-report-form-fields/run-report-form-fields.component.spec.ts | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.spec.ts index a1906c85..54df7d82 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.spec.ts @@ -19,7 +19,9 @@ describe('RunReportFormFieldsComponent', () => { { baseUrl: 'just for testing' } - ] + ]; + var responseFormFieldGroups={"formFieldGroupsJSON":'{"Indrijeet":"kumar"}'}; + var respObj={"formFieldList":{"value1":"value1"}}; beforeEach(async(() => { TestBed.configureTestingModule({ @@ -30,12 +32,9 @@ describe('RunReportFormFieldsComponent', () => { }) .compileComponents(); runService = TestBed.get(RunService); - // spyOn(runService, 'getReportData').and.returnValue(Observable.of(environment)); - // spyOn(runService, 'getReportDataWithFormFields').and.returnValue(Observable.of(environment)); spyOn(runService, 'getDefinitionPageDetails').and.returnValue(Observable.of(environment)); spyOn(runService, 'refreshFormFields').and.returnValue(Observable.of(environment)); - // spyOn(runService, 'downloadReportExcel').and.returnValue(Observable.of(environment)); - spyOn(runService, 'getFormFieldGroupsData').and.returnValue(Observable.of(environment)); + })); beforeEach(() => { @@ -127,11 +126,10 @@ describe('RunReportFormFieldsComponent', () => { expect(component.ngOnInit).toHaveBeenCalled(); }); -// it('should test fetchAndPopulateFormFields method', () => { -// spyOn(component, 'fetchAndPopulateFormFields').and.callThrough(); -// component.formFieldGroupObjList = null; -// component.fetchAndPopulateFormFields(1, "test"); -// expect(component.fetchAndPopulateFormFields).toHaveBeenCalled(); -// }); + it('should test fetchAndPopulateFormFields method', () => { + component.formFieldGroupObjList=[{"formFieldList":"formFieldList"}] + spyOn(runService, 'getFormFieldGroupsData').and.returnValue(Observable.of(responseFormFieldGroups)); + component.fetchAndPopulateFormFields(respObj,"value2"); + }); });
\ No newline at end of file |