Sha256: ca33e5be1e6a5ade45665f342959765cab4a56050b97cef9b0cba16c20a4e6c1
Contents?: true
Size: 1.27 KB
Versions: 29
Compression:
Stored size: 1.27 KB
Contents
import * as types from '../../../consts'; import { initialState, recommendedState, loadingState, requestSuccessResponse, successState, errorState, } from '../sets.fixtures'; import reducer from '../sets'; describe('sets reducer', () => { it('should return the initial state', () => { 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, })).toEqual(loadingState); }); it('should flatten repositories response REPOSITORY_SETS_SUCCESS', () => { expect(reducer(initialState, { type: types.REPOSITORY_SETS_SUCCESS, payload: { response: requestSuccessResponse, search: requestSuccessResponse.search }, })).toEqual(successState); }); it('should have error on REPOSITORY_SETS_FAILURE', () => { expect(reducer(initialState, { type: types.REPOSITORY_SETS_FAILURE, payload: 'Unable to process request.', })).toEqual(errorState); }); });
Version data entries
29 entries across 29 versions & 1 rubygems