diff options
author | Rupinder <rupinsi1@in.ibm.com> | 2020-02-27 11:27:30 +0530 |
---|---|---|
committer | Rupinder <rupinsi1@in.ibm.com> | 2020-02-27 11:27:38 +0530 |
commit | 2334284d4c8d4edfe91e5a2276c862eedb6a1ac6 (patch) | |
tree | 39a6ee81dba194e3df6f97d5c81b2d83f4ea443e /ecomp-sdk/epsdk-app-overlay | |
parent | 776423bd10d7c1e9325b1c1a1475f7b1f6cf4547 (diff) |
wrote test cases for dashboard-report.service.spec.ts
Written test case for dashboard-report service class
Issue-ID: PORTAL-834
Change-Id: I7639cb2ec401beda4d035bb479d141aaa1f30f1e
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
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/run-dashboard-report/dashboard-report.service.spec.ts | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/dashboard-report.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/dashboard-report.service.spec.ts index 5c6fc2cb..1c96f7ed 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/dashboard-report.service.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/dashboard-report.service.spec.ts @@ -1,12 +1,37 @@ import { TestBed } from '@angular/core/testing'; import { DashboardReportService } from './dashboard-report.service'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { HttpClient } from '@angular/common/http'; +import { environment } from 'src/environments/environment'; describe('DashboardReportService', () => { - beforeEach(() => TestBed.configureTestingModule({})); + + let service: DashboardReportService; + + beforeEach(() => {TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [HttpClient, HttpClientTestingModule, DashboardReportService] + }); + service = TestBed.get(DashboardReportService); + +}); it('should be created', () => { const service: DashboardReportService = TestBed.get(DashboardReportService); expect(service).toBeTruthy(); }); + + it('should getReportData', () => { + service.getReportData("test").subscribe((res) => { + expect(res).toBe(environment); + }); + }); + + it('should getReportDataWithFormFields', () => { + service.getReportDataWithFormFields("just", "test").subscribe((res) => { + expect(res).toBe(environment); + }); + }); + }); |