summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/report-run/run/run.service.spec.ts
blob: a5c7fe4be638106e27cec171746cf2106429a7e9 (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
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],
    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);
      });
    });
});