Sha256: e5067eab64720439d0667d009c775899ef59cf8194766d97f4c8b1a77fffa72b

Contents?: true

Size: 746 Bytes

Versions: 9

Compression:

Stored size: 746 Bytes

Contents

import { testActionSnapshotWithFixtures } from '@theforeman/test';
import API from 'foremanReact/API';
import { handleToggle } from '../AutoUploadSwitcherActions';
import {
  handleToggleResponse,
  currentAutoUploadEnabled,
} from '../AutoUploadSwitcher.fixtures';

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

const fixtures = {
  'should handleToggle': () => handleToggle(currentAutoUploadEnabled),
  'should handleToggle with error': () => {
    API.post.mockImplementationOnce(() =>
      Promise.reject(new Error('Network error!'))
    );

    return handleToggle(currentAutoUploadEnabled);
  },
};

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
foreman_rh_cloud-2.0.18.1 webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js
foreman_rh_cloud-2.0.18 webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js
foreman_rh_cloud-2.0.17 webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js
foreman_rh_cloud-2.0.16 webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js
foreman_rh_cloud-2.0.15 webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js
foreman_rh_cloud-3.0.14 webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js
foreman_rh_cloud-2.0.14 webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js
foreman_rh_cloud-2.0.13.1 webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js
foreman_rh_cloud-2.0.13 webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js