1 import { TestBed } from '@angular/core/testing';
3 import { AdminsService } from './admins.service';
4 import { HttpClientTestingModule } from '@angular/common/http/testing';
6 describe('AdminsService', () => {
7 let service: AdminsService;
8 beforeEach(() => TestBed.configureTestingModule({
9 imports:[HttpClientTestingModule]
12 it('should be created', () => {
13 service = TestBed.get(AdminsService);
14 expect(service).toBeTruthy();
16 it('getAdminAppsRoles should return stubbed value', () => {
17 spyOn(service, 'getAdminAppsRoles').and.callThrough();
18 service.getAdminAppsRoles("test");
19 expect(service.getAdminAppsRoles).toHaveBeenCalledWith("test");
21 it('getRolesByApp should return stubbed value', () => {
22 spyOn(service, 'getRolesByApp').and.callThrough();
23 service.getRolesByApp("test");
24 expect(service.getRolesByApp).toHaveBeenCalledWith("test");
27 it('updateAdminAppsRoles should return stubbed value', () => {
28 spyOn(service, 'updateAdminAppsRoles').and.callThrough();
29 service.updateAdminAppsRoles("test");
30 expect(service.updateAdminAppsRoles).toHaveBeenCalledWith("test");
33 it('isComplexPassword should return stubbed value', () => {
34 spyOn(service, 'isComplexPassword').and.callThrough();
35 service.isComplexPassword("testpassword");
36 expect(service.isComplexPassword).toHaveBeenCalledWith("testpassword");
39 it('addNewUser should return stubbed value', () => {
40 spyOn(service, 'addNewUser').and.callThrough();
41 service.addNewUser("testuser","duplicatecheck");
42 expect(service.addNewUser).toHaveBeenCalledWith("testuser","duplicatecheck");