Sha256: 146a99c15571b18631acc691c70fe8d2350f92516a860c419feb07c042f5eb24
Contents?: true
Size: 1.27 KB
Versions: 12
Compression:
Stored size: 1.27 KB
Contents
import { testReducerSnapshotWithFixtures } from 'react-redux-test-utils'; import reducer, { initialState } from '../NewTemplateSyncReducer'; import { importSettings, exportSettings, } from '../__fixtures__/templateSyncSettings.fixtures'; import { SYNC_SETTINGS_REQUEST, SYNC_SETTINGS_SUCCESS, SYNC_SETTINGS_FAILURE, } from '../../../consts'; const successPayload = { results: { import: importSettings, export: exportSettings, }, }; const fixtures = { 'should return initial state': { state: initialState, action: { type: undefined, payload: {}, }, }, 'should start loading on setting values request': { state: initialState, action: { type: SYNC_SETTINGS_REQUEST, }, }, 'should stop loading on setting values success': { state: initialState.set('loadingSettings', true), action: { type: SYNC_SETTINGS_SUCCESS, payload: successPayload, }, 'should stop loading on setting values error': { state: initialState.set('loadingSettings', true), action: { type: SYNC_SETTINGS_FAILURE, payload: { error: 'Failed to fetch setting values', }, }, }, }, }; describe('NewTemplateSyncReducer', () => testReducerSnapshotWithFixtures(reducer, fixtures));
Version data entries
12 entries across 12 versions & 1 rubygems