Sha256: 179d0687ab4ef92bc11ed5937380ce289ad25b11c54b151003c93f721d596b5f

Contents?: true

Size: 1.72 KB

Versions: 6

Compression:

Stored size: 1.72 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 {
  accounts,
  error,
  pollingProcessID,
  accountID,
  processStatusName,
  autoUploadEnabled,
} from '../AccountList.fixtures';
import { AUTO_UPLOAD_TOGGLE } from '../../AutoUploadSwitcher/AutoUploadSwitcherConstants';

const fixtures = {
  'should return the initial state': {},
  'should handle INVENTORY_ACCOUNT_STATUS_POLLING': {
    action: {
      type: INVENTORY_ACCOUNT_STATUS_POLLING,
      payload: {
        accounts,
        autoUploadEnabled,
      },
    },
  },
  '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,
      },
    },
  },
  'should handle AUTO_UPLOAD_TOGGLE': {
    action: {
      type: AUTO_UPLOAD_TOGGLE,
      payload: {
        autoUploadEnabled,
      },
    },
  },
};

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman_rh_cloud-0.9.7 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_rh_cloud-1.0.7 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_rh_cloud-0.9.6 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_rh_cloud-1.0.6 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_rh_cloud-0.9.5 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_rh_cloud-1.0.5 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js