diff options
author | Lorraine Welch <lb2391@att.com> | 2020-02-26 19:27:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-02-26 19:27:51 +0000 |
commit | 37db40a2dc6e811e919b912579fbbb2b1d8cedba (patch) | |
tree | 44bf42ddd63fab084096f3551130db71b0e3e857 /ecomp-sdk | |
parent | 233d0688167439ec1ef9099b7acec8308489b8c0 (diff) | |
parent | e0aa2c99c9f9d472fe92edd7dfc3f6eac5768765 (diff) |
Merge changes from topic "indriku1_PORTAL-813"
* changes:
test cases written in form-fields service
test cases written for definition service
Diffstat (limited to 'ecomp-sdk')
2 files changed, 96 insertions, 6 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); + }); + }) + + }); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.service.spec.ts index 0452c246..acb7a952 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.service.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.service.spec.ts @@ -2,15 +2,79 @@ import { TestBed } from '@angular/core/testing'; import { FormFieldsService } from './form-fields.service'; import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { HttpClientModule } from '@angular/common/http'; +import { environment } from 'src/environments/environment'; describe('FormFieldsService', () => { - beforeEach(() => + let service:FormFieldsService; + beforeEach(() => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule] - })); + imports: [HttpClientTestingModule], + providers:[HttpClientModule,FormFieldsService] + }) + service=TestBed.get(FormFieldsService); +}); it('should be created', () => { const service: FormFieldsService = TestBed.get(FormFieldsService); expect(service).toBeTruthy(); }); + + it('should get getListOfFormFields', () => { + service.getListOfFormFields().subscribe((resp) => { + expect(resp).toBe(environment.baseUrl); + }); + }) + + it('should get getFormFieldData', () => { + let id:String; + service.getFormFieldData("id").subscribe((resp) => { + expect(resp).toBe(environment.baseUrl+id); + }); + }) + + it('should get postFormFieldData', () => { + let obj : any; + let reportId : string + service.postFormFieldData(obj,reportId).subscribe((resp) => { + expect(resp).toBe(environment.baseUrl); + }); + }) + + it('should get addFormFieldData', () => { + let obj : any; + let reportId : string + service.addFormFieldData(obj,reportId).subscribe((resp) => { + expect(resp).toBe(environment.baseUrl); + }); + }) + + it('should get deleteFormField', () => { + let id:String; + service.deleteFormField("id").subscribe((resp) => { + expect(resp).toBe(environment.baseUrl+id); + }); + }) + + it('should get verifySQL', () => { + let queryObj : any; + service.verifySQL(queryObj).subscribe((resp) => { + expect(resp).toBe(environment.baseUrl); + }); + }) + + it('should get getFormFieldGroupsData', () => { + let reportId : any; + service.getFormFieldGroupsData(reportId).subscribe((resp) => { + expect(resp).toBe(environment.baseUrl+reportId); + }); + }) + + it('should get postFormFieldGroupsData', () => { + let formFieldGroupObj : any; + service.postFormFieldGroupsData(formFieldGroupObj).subscribe((resp) => { + expect(resp).toBe(environment.baseUrl); + }); + }) + }); |