Sha256: 9af358b618513bd0e1d14823b68585e706a6a6e036c258596261bf446b409464
Contents?: true
Size: 1.09 KB
Versions: 179
Compression:
Stored size: 1.09 KB
Contents
import { MODULE_STREAMS_REQUEST, MODULE_STREAMS_SUCCESS, MODULE_STREAMS_FAILURE, } from '../ModuleStreamsConstants'; import { initialState, loadingState, successState, results, } from './moduleStreams.fixtures'; import reducer from '../ModuleStreamsReducer'; describe('module streams reducer', () => { it('should return the initial state', () => { expect(reducer(undefined, {})).toEqual(initialState); }); it('should keep loading state on MODULE_STREAMS_REQUEST', () => { expect(reducer(initialState, { type: MODULE_STREAMS_REQUEST, })).toEqual(loadingState); }); it('load module streams on MODULE_STREAMS_SUCCESS', () => { expect(reducer(initialState, { type: MODULE_STREAMS_SUCCESS, response: { ...initialState, results, }, })).toEqual(successState); }); it('load error on MODULE_STREAMS_FAILURE', () => { const error = 'nothing worked'; expect(reducer(initialState, { type: MODULE_STREAMS_FAILURE, error, })).toEqual({ ...initialState, loading: false, error, }); }); });
Version data entries
179 entries across 179 versions & 1 rubygems