From e56efae1acc86625b96569346a256e667ca42a3d Mon Sep 17 00:00:00 2001 From: Patrik Braun Date: Wed, 19 Jul 2017 08:00:51 +0200 Subject: [PATCH] fixing tests --- .../app/model/network/autehentication.service.spec.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/app/model/network/autehentication.service.spec.ts b/frontend/app/model/network/autehentication.service.spec.ts index b0a3bf61..588b66f3 100644 --- a/frontend/app/model/network/autehentication.service.spec.ts +++ b/frontend/app/model/network/autehentication.service.spec.ts @@ -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 { @@ -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, + ] }); });