Sha256: 6918fa93d8755647bc93a717c944fed748a3434d4b7049c831cf86650d5262f3
Contents?: true
Size: 1.64 KB
Versions: 120
Compression:
Stored size: 1.64 KB
Contents
import * as types from '../OrganizationConstants'; import { initialState, loadingState, requestSuccessResponse, successState, errorState, } from './organizations.fixtures'; import reducer from '../OrganizationReducer'; describe('organizations reducer', () => { it('should return the initial state', () => { expect(reducer(undefined, {})).toEqual(initialState); }); it('should keep loading state on GET_ORGANIZATION_REQUEST', () => { expect(reducer(initialState, { type: types.GET_ORGANIZATION_REQUEST, })).toEqual(loadingState); }); it('should flatten organization response GET_ORGANIZATION_SUCCESS', () => { expect(reducer(initialState, { type: types.GET_ORGANIZATION_SUCCESS, response: requestSuccessResponse, })).toEqual(successState); }); it('should have error on GET_ORGANIZATION_FAILURE', () => { expect(reducer(initialState, { type: types.GET_ORGANIZATION_FAILURE, error: 'Unable to process request.', })).toEqual(errorState); }); it('should keep loading state on SAVE_ORGANIZATION_REQUEST', () => { expect(reducer(initialState, { type: types.SAVE_ORGANIZATION_REQUEST, })).toEqual(loadingState); }); it('should flatten organization response SAVE_ORGANIZATION_SUCCESS', () => { expect(reducer(initialState, { type: types.SAVE_ORGANIZATION_SUCCESS, response: requestSuccessResponse, })).toEqual(successState); }); it('should have error on SAVE_ORGANIZATION_FAILURE', () => { expect(reducer(initialState, { type: types.SAVE_ORGANIZATION_FAILURE, error: 'Unable to process request.', })).toEqual(errorState); }); });
Version data entries
120 entries across 120 versions & 1 rubygems