summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk
diff options
context:
space:
mode:
authorLorraine Welch <lb2391@att.com>2020-04-01 16:31:24 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-01 16:31:24 +0000
commitc6305069b5eb8bca8f947470bfaae9033b8f20eb (patch)
tree0e9bf73063e371429dbafc96c5823619cc8f4529 /ecomp-sdk
parent6e6d76601a5f0298829b1fafa8d3d497f7327fad (diff)
parent0bf60d188f3db03b99ecca0a4946df136c48f3b7 (diff)
Merge "wrote test case for run-report comp"
Diffstat (limited to 'ecomp-sdk')
-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);
+ // })
});