diff options
author | Indrijeet kumar <indriku1@in.ibm.com> | 2020-02-26 21:05:32 +0530 |
---|---|---|
committer | Indrijeet kumar <indriku1@in.ibm.com> | 2020-02-26 21:13:52 +0530 |
commit | 641924cd98ce4867be665a014a76a5652f097ab3 (patch) | |
tree | bc301359b3a609ebe0ee7c1d53e0b147b84e3fe5 | |
parent | b409726e58fd9a0232b713e0ca44d098454d35ea (diff) |
test cases written for definition service
test cases written for definition service
Issue-ID: PORTAL-813
Change-Id: I1a51f3c9164fc803f9327f010d1b1beeadb2b438
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
-rw-r--r-- | ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.service.spec.ts | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.service.spec.ts index 1c56d381..74dc8b5e 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.service.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.service.spec.ts @@ -2,15 +2,41 @@ import { TestBed } from '@angular/core/testing'; import { DefinitionService } from './definition.service'; import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { HttpClientModule } from '@angular/common/http'; +import { environment } from 'src/environments/environment'; describe('DefinitionServiceService', () => { - beforeEach(() => + +let service:DefinitionService; + + beforeEach(() =>{ TestBed.configureTestingModule({ - imports: [HttpClientTestingModule] - })); + imports: [HttpClientTestingModule], + providers:[HttpClientModule,DefinitionService] + }) + service=TestBed.get(DefinitionService); +}); it('should be created', () => { const service: DefinitionService = TestBed.get(DefinitionService); expect(service).toBeTruthy(); }); + + it('should get getDefinitionPageDetails', () => { + let IncomingReportId : number; + let reportMode: string; + service.getDefinitionPageDetails(IncomingReportId,reportMode).subscribe((resp) => { + expect(resp).toBe(environment.baseUrl+IncomingReportId); + }); + }) + + it('should get portDefinitionPageDetails', () => { + let IncomingReportId: number; + let finalPostObj : any; + service.portDefinitionPageDetails(IncomingReportId,finalPostObj).subscribe((resp) => { + expect(resp).toBe(environment.baseUrl+IncomingReportId); + }); + }) + + }); |