Fixing default tests
This commit is contained in:
@ -1,12 +1,24 @@
|
|||||||
import {TestBed} from '@angular/core/testing';
|
import {TestBed} from '@angular/core/testing';
|
||||||
|
|
||||||
import {AuthenticationGuard} from './authentication.guard';
|
import {AuthenticationGuard} from './authentication.guard';
|
||||||
|
import {HttpClient} from "@angular/common/http";
|
||||||
|
import {NotificationModule} from "../notification/notification.module";
|
||||||
|
import {RouterTestingModule} from "@angular/router/testing";
|
||||||
|
|
||||||
describe('AuthenticationGuard', () => {
|
describe('AuthenticationGuard', () => {
|
||||||
let guard: AuthenticationGuard;
|
let guard: AuthenticationGuard;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
|
||||||
|
let httpClientSpy = jasmine.createSpyObj('HttpClient', ['']);
|
||||||
|
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
imports: [NotificationModule, RouterTestingModule.withRoutes([])],
|
||||||
|
providers: [
|
||||||
|
{provide: HttpClient, useValue: httpClientSpy}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
guard = TestBed.inject(AuthenticationGuard);
|
guard = TestBed.inject(AuthenticationGuard);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,18 @@
|
|||||||
import {TestBed} from '@angular/core/testing';
|
import {TestBed} from '@angular/core/testing';
|
||||||
|
|
||||||
import {AuthenticationService} from './authentication.service';
|
import {AuthenticationService} from './authentication.service';
|
||||||
|
import {HttpClient} from "@angular/common/http";
|
||||||
|
|
||||||
describe('AuthenticationService', () => {
|
describe('AuthenticationService', () => {
|
||||||
let service: AuthenticationService;
|
let service: AuthenticationService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
|
||||||
|
let httpClientSpy = jasmine.createSpyObj('HttpClient', ['']);
|
||||||
|
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
providers: [{provide: HttpClient, useValue: httpClientSpy}]
|
||||||
|
});
|
||||||
service = TestBed.inject(AuthenticationService);
|
service = TestBed.inject(AuthenticationService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,17 @@
|
|||||||
import {TestBed} from '@angular/core/testing';
|
import {TestBed} from '@angular/core/testing';
|
||||||
|
|
||||||
import {UserService} from './user.service';
|
import {UserService} from './user.service';
|
||||||
|
import {HttpClient} from "@angular/common/http";
|
||||||
|
|
||||||
describe('UserService', () => {
|
describe('UserService', () => {
|
||||||
let service: UserService;
|
let service: UserService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
let httpClientSpy = jasmine.createSpyObj('HttpClient', ['']);
|
||||||
|
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
providers: [{provide: HttpClient, useValue: httpClientSpy}]
|
||||||
|
});
|
||||||
service = TestBed.inject(UserService);
|
service = TestBed.inject(UserService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user