71764: Test fixes

This commit is contained in:
Kristof De Langhe
2020-07-10 14:18:01 +02:00
parent 7787a2d0e9
commit 7f6bd680b2
3 changed files with 23 additions and 3 deletions

View File

@@ -18,6 +18,8 @@ import { NativeWindowService } from '../../core/services/window.service';
import { provideMockStore } from '@ngrx/store/testing';
import { createTestComponent } from '../testing/utils.test';
import { RouterTestingModule } from '@angular/router/testing';
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
import { of } from 'rxjs/internal/observable/of';
describe('LogInComponent', () => {
@@ -34,7 +36,13 @@ describe('LogInComponent', () => {
}
};
let authorizationService: AuthorizationDataService;
beforeEach(async(() => {
authorizationService = jasmine.createSpyObj('authorizationService', {
isAuthorized: of(true)
});
// refine the test module by declaring the test component
TestBed.configureTestingModule({
imports: [
@@ -58,6 +66,7 @@ describe('LogInComponent', () => {
{ provide: NativeWindowService, useFactory: NativeWindowMockFactory },
// { provide: Router, useValue: new RouterStub() },
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
{ provide: AuthorizationDataService, useValue: authorizationService },
provideMockStore({ initialState }),
LogInComponent
],