Revision 09cecfa0
Added by Avi Sharvit almost 6 years ago
webpack/redux/reducers/RedHatRepositories/sets.test.js | ||
---|---|---|
|
||
import {
|
||
initialState,
|
||
recommendedState,
|
||
loadingState,
|
||
requestSuccessResponse,
|
||
successState,
|
||
... | ... | |
expect(reducer(undefined, {})).toEqual(initialState);
|
||
});
|
||
|
||
it('should update the recommended value on REPOSITORY_SETS_UPDATE_RECOMMENDED', () => {
|
||
expect(reducer(initialState, {
|
||
type: types.REPOSITORY_SETS_UPDATE_RECOMMENDED,
|
||
payload: true,
|
||
})).toEqual(recommendedState);
|
||
});
|
||
|
||
it('should keep loading state on REPOSITORY_SETS_REQUEST', () => {
|
||
expect(reducer(initialState, {
|
||
type: types.REPOSITORY_SETS_REQUEST,
|
||
... | ... | |
it('should flatten repositories response REPOSITORY_SETS_SUCCESS', () => {
|
||
expect(reducer(initialState, {
|
||
type: types.REPOSITORY_SETS_SUCCESS,
|
||
response: requestSuccessResponse,
|
||
payload: { response: requestSuccessResponse, search: requestSuccessResponse.search },
|
||
})).toEqual(successState);
|
||
});
|
||
|
||
it('should have error on REPOSITORY_SETS_FAILURE', () => {
|
||
expect(reducer(initialState, {
|
||
type: types.REPOSITORY_SETS_FAILURE,
|
||
error: 'Unable to process request.',
|
||
payload: 'Unable to process request.',
|
||
})).toEqual(errorState);
|
||
});
|
||
});
|
Also available in: Unified diff
Fixes #21648 - Red Hat Recommended Repositories
Adds recommended-repository-sets-toggler
to the available-repository-sets-list