Sha256: 05923fa845e7c00779476649e8890ba52a4369e47c51a8fbd56731dc6cae6260

Contents?: true

Size: 715 Bytes

Versions: 10

Compression:

Stored size: 715 Bytes

Contents

import { testActionSnapshotWithFixtures } from 'react-redux-test-utils';
import API from 'foremanReact/API';
import { handleToggle } from '../ExcludePackagesSwitcherActions';
import { handleToggleResponse } from '../ExcludePackagesSwitcher.fixtures';

jest.mock('foremanReact/API');
API.post.mockImplementation(async () => handleToggleResponse);

const fixtures = {
  'should handleToggle': () => handleToggle(),
  'should invoke toast notification upon failure of handleToggle': () => {
    API.post.mockImplementationOnce(() =>
      Promise.reject(new Error('test error'))
    );

    return handleToggle();
  },
};

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
foreman_rh_cloud-1.0.18 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js
foreman_rh_cloud-1.0.17 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js
foreman_rh_cloud-1.0.16 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js
foreman_rh_cloud-1.0.15 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js
foreman_rh_cloud-1.0.14 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js
foreman_rh_cloud-0.9.14 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js
foreman_rh_cloud-0.9.13.1 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js
foreman_rh_cloud-1.0.13.1 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js
foreman_rh_cloud-0.9.13 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js
foreman_rh_cloud-1.0.13 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js