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

Version Path
foreman_leapp-1.2.3 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-2.0.3 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-2.0.2 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-1.2.2 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-2.0.1 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-2.0.0 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-1.2.1 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-1.2.0 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-0.1.15 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-1.1.1 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-1.1.0 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-1.0.0 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-0.1.14 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-0.1.13 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-0.1.12 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-0.1.11 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-0.1.10 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-0.1.9 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-0.1.8 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
foreman_leapp-0.1.7 webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js