summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.service.spec.ts
blob: f339dcac0bfdc2d54099372058cd1ed3c624b523 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import { TestBed } from '@angular/core/testing';

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

describe('SecurityService', () => {
  let service: SecurityService;

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

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

  it('should get reportOwnerList', () => {
        service.getReportOwnerList().subscribe((resp) => {
          expect(resp).toBe(environment.baseUrl + "report/wizard/security/retrieveReportOwner");
        });
  });

  it('should get getReportRoleList', () => {
    service.getReportRoleList().subscribe((resp) => {
      expect(resp).toBe(environment.baseUrl + "report/wizard/security/retrieveReportRoleList");
    });
});

it('should get getReportSecurityInfo', () => {
  service.getReportSecurityInfo().subscribe((resp) => {
    expect(resp).toBe(environment.baseUrl + "report/wizard/security/getReportSecurityInfo");
  });
});

it('should get getReportUserList', () => {
  service.getReportUserList().subscribe((resp) => {
    expect(resp).toBe(environment.baseUrl + "report/wizard/security/retrieveReportUserList");
  });
});

it('should get getReportSecurityRoles', () => {
  service.getReportSecurityRoles().subscribe((resp) => {
    expect(resp).toBe(environment.baseUrl + "report/wizard/security/getReportSecurityRoles");
  });
});

it('should get addReportUser', () => {
  let userId = "test"
  service.addReportUser(userId).subscribe((resp) => {
    expect(resp).toBe(environment.baseUrl + "report/security/addReportUser");
  });
});

it('should get removeReportUser', () => {
  let userId = "test"
  service.removeReportUser(userId).subscribe((resp) => {
    expect(resp).toBe(environment.baseUrl + "report/security/removeReportUser");
  });
});

it('should get addUserEditAccess', () => {
  let userId = "test"
  let readOnly = "dummy"
  service.addUserEditAccess(userId, readOnly).subscribe((resp) => {
    expect(resp).toBe(environment.baseUrl + "report/security/toggleUserEditAccess/");
  });
});

it('should get addReportRole', () => {
  let userId = "test"
  service.addReportRole(userId).subscribe((resp) => {
    expect(resp).toBe(environment.baseUrl + "report/security/addReportRole");
  });
});

it('should get removeReportRole', () => {
  let userId = "test"
  service.removeReportRole(userId).subscribe((resp) => {
    expect(resp).toBe(environment.baseUrl + "report/security/removeReportRole");
  });
});

it('should get addRoleEditAccess', () => {
  let userId = "test"
  let readOnly = "dummy"
  service.addRoleEditAccess(userId, readOnly).subscribe((resp) => {
    expect(resp).toBe(environment.baseUrl + "report/security/toggleRoleEditAccess/");
  });
});

it('should get saveSecurityTabInfo', () => {
  let test : any;
  service.saveSecurityTabInfo(test).subscribe((resp) => {
    expect(resp).toBe(environment.baseUrl + "report/security/updateReportSecurityInfo");
  });
});

});