Sha256: a1ab083545444edd9000140b94507a2c1a6dfa8790c6d6bd4fbf650f6da52aa9

Contents?: true

Size: 1.31 KB

Versions: 6

Compression:

Stored size: 1.31 KB

Contents

import { testReducerSnapshotWithFixtures } from 'react-redux-test-utils';

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

6 entries across 6 versions & 1 rubygems

Version Path
foreman_rh_cloud-0.9.12 webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsReducer.test.js
foreman_rh_cloud-1.0.12 webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsReducer.test.js
foreman_rh_cloud-0.9.11 webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsReducer.test.js
foreman_rh_cloud-1.0.11 webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsReducer.test.js
foreman_rh_cloud-0.9.10 webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsReducer.test.js
foreman_rh_cloud-1.0.10 webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsReducer.test.js