71429: Test fixes

This commit is contained in:
Kristof De Langhe
2020-06-24 16:08:10 +02:00
parent 080ddf8a1f
commit 882ff3ea18
3 changed files with 4 additions and 5 deletions

View File

@@ -114,7 +114,7 @@ describe('EPersonFormComponent', () => {
translateService = getMockTranslateService(); translateService = getMockTranslateService();
authService = new AuthServiceStub(); authService = new AuthServiceStub();
authorizationService = jasmine.createSpyObj('authorizationService', { authorizationService = jasmine.createSpyObj('authorizationService', {
isAuthenticated: observableOf(true) isAuthorized: observableOf(true)
}); });
groupsDataService = jasmine.createSpyObj('groupsDataService', { groupsDataService = jasmine.createSpyObj('groupsDataService', {
findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),

View File

@@ -9,7 +9,6 @@ import { CSSVariableService } from '../../shared/sass-helper/sass-helper.service
import { CSSVariableServiceStub } from '../../shared/testing/css-variable-service.stub'; import { CSSVariableServiceStub } from '../../shared/testing/css-variable-service.stub';
import { AuthServiceStub } from '../../shared/testing/auth-service.stub'; import { AuthServiceStub } from '../../shared/testing/auth-service.stub';
import { AuthService } from '../../core/auth/auth.service'; import { AuthService } from '../../core/auth/auth.service';
import { of as observableOf } from 'rxjs'; import { of as observableOf } from 'rxjs';
import { By } from '@angular/platform-browser'; import { By } from '@angular/platform-browser';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
@@ -25,7 +24,7 @@ describe('AdminSidebarComponent', () => {
beforeEach(async(() => { beforeEach(async(() => {
authorizationService = jasmine.createSpyObj('authorizationService', { authorizationService = jasmine.createSpyObj('authorizationService', {
isAuthenticated: observableOf(true) isAuthorized: observableOf(true)
}); });
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule], imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule],

View File

@@ -45,10 +45,10 @@ describe('FeatureAuthorizationGuard', () => {
ePersonUuid = 'fake-eperson-uuid'; ePersonUuid = 'fake-eperson-uuid';
authorizationService = jasmine.createSpyObj('authorizationService', { authorizationService = jasmine.createSpyObj('authorizationService', {
isAuthenticated: observableOf(true) isAuthorized: observableOf(true)
}); });
router = jasmine.createSpyObj('router', { router = jasmine.createSpyObj('router', {
navigateByUrl: {} parseUrl: {}
}); });
guard = new FeatureAuthorizationGuardImpl(authorizationService, router, featureId, objectUrl, ePersonUuid); guard = new FeatureAuthorizationGuardImpl(authorizationService, router, featureId, objectUrl, ePersonUuid);
} }