Sha256: be0906a8eb7b726beaf82b31e2ab5bb15cfd802a5ffa58f7b9a7aa1a423a3f19

Contents?: true

Size: 1.2 KB

Versions: 186

Compression:

Stored size: 1.2 KB

Contents

import * as types from '../ManifestConstants';

import {
  manifestHistoryInitialState,
  manifestHistoryLoadingState,
  manifestHistorySuccessResponse,
  manifestHistorySuccessState,
  manifestHistoryErrorState,
} from './manifest.fixtures';
import reducer from '../ManifestHistoryReducer';

describe('manifest history reducer', () => {
  it('should return the initial state', () => {
    expect(reducer(undefined, {})).toEqual(manifestHistoryInitialState);
  });

  it('should keep loading state on MANIFEST_HISTORY_REQUEST', () => {
    expect(reducer(manifestHistoryInitialState, {
      type: types.MANIFEST_HISTORY_REQUEST,
    })).toEqual(manifestHistoryLoadingState);
  });

  it('should flatten response MANIFEST_HISTORY_SUCCESS', () => {
    expect(reducer(manifestHistoryInitialState, {
      type: types.MANIFEST_HISTORY_SUCCESS,
      response: manifestHistorySuccessResponse,
    })).toEqual(manifestHistorySuccessState);
  });

  it('should have error on MANIFEST_HISTORY_FAILURE', () => {
    expect(reducer(manifestHistoryInitialState, {
      type: types.MANIFEST_HISTORY_FAILURE,
      payload: {
        message: 'Unable to process request.',
      },
    })).toEqual(manifestHistoryErrorState);
  });
});

Version data entries

186 entries across 186 versions & 1 rubygems

Version Path
katello-4.3.1 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.4.0 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.4.0.rc2 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.4.0.rc1 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.2.2 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.3.0 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.3.0.rc4 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.3.0.rc3 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.3.0.rc2.1 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.3.0.rc2 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.3.0.rc1 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.2.1 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.2.0.1 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.1.4 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.0.3 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.2.0.1.rc3 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-3.18.5 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.2.0.1.rc2 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.2.0.rc2 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js
katello-4.1.3 webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js