Sha256: 60320959ab282f2823029868cf658a843262367670b81e8dfd3bf8eaeb126d32

Contents?: true

Size: 1.07 KB

Versions: 186

Compression:

Stored size: 1.07 KB

Contents

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

import {
  initialState,
  loadingState,
  subDetails,
  successState,
} from './subscriptionDetails.fixtures';
import reducer from '../SubscriptionDetailReducer';

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

  it('should keep loading state on SUBSCRIPTION_DETAILS_REQUEST', () => {
    expect(reducer(initialState, {
      type: types.SUBSCRIPTION_DETAILS_REQUEST,
    })).toEqual(loadingState);
  });

  it('load subscription details on SUBSCRIPTION_DETAILS_SUCCESS', () => {
    expect(reducer(initialState, {
      type: types.SUBSCRIPTION_DETAILS_SUCCESS,
      response: subDetails,
    })).toEqual(successState);
  });

  it('load error on SUBSCRIPTION_DETAILS_FAILURE', () => {
    const error = 'nothing worked';
    expect(reducer(initialState, {
      type: types.SUBSCRIPTION_DETAILS_FAILURE,
      payload: {
        message: error,
      },
    })).toEqual({
      ...initialState,
      error,
    });
  });
});

Version data entries

186 entries across 186 versions & 1 rubygems

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