Sha256: 6c9584e6782d77a6139f4b3d323e002206e42ac265d54a6ea346c11c5c5b6a2c

Contents?: true

Size: 1.44 KB

Versions: 11

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 {
  accounts,
  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: {
        accounts,
      },
    },
  },
  '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

11 entries across 11 versions & 2 rubygems

Version Path
foreman_rh_cloud-0.9.4.1 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_rh_cloud-1.0.4.1 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_rh_cloud-1.0.4 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_rh_cloud-0.9.4 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_inventory_upload-1.0.3 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_inventory_upload-0.9.2 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_inventory_upload-1.0.2 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_inventory_upload-0.9.1 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_inventory_upload-1.0.1 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_inventory_upload-0.9.0 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
foreman_inventory_upload-1.0.0 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js