mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
[CSTPER-144] Fixed issue with authorization request encountered while logging-in with external idp
This commit is contained in:
@@ -512,7 +512,7 @@ describe('authReducer', () => {
|
||||
loading: false,
|
||||
authMethods: []
|
||||
};
|
||||
const action = new RetrieveAuthMethodsAction(new AuthStatus());
|
||||
const action = new RetrieveAuthMethodsAction(new AuthStatus(), true);
|
||||
const newState = authReducer(initialState, action);
|
||||
state = {
|
||||
authenticated: false,
|
||||
@@ -536,7 +536,7 @@ describe('authReducer', () => {
|
||||
new AuthMethod(AuthMethodType.Password),
|
||||
new AuthMethod(AuthMethodType.Shibboleth, 'location')
|
||||
];
|
||||
const action = new RetrieveAuthMethodsSuccessAction(authMethods);
|
||||
const action = new RetrieveAuthMethodsSuccessAction(authMethods, false);
|
||||
const newState = authReducer(initialState, action);
|
||||
state = {
|
||||
authenticated: false,
|
||||
@@ -548,7 +548,31 @@ describe('authReducer', () => {
|
||||
expect(newState).toEqual(state);
|
||||
});
|
||||
|
||||
it('should properly set the state, in response to a RETRIEVE_AUTH_METHODS_ERROR action', () => {
|
||||
it('should properly set the state, in response to a RETRIEVE_AUTH_METHODS_SUCCESS action with blocking as true', () => {
|
||||
initialState = {
|
||||
authenticated: false,
|
||||
loaded: false,
|
||||
blocking: true,
|
||||
loading: true,
|
||||
authMethods: []
|
||||
};
|
||||
const authMethods = [
|
||||
new AuthMethod(AuthMethodType.Password),
|
||||
new AuthMethod(AuthMethodType.Shibboleth, 'location')
|
||||
];
|
||||
const action = new RetrieveAuthMethodsSuccessAction(authMethods, true);
|
||||
const newState = authReducer(initialState, action);
|
||||
state = {
|
||||
authenticated: false,
|
||||
loaded: false,
|
||||
blocking: true,
|
||||
loading: false,
|
||||
authMethods: authMethods
|
||||
};
|
||||
expect(newState).toEqual(state);
|
||||
});
|
||||
|
||||
it('should properly set the state, in response to a RETRIEVE_AUTH_METHODS_ERROR action ', () => {
|
||||
initialState = {
|
||||
authenticated: false,
|
||||
loaded: false,
|
||||
@@ -557,7 +581,7 @@ describe('authReducer', () => {
|
||||
authMethods: []
|
||||
};
|
||||
|
||||
const action = new RetrieveAuthMethodsErrorAction();
|
||||
const action = new RetrieveAuthMethodsErrorAction(false);
|
||||
const newState = authReducer(initialState, action);
|
||||
state = {
|
||||
authenticated: false,
|
||||
@@ -568,4 +592,25 @@ describe('authReducer', () => {
|
||||
};
|
||||
expect(newState).toEqual(state);
|
||||
});
|
||||
|
||||
it('should properly set the state, in response to a RETRIEVE_AUTH_METHODS_ERROR action with blocking as true', () => {
|
||||
initialState = {
|
||||
authenticated: false,
|
||||
loaded: false,
|
||||
blocking: true,
|
||||
loading: true,
|
||||
authMethods: []
|
||||
};
|
||||
|
||||
const action = new RetrieveAuthMethodsErrorAction(true);
|
||||
const newState = authReducer(initialState, action);
|
||||
state = {
|
||||
authenticated: false,
|
||||
loaded: false,
|
||||
blocking: true,
|
||||
loading: false,
|
||||
authMethods: [new AuthMethod(AuthMethodType.Password)]
|
||||
};
|
||||
expect(newState).toEqual(state);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user