1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-14 11:23:17 +02:00

fixing tests

This commit is contained in:
Patrik Braun 2017-07-19 08:00:51 +02:00
parent 663f4edc39
commit e56efae1ac

View File

@ -4,6 +4,8 @@ import {UserDTO} from "../../../../common/entities/UserDTO";
import "rxjs/Rx";
import {LoginCredential} from "../../../../common/entities/LoginCredential";
import {AuthenticationService} from "./authentication.service";
import {NetworkService} from "./network.service";
import {ErrorDTO} from "../../../../common/entities/Error";
class MockUserService {
public login(credential: LoginCredential): Promise<UserDTO> {
@ -15,12 +17,19 @@ class MockUserService {
}
}
class MockNetworkService {
addGlobalErrorHandler(fn: (error: ErrorDTO) => boolean) {
}
}
describe('AuthenticationService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
{provide: NetworkService, useClass: MockNetworkService},
{provide: UserService, useClass: MockUserService},
AuthenticationService]
AuthenticationService,
]
});
});