From 2334284d4c8d4edfe91e5a2276c862eedb6a1ac6 Mon Sep 17 00:00:00 2001 From: Rupinder Date: Thu, 27 Feb 2020 11:27:30 +0530 Subject: 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 --- .../dashboard-report.service.spec.ts | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp') 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); + }); + }); + }); -- cgit 1.2.3-korg