Merge remote-tracking branch 'remotes/origin/master' into shibboleth

# Conflicts:
#	src/app/core/auth/auth.service.ts
#	src/app/core/auth/models/auth-status.model.ts
#	src/app/core/auth/models/normalized-auth-status.model.ts
#	src/app/core/auth/server-auth.service.ts
#	src/app/core/core.module.ts
#	src/app/shared/shared.module.ts
This commit is contained in:
Giuseppe Digilio
2020-02-25 17:31:07 +01:00
446 changed files with 8024 additions and 6657 deletions

View File

@@ -5,6 +5,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { Store, StoreModule } from '@ngrx/store';
import { REQUEST } from '@nguniversal/express-engine/tokens';
import { of as observableOf } from 'rxjs';
import { LinkService } from '../cache/builders/link.service';
import { authReducer, AuthState } from './auth.reducer';
import { NativeWindowRef, NativeWindowService } from '../services/window.service';
@@ -40,7 +41,7 @@ describe('AuthService test', () => {
let storage: CookieService;
let token: AuthTokenInfo;
let authenticatedState;
let rdbService;
let linkService;
function init() {
mockStore = jasmine.createSpyObj('store', {
@@ -60,8 +61,10 @@ describe('AuthService test', () => {
};
authRequest = new AuthRequestServiceStub();
routeStub = new ActivatedRouteStub();
rdbService = getMockRemoteDataBuildService();
spyOn(rdbService, 'build').and.returnValue({authenticated: true, eperson: observableOf({payload: {}})});
linkService = {
resolveLinks: {}
};
spyOn(linkService, 'resolveLinks').and.returnValue({authenticated: true, eperson: observableOf({payload: {}})});
}
@@ -82,7 +85,7 @@ describe('AuthService test', () => {
{ provide: RouteService, useValue: routeServiceStub },
{ provide: ActivatedRoute, useValue: routeStub },
{ provide: Store, useValue: mockStore },
{ provide: RemoteDataBuildService, useValue: rdbService },
{ provide: LinkService, useValue: linkService },
CookieService,
AuthService
],
@@ -165,7 +168,7 @@ describe('AuthService test', () => {
{ provide: REQUEST, useValue: {} },
{ provide: Router, useValue: routerStub },
{ provide: RouteService, useValue: routeServiceStub },
{ provide: RemoteDataBuildService, useValue: rdbService },
{ provide: RemoteDataBuildService, useValue: linkService },
CookieService,
AuthService
]
@@ -178,7 +181,7 @@ describe('AuthService test', () => {
(state as any).core = Object.create({});
(state as any).core.auth = authenticatedState;
});
authService = new AuthService({}, window, undefined, authReqService, router, routeService, cookieService, store, rdbService);
authService = new AuthService({}, window, undefined, authReqService, router, routeService, cookieService, store, linkService);
}));
it('should return true when user is logged in', () => {
@@ -217,7 +220,7 @@ describe('AuthService test', () => {
{ provide: REQUEST, useValue: {} },
{ provide: Router, useValue: routerStub },
{ provide: RouteService, useValue: routeServiceStub },
{ provide: RemoteDataBuildService, useValue: rdbService },
{ provide: RemoteDataBuildService, useValue: linkService },
ClientCookieService,
CookieService,
AuthService
@@ -240,7 +243,7 @@ describe('AuthService test', () => {
(state as any).core = Object.create({});
(state as any).core.auth = authenticatedState;
});
authService = new AuthService({}, window, undefined, authReqService, router, routeService, cookieService, store, rdbService);
authService = new AuthService({}, window, undefined, authReqService, router, routeService, cookieService, store, linkService);
storage = (authService as any).storage;
routeServiceMock = TestBed.get(RouteService);
routerStub = TestBed.get(Router);