diff options
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay')
-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 | 63 |
1 files changed, 58 insertions, 5 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 d693ebc0..c922b359 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 @@ -9,6 +9,7 @@ import { RouterTestingModule } from '@angular/router/testing'; describe('RunReportFormFieldsComponent', () => { let component: RunReportFormFieldsComponent; let fixture: ComponentFixture<RunReportFormFieldsComponent>; + let formfield =[{"validationType":1},{},{}] ; beforeEach(async(() => { TestBed.configureTestingModule({ @@ -22,6 +23,7 @@ describe('RunReportFormFieldsComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(RunReportFormFieldsComponent); component = fixture.componentInstance; + component.formFieldList = formfield; fixture.detectChanges(); }); @@ -31,15 +33,20 @@ describe('RunReportFormFieldsComponent', () => { it('should test ngOnInit method', () => { component.ngOnInit(); - expect(component.showSpinner).toEqual(true); - expect(component.navigateToRun).toEqual(false); + // expect(component.showSpinner).toEqual(true); + // expect(component.navigateToRun).toEqual(false); }); - it('should test getQueryString method', () => { - component.directCallQueryParams !== ''; + it('should test convertDate method', () => { + component.convertDate("test"); + }); + + it('should test getQueryString methods', () => { + component.directCallQueryParams = 'abc'; component.getQueryString(); expect(component.getQueryString()).toEqual(component.directCallQueryParams); - component.directCallQueryParams == ''; + + component.directCallQueryParams = ""; component.getQueryString(); expect(component.getQueryString()).toEqual(component.queryString); }); @@ -57,4 +64,50 @@ describe('RunReportFormFieldsComponent', () => { expect(component.showLabel).toEqual(component.showLabel); }); + it('should test editReport method', () => { + component.editReport("test"); + }); + + it('should test runReport method', () => { + component.iSDashboardReport = "test"; + component.formFieldList.length = 1; + component.runReport(); + + expect(component.hitCnt).toBe(component.hitCnt++); + expect(component.reportMode).toBe("FormField"); + let spy = spyOn(component, 'generateQueryString'); + component.generateQueryString(); + expect(component.generateQueryString).toHaveBeenCalled(); + expect(component.showSpinner).toBe(false); + + component.iSDashboardReport = "test"; + component.formFieldList.length = 0; + component.runReport(); + + expect(component.reportMode).toBe("Regular"); + + component.iSDashboardReport = "Dashboard"; + component.runReport(); + expect(component.showSpinner).toBe(false); + expect(component.navigateToRun).toBe(true); + + + }); + + it('should test ngDoCheck method', () =>{ + component.formFieldList != undefined; + component.oldGroupSelectValue = "test"; + component.groupSelectValue = "testing"; + component.ngDoCheck(); + + expect(component.oldGroupSelectValue).toBe(component.groupSelectValue); + }); + + it('should test fetchAndPopulateFormFields method', () => { + component.fetchAndPopulateFormFields(1, "test"); + }) + + it('should test generateQueryString method',() => { + component.generateQueryString(); + }) });
\ No newline at end of file |