mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 14:33:03 +00:00
71764: Test fixes
This commit is contained in:
@@ -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
|
||||
],
|
||||
|
Reference in New Issue
Block a user