summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.spec.ts
blob: 70e8ac4b2553cf8ab3ce2c2606d838ff6e03af82 (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
import { TestBed } from '@angular/core/testing';

import { ProfileService } from './profile.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { HttpClient } from '@angular/common/http';
import { environment } from 'src/environments/environment';

describe('ProfileService', () => {

  let service: ProfileService;

  beforeEach(() => {TestBed.configureTestingModule({
    imports: [HttpClientTestingModule],
    providers: [HttpClient, ProfileService]
  })  
  service = TestBed.get(ProfileService);
});

  it('should be created', () => {
    const service: ProfileService = TestBed.get(ProfileService);
    expect(service).toBeTruthy();
  });

  it('should get getUserPagination', () => {
     service.getUserPagination().subscribe((resp) => {
     expect(resp).toBe(environment.getUserPagination);
  });
  });

  it('should get getPostSearch', () => {
    let test : any;
    service.getPostSearch(test).subscribe((resp) => {
    expect(resp).toBe(environment.postSearch);
    });
 });

 it('should get importUser', () => {
  let test : any;
  service.importUser(test).subscribe((resp) => {
  expect(resp).toBe(environment.importSearch);
  });
});

it('should get getPostProfile', () => {
  service.getPostProfile().subscribe((resp) => {
  expect(resp).toBe(environment.getPostProfile);
  });
});

it('should get getSelfProfile', () => {
  service.getSelfProfile().subscribe((resp) => {
  expect(resp).toBe(environment.getSelfProfile);
  });
});

it('should get removeRole', () => {
  let data, id;
  service.removeRole(data, id).subscribe((resp) => {
  expect(resp).toBe(environment.removeUserRole);
  });
});

it('should get addUserRole', () => {
  let data, id;
  service.addUserRole(data, id).subscribe((resp) => {
  expect(resp).toBe(environment.addUserRole);
  });
});

it('should get toggleProfileActive', () => {
  let data, id;
  service.toggleProfileActive(id).subscribe((resp) => {
  expect(resp).toBe(environment);
  });
});

});