Sha256: 53b9d4e4d5f16d5a66cb176668c6aeb8e7c2010fc43e3488db72d57918d96a17

Contents?: true

Size: 1.44 KB

Versions: 6

Compression:

Stored size: 1.44 KB

Contents

import { testReducerSnapshotWithFixtures } from 'react-redux-test-utils';

import {
  INVENTORY_ACCOUNT_STATUS_POLLING,
  INVENTORY_ACCOUNT_STATUS_POLLING_START,
  INVENTORY_ACCOUNT_STATUS_POLLING_STOP,
  INVENTORY_ACCOUNT_STATUS_POLLING_ERROR,
  INVENTORY_PROCESS_RESTART,
} from '../AccountListConstants';
import reducer from '../AccountListReducer';
import {
  statuses,
  error,
  pollingProcessID,
  accountID,
  processStatusName,
} from '../AccountList.fixtures';

const fixtures = {
  'should return the initial state': {},
  'should handle INVENTORY_ACCOUNT_STATUS_POLLING': {
    action: {
      type: INVENTORY_ACCOUNT_STATUS_POLLING,
      payload: {
        statuses,
      },
    },
  },
  'should handle INVENTORY_ACCOUNT_STATUS_POLLING_ERROR': {
    action: {
      type: INVENTORY_ACCOUNT_STATUS_POLLING_ERROR,
      payload: { error },
    },
  },
  'should handle INVENTORY_ACCOUNT_STATUS_POLLING_START': {
    action: {
      type: INVENTORY_ACCOUNT_STATUS_POLLING_START,
      payload: {
        pollingProcessID,
      },
    },
  },
  'should handle INVENTORY_ACCOUNT_STATUS_POLLING_STOP': {
    action: {
      type: INVENTORY_ACCOUNT_STATUS_POLLING_STOP,
    },
  },
  'should handle INVENTORY_PROCESS_RESTART': {
    action: {
      type: INVENTORY_PROCESS_RESTART,
      payload: {
        accountID,
        processStatusName,
      },
    },
  },
};

describe('AccountList reducer', () =>
  testReducerSnapshotWithFixtures(reducer, fixtures));

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman_inventory_upload-1.0.0.beta7 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_inventory_upload-1.0.0.beta6 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_inventory_upload-1.0.0.beta5 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_inventory_upload-1.0.0.beta4 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_inventory_upload-1.0.0.beta3 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_inventory_upload-1.0.0.beta2 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js