Sha256: 1a5ea32276f7f581d0f04653e4258d489d05251a527fdc0e9b92a7e528c9bf75

Contents?: true

Size: 1.31 KB

Versions: 3

Compression:

Stored size: 1.31 KB

Contents

import { testReducerSnapshotWithFixtures } from '@theforeman/test';

import {
  INSIGHTS_SYNC_SETTING_SET,
  INSIGHTS_SYNC_SETTING_SET_FAILURE,
  INSIGHTS_SYNC_SETTINGS_GET_SUCCESS,
  INSIGHTS_SYNC_SETTINGS_GET_FAILURE,
} from '../InsightsSettingsConstants';
import reducer from '../InsightsSettingsReducer';

const fixtures = {
  'should return the initial state': {},
  'should handle INSIGHTS_SYNC_SETTINGS_GET_SUCCESS': {
    action: {
      type: INSIGHTS_SYNC_SETTINGS_GET_SUCCESS,
      payload: {
        settings: {
          insightsSyncEnabled: true,
        },
      },
    },
  },
  'should handle INSIGHTS_SYNC_SETTINGS_GET_FAILURE': {
    action: {
      type: INSIGHTS_SYNC_SETTINGS_GET_FAILURE,
      payload: {
        settings: {
          error: 'test error',
        },
      },
    },
  },
  'should handle INSIGHTS_SYNC_SETTING_SET': {
    action: {
      type: INSIGHTS_SYNC_SETTING_SET,
      payload: {
        settings: {
          insightsSyncEnabled: true,
        },
      },
    },
  },
  'should handle INSIGHTS_SYNC_SETTING_SET_FAILURE': {
    action: {
      type: INSIGHTS_SYNC_SETTING_SET_FAILURE,
      payload: {
        settings: {
          error: 'test set error',
        },
      },
    },
  },
};

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_rh_cloud-2.0.12 webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsReducer.test.js
foreman_rh_cloud-2.0.11 webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsReducer.test.js
foreman_rh_cloud-2.0.10 webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsReducer.test.js