diff options
author | Rupinder <rupinsi1@in.ibm.com> | 2020-02-26 16:36:55 +0530 |
---|---|---|
committer | Rupinder <rupinsi1@in.ibm.com> | 2020-02-26 16:37:00 +0530 |
commit | 776423bd10d7c1e9325b1c1a1475f7b1f6cf4547 (patch) | |
tree | 572602b220126f29a980d55ba1ce608604830536 | |
parent | 90c70e89f3756599e9332d1112a044244315cd4a (diff) |
wrote test cases for run and log service classes
Written test cases for run and log servie classes
Issue-ID: PORTAL-834
Change-Id: I6843851b3bea32c9be495209a81dd310f630a7ad
Signed-off-by: Rupinder<rupinsi1@in.ibm.com>
2 files changed, 66 insertions, 4 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.service.spec.ts index d7b3b648..872a5de4 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.service.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.service.spec.ts @@ -2,15 +2,32 @@ import { TestBed } from '@angular/core/testing'; import { LogService } from './log.service'; import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { HttpClient } from '@angular/common/http'; +import { environment } from 'src/environments/environment'; describe('LogService', () => { + + let service: LogService + beforeEach(() => + { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule] - })); + imports: [HttpClientTestingModule], + providers: [LogService, HttpClient, HttpClientTestingModule] + }) + service = TestBed.get(LogService); + +}); it('should be created', () => { const service: LogService = TestBed.get(LogService); expect(service).toBeTruthy(); }); + + it('should getLogData', () => { + service.getLogData("test").subscribe((res) => { + expect(res).toBe(environment.baseUrl); + }); + }); + }); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.service.spec.ts index b50fc923..45bf2433 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.service.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.service.spec.ts @@ -2,15 +2,60 @@ import { TestBed } from '@angular/core/testing'; import { RunService } from './run.service'; import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { HttpClient } from '@angular/common/http'; +import { environment } from 'src/environments/environment'; describe('RunService', () => { + let service: RunService; + beforeEach(() => + { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule] - })); + imports: [HttpClientTestingModule], + providers: [HttpClient, HttpClientTestingModule, RunService] + }); + + service = TestBed.get(RunService); +}); it('should be created', () => { const service: RunService = TestBed.get(RunService); expect(service).toBeTruthy(); }); + + it('should getReportData', () => { + service.getReportData("test").subscribe((res) => { + expect(res).toBe(environment); + }); + }); + + it('should getReportDataWithFormFields', () => { + service.getReportDataWithFormFields("just", "testing").subscribe((res) => { + expect(res).toBe(environment); + }); + }); + + it('should getDefinitionPageDetails', () => { + service.getDefinitionPageDetails(1).subscribe((res) => { + expect(res).toBe(environment); + }); + }); + + it('should refreshFormFields', () => { + service.refreshFormFields("just", "testing").subscribe((res) => { + expect(res).toBe(environment); + }); + }); + + it('should getFormFieldGroupsData', () => { + service.getFormFieldGroupsData("test").subscribe((res) => { + expect(res).toBe(environment); + }); + }); + + it('should downloadReportExcel', () => { + service.downloadReportExcel("test").subscribe((res) => { + expect(res).toBe(new Blob); + }); + }); }); |