diff options
author | Indrijeet kumar <indriku1@in.ibm.com> | 2020-04-28 21:49:25 +0530 |
---|---|---|
committer | Indrijeet kumar <indriku1@in.ibm.com> | 2020-04-28 21:49:33 +0530 |
commit | 154b5c21085784cdfd0643a731412a29a8825941 (patch) | |
tree | ba4fb7c57f4a9490bed0544fe4dc1a986f234bfb /ecomp-sdk/epsdk-app-overlay/src | |
parent | db6c63ebfcce75b364ac46fbf66d800aab2fa652 (diff) |
test cases in run-report-form-fields comp
test cases in run-report-form-fields component
Issue-ID: PORTAL-813
Change-Id: I8c05f030cb0b134405c05434fcbb7b143369fa6d
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src')
-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 |