45bf243333ef4af71264412136229da4d836fad7
[portal/sdk.git] /
1 import { TestBed } from '@angular/core/testing';
2
3 import { RunService } from './run.service';
4 import { HttpClientTestingModule } from '@angular/common/http/testing';
5 import { HttpClient } from '@angular/common/http';
6 import { environment } from 'src/environments/environment';
7
8 describe('RunService', () => {
9   let service: RunService;
10
11   beforeEach(() => 
12   {
13   TestBed.configureTestingModule({
14     imports: [HttpClientTestingModule],
15     providers: [HttpClient, HttpClientTestingModule, RunService]
16   });
17   
18     service = TestBed.get(RunService);
19 });
20
21   it('should be created', () => {
22     const service: RunService = TestBed.get(RunService);
23     expect(service).toBeTruthy();
24   });
25
26     it('should getReportData', () => {
27         service.getReportData("test").subscribe((res) => {
28             expect(res).toBe(environment);
29         });
30     });
31
32     it('should getReportDataWithFormFields', () => {
33       service.getReportDataWithFormFields("just", "testing").subscribe((res) => {
34           expect(res).toBe(environment);
35       });
36     });
37
38     it('should getDefinitionPageDetails', () => {
39       service.getDefinitionPageDetails(1).subscribe((res) => {
40           expect(res).toBe(environment);
41       });
42     });
43
44     it('should refreshFormFields', () => {
45       service.refreshFormFields("just", "testing").subscribe((res) => {
46           expect(res).toBe(environment);
47       });
48     });
49
50     it('should getFormFieldGroupsData', () => {
51       service.getFormFieldGroupsData("test").subscribe((res) => {
52           expect(res).toBe(environment);
53       });
54     });
55
56     it('should downloadReportExcel', () => {
57       service.downloadReportExcel("test").subscribe((res) => {
58           expect(res).toBe(new Blob);
59       });
60     });
61 });