summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.ts33
1 files changed, 33 insertions, 0 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 509aa82e..a41b11cd 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
@@ -12,6 +12,7 @@ import { RouterTestingModule } from '@angular/router/testing';
import { RunService } from '../run.service';
import 'rxjs/add/observable/empty';
import 'rxjs/add/observable/of';
+import { Observable } from 'rxjs';
describe('RunReportComponent', () => {
let component: RunReportComponent;
@@ -25,6 +26,12 @@ describe('RunReportComponent', () => {
let dashboard;
let dashboard2;
let responseformfield = 1;
+ let environment = [
+ {
+ baseUrl: 'just a link'
+ }
+ ]
+
beforeEach(async(() => {
TestBed.configureTestingModule({
@@ -42,6 +49,9 @@ 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(() => {
@@ -125,7 +135,9 @@ describe('RunReportComponent', () => {
});
it('should test downloadReportExcel method', () => {
+ spyOn(component, 'downloadReportExcel').and.callThrough();
component.downloadReportExcel();
+ expect(component.downloadReportExcel).toHaveBeenCalled();
});
it('should test applyFilter method', () => {
@@ -150,5 +162,26 @@ describe('RunReportComponent', () => {
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', () => {
+ // 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);
+ // })
});