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

# Conflicts:
#	src/app/core/auth/auth.actions.ts
#	src/app/core/auth/auth.effects.spec.ts
#	src/app/core/auth/auth.effects.ts
#	src/app/core/auth/auth.reducer.spec.ts
#	src/app/core/auth/auth.reducer.ts
#	src/app/core/auth/auth.service.spec.ts
#	src/app/core/auth/auth.service.ts
#	src/app/core/auth/server-auth.service.ts
#	src/app/shared/testing/auth-request-service-stub.ts
This commit is contained in:
Giuseppe Digilio
2020-03-03 20:04:02 +01:00
113 changed files with 3503 additions and 2724 deletions

View File

@@ -18,6 +18,8 @@ import {
RefreshTokenErrorAction,
RefreshTokenSuccessAction,
ResetAuthenticationMessagesAction,
RetrieveAuthenticatedEpersonErrorAction,
RetrieveAuthenticatedEpersonSuccessAction,
RetrieveAuthMethodsAction,
RetrieveAuthMethodsErrorAction,
RetrieveAuthMethodsSuccessAction,
@@ -113,16 +115,15 @@ describe('authReducer', () => {
loading: true,
info: undefined
};
const action = new AuthenticatedSuccessAction(true, mockTokenInfo, EPersonMock);
const action = new AuthenticatedSuccessAction(true, mockTokenInfo, EPersonMock._links.self.href);
const newState = authReducer(initialState, action);
state = {
authenticated: true,
authToken: mockTokenInfo,
loaded: true,
loaded: false,
error: undefined,
loading: false,
info: undefined,
user: EPersonMock
loading: true,
info: undefined
};
expect(newState).toEqual(state);
});
@@ -248,6 +249,50 @@ describe('authReducer', () => {
expect(newState).toEqual(state);
});
it('should properly set the state, in response to a RETRIEVE_AUTHENTICATED_EPERSON_SUCCESS action', () => {
initialState = {
authenticated: true,
authToken: mockTokenInfo,
loaded: false,
error: undefined,
loading: true,
info: undefined
};
const action = new RetrieveAuthenticatedEpersonSuccessAction(EPersonMock);
const newState = authReducer(initialState, action);
state = {
authenticated: true,
authToken: mockTokenInfo,
loaded: true,
error: undefined,
loading: false,
info: undefined,
user: EPersonMock
};
expect(newState).toEqual(state);
});
it('should properly set the state, in response to a RETRIEVE_AUTHENTICATED_EPERSON_ERROR action', () => {
initialState = {
authenticated: false,
loaded: false,
error: undefined,
loading: true,
info: undefined
};
const action = new RetrieveAuthenticatedEpersonErrorAction(mockError);
const newState = authReducer(initialState, action);
state = {
authenticated: false,
authToken: undefined,
error: 'Test error message',
loaded: true,
loading: false,
info: undefined
};
expect(newState).toEqual(state);
});
it('should properly set the state, in response to a REFRESH_TOKEN action', () => {
initialState = {
authenticated: true,