1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-25 02:04:15 +02:00

fixing tests

This commit is contained in:
Patrik J. Braun 2019-02-15 13:11:44 -05:00
parent 2017fc642c
commit 00dfcc399d
3 changed files with 7 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import {LoginCredential} from '../../../../common/entities/LoginCredential';
import {AuthenticationService} from './authentication.service';
import {NetworkService} from './network.service';
import {ErrorDTO} from '../../../../common/entities/Error';
import {VersionService} from '../version.service';
class MockUserService {
public login(credential: LoginCredential): Promise<UserDTO> {
@ -25,6 +26,7 @@ describe('AuthenticationService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
VersionService,
{provide: NetworkService, useClass: MockNetworkService},
{provide: UserService, useClass: MockUserService},
AuthenticationService,

View File

@ -3,6 +3,7 @@ import {HttpClientTestingModule, HttpTestingController} from '@angular/common/ht
import {NetworkService} from './network.service';
import {Message} from '../../../../common/entities/Message';
import {SlimLoadingBarService} from 'ng2-slim-loading-bar';
import {VersionService} from '../version.service';
describe('NetworkService Success tests', () => {
@ -18,6 +19,7 @@ describe('NetworkService Success tests', () => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
providers: [
VersionService,
SlimLoadingBarService,
NetworkService
]
@ -130,6 +132,7 @@ describe('NetworkService Fail tests', () => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
providers: [
VersionService,
SlimLoadingBarService,
NetworkService
]

View File

@ -5,6 +5,7 @@ import {UserService} from './user.service';
import {LoginCredential} from '../../../../common/entities/LoginCredential';
import {SlimLoadingBarService} from 'ng2-slim-loading-bar';
import {ShareService} from '../../gallery/share.service';
import {VersionService} from '../version.service';
class MockShareService {
wait() {
@ -23,6 +24,7 @@ describe('UserService', () => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
providers: [
VersionService,
UserService,
SlimLoadingBarService,
NetworkService,