acb7a952bf0b9da9bc6923fd5de9dbeecdbac993
[portal/sdk.git] /
1 import { TestBed } from '@angular/core/testing';
2
3 import { FormFieldsService } from './form-fields.service';
4 import { HttpClientTestingModule } from '@angular/common/http/testing';
5 import { HttpClientModule } from '@angular/common/http';
6 import { environment } from 'src/environments/environment';
7
8 describe('FormFieldsService', () => {
9   let service:FormFieldsService;
10   beforeEach(() => {
11    TestBed.configureTestingModule({
12     imports: [HttpClientTestingModule],
13     providers:[HttpClientModule,FormFieldsService]
14   })
15   service=TestBed.get(FormFieldsService);
16 });
17
18   it('should be created', () => {
19     const service: FormFieldsService = TestBed.get(FormFieldsService);
20     expect(service).toBeTruthy();
21   });
22
23   it('should get getListOfFormFields', () => {
24     service.getListOfFormFields().subscribe((resp) => {
25     expect(resp).toBe(environment.baseUrl);
26   });
27   })
28
29   it('should get getFormFieldData', () => {
30     let id:String;
31     service.getFormFieldData("id").subscribe((resp) => {
32     expect(resp).toBe(environment.baseUrl+id);
33   });
34   })
35
36   it('should get postFormFieldData', () => {
37     let obj : any;
38     let reportId : string
39     service.postFormFieldData(obj,reportId).subscribe((resp) => {
40     expect(resp).toBe(environment.baseUrl);
41   });
42   })
43
44   it('should get addFormFieldData', () => {
45     let obj : any;
46     let reportId : string
47     service.addFormFieldData(obj,reportId).subscribe((resp) => {
48     expect(resp).toBe(environment.baseUrl);
49   });
50   })
51
52   it('should get deleteFormField', () => {
53     let id:String;
54     service.deleteFormField("id").subscribe((resp) => {
55     expect(resp).toBe(environment.baseUrl+id);
56   });
57   })
58
59   it('should get verifySQL', () => {
60     let queryObj : any;
61     service.verifySQL(queryObj).subscribe((resp) => {
62     expect(resp).toBe(environment.baseUrl);
63   });
64   })
65
66   it('should get getFormFieldGroupsData', () => {
67     let reportId : any;
68     service.getFormFieldGroupsData(reportId).subscribe((resp) => {
69     expect(resp).toBe(environment.baseUrl+reportId);
70   });
71   })
72
73   it('should get postFormFieldGroupsData', () => {
74     let formFieldGroupObj : any;
75     service.postFormFieldGroupsData(formFieldGroupObj).subscribe((resp) => {
76     expect(resp).toBe(environment.baseUrl);
77   });
78   })
79   
80 });