Sha256: 530cc5a2c51f3cef09c19888dc37219e8f2a63a9348f33a18076ea92debe09bd

Contents?: true

Size: 1.13 KB

Versions: 86

Compression:

Stored size: 1.13 KB

Contents

import { testActionSnapshotWithFixtures } from '@theforeman/test';
import { API } from 'foremanReact/redux/API';
import {
  fetchAccountsStatus,
  startAccountStatusPolling,
  stopAccountStatusPolling,
  restartProcess,
} from '../AccountListActions';
import {
  pollingProcessID,
  fetchAccountsStatusResponse,
} from '../AccountList.fixtures';
import { accountID, activeTab } from '../../Dashboard/Dashboard.fixtures';

jest.mock('foremanReact/redux/API');
API.get.mockImplementation(async () => fetchAccountsStatusResponse);

const fixtures = {
  'should fetchAccountsStatus': () => fetchAccountsStatus(),
  'should startAccountStatusPolling': () =>
    startAccountStatusPolling(pollingProcessID),
  'should stopAccountStatusPolling': () =>
    stopAccountStatusPolling(pollingProcessID),
  'should restartProcess': () => restartProcess(accountID, activeTab),
  'should invoke toast notification upon failure': () => {
    API.post.mockImplementationOnce(() =>
      Promise.reject(new Error('test error'))
    );

    return restartProcess(accountID, activeTab);
  },
};

describe('AccountList actions', () => testActionSnapshotWithFixtures(fixtures));

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
foreman_rh_cloud-11.1.0 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-10.0.3 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-11.0.3 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-9.0.59 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-11.0.2 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-11.0.1 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-11.0.0 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-9.0.58 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-10.0.2 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-9.0.57 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-10.0.1 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-9.0.56 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-9.0.55 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-9.0.54 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-9.0.53 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-9.0.52 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-8.0.52 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-9.0.51 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-8.0.51 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
foreman_rh_cloud-7.0.48 webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js