diff options
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.spec.ts')
-rw-r--r-- | ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.spec.ts | 52 |
1 files changed, 25 insertions, 27 deletions
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 2aeac4a2..da718262 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 @@ -2,10 +2,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { MatPaginatorModule } from '@angular/material/paginator'; import { MatSortModule } from '@angular/material/sort'; -import { MatTableModule} from '@angular/material/table'; +import { MatTableModule, MatTableDataSource } from '@angular/material/table'; -import { RunReportComponent} from './run-report.component'; -import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, SimpleChanges } from '@angular/core'; +import { RunReportComponent, PeriodicElement } from './run-report.component'; +import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, SimpleChange, SimpleChanges } from '@angular/core'; import { MatMenuModule } from '@angular/material'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { RouterTestingModule } from '@angular/router/testing'; @@ -24,12 +24,13 @@ describe('RunReportComponent', () => { let runService : RunService; let options1 = {}; let dashboard; + let dashboard2; let responseformfield = 1; let environment = [ { baseUrl: 'just a link' } - ]; + ] beforeEach(async(() => { @@ -48,10 +49,13 @@ describe('RunReportComponent', () => { providers: [RunService] }).compileComponents(); runService = TestBed.get(RunService); + //spyOn(runService, 'getReportDataWithFormFields').and.returnValue(Observable.of(environment)); + //spyOn(runService, 'getReportData').and.returnValue(Observable.of(environment)); spyOn(runService, 'downloadReportExcel').and.returnValue(Observable.of(environment)); })); beforeEach(() => { + //dashboard = {"item":{"hasContent":{"name":"rupi","id":"check#check"}}}; fixture = TestBed.createComponent(RunReportComponent); runService = TestBed.get(RunService); component = fixture.componentInstance; @@ -61,7 +65,7 @@ describe('RunReportComponent', () => { component.options = options1; component.dashboard = dashboard; component.responseFormFieldListLength = responseformfield; - fixture.detectChanges(); + //fixture.detectChanges(); }); it('should compile', () => { @@ -103,7 +107,6 @@ describe('RunReportComponent', () => { expect(component.NEWdisplayedColumns).toEqual(new Array()); }); - it('should test showError method', () => { let errmsg = "errormessage"; let stcktrace = "stacktrace"; @@ -131,11 +134,6 @@ describe('RunReportComponent', () => { expect(component.openOptionsFlag).toEqual(component.openOptionsFlag); }); - it('should test downloadReportExcel method', () => { - spyOn(component, 'downloadReportExcel').and.callThrough(); - component.downloadReportExcel(); - expect(component.downloadReportExcel).toHaveBeenCalled(); - }); it('should test applyFilter method', () => { let filterValue = "test" @@ -145,40 +143,40 @@ describe('RunReportComponent', () => { it('should test the ngOnChanges first If condition', () => { change = {}; - component.queryString="queryString"; - component.reportId1="reportId1"; - var response={"errormessage":true} component.reportMode !== "Regular" component.initCnt = 1; component.TriggerFFArr.length = 0; - let spy=spyOn(runService,'getReportDataWithFormFields').and.returnValue(Observable.of(response)); component.ngOnChanges(change); - expect(spy).toHaveBeenCalled(); + expect(component.showMoreVert).toEqual(false); expect(component.initCnt).toEqual(1); expect(component.showDashboardReport).toEqual(false); expect(component.displayedRowObj).toEqual(new Array()); expect(component.displayedColumns).toEqual(new Array()); expect(component.formFieldList).toEqual(new Array()); + expect(component.showSpinner).toEqual(true); expect(component.NEWdisplayedColumns).toEqual(new Array()); expect(component.isReady).toEqual(false); - }); - it('should test initialProcess method', () => { component.DashboardReportObj.length = 1; component.initialProcesses(); }); - // it('should test postFetchingReportDataFn method',()=>{ - // var response={ - // "reportName":"reportName", - // "reportDataColumns":[{"columnTitle":"columnTitle","colId":"colId"}], - // "reportDataRows":[{"value":"value"}] - // } - // component.displayedColumnsArr=["string"] - // component.postFetchingReportDataFn(response) + // it('should test postFetchingReportDataFn method', () => { + // let response: any; + // component.postFetchingReportDataFn(response); // }) - + // it('should test ngOnChanges subscribe method', () => { + // spyOn(component, 'ngOnChanges').and.callThrough(); + // component.ngOnChanges(change); + // expect(component.ngOnChanges).toHaveBeenCalled(); + // }) + + // it('should test postFetchingReportDataFn method', () => { + // let obj: any; + // component.postFetchingReportDataFn(obj); + // }) + }); |