mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
fixing tests
This commit is contained in:
parent
663f4edc39
commit
e56efae1ac
@ -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,
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user