summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.service.spec.ts
blob: acb7a952bf0b9da9bc6923fd5de9dbeecdbac993 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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', () => {
  let service:FormFieldsService;
  beforeEach(() => {
   TestBed.configureTestingModule({
    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);
  });
  })
  
});