Sha256: 17dcc188e95fe557c6ed7a8ba59fe24beb871edc64e4e675b297a68df3674312
Contents?: true
Size: 1.17 KB
Versions: 30
Compression:
Stored size: 1.17 KB
Contents
import { testReducerSnapshotWithFixtures } from '@theforeman/test'; import reducer, { initialState } from '../PreupgradeReportsReducer'; import { PREUPGRADE_REPORTS_REQUEST, PREUPGRADE_REPORTS_SUCCESS, PREUPGRADE_REPORTS_FAILURE, } from '../../../consts'; import { preupgradeReports } from './PreupgradeReports.fixtures'; const fixtures = { 'should return initial state': { state: initialState, action: { type: undefined, payload: [], }, }, 'should start loading reports on request': { state: initialState, action: { type: PREUPGRADE_REPORTS_REQUEST, }, }, 'should stop loading on reports success': { state: initialState.set('loadingPreupgradeReports', true), action: { type: PREUPGRADE_REPORTS_SUCCESS, payload: { results: preupgradeReports }, }, }, 'should show error on request failure': { state: initialState.set('loadingPreupgradeReports', true), action: { type: PREUPGRADE_REPORTS_FAILURE, payload: { error: { errorMsg: 'This is error', statusText: 'Not good' } }, }, }, }; describe('PreupgradeReportsReducer', () => testReducerSnapshotWithFixtures(reducer, fixtures));
Version data entries
30 entries across 30 versions & 1 rubygems