Sha256: 9af358b618513bd0e1d14823b68585e706a6a6e036c258596261bf446b409464

Contents?: true

Size: 1.09 KB

Versions: 179

Compression:

Stored size: 1.09 KB

Contents

import {
  MODULE_STREAMS_REQUEST,
  MODULE_STREAMS_SUCCESS,
  MODULE_STREAMS_FAILURE,
} from '../ModuleStreamsConstants';
import {
  initialState,
  loadingState,
  successState,
  results,
} from './moduleStreams.fixtures';
import reducer from '../ModuleStreamsReducer';

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

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

  it('load module streams on MODULE_STREAMS_SUCCESS', () => {
    expect(reducer(initialState, {
      type: MODULE_STREAMS_SUCCESS,
      response: {
        ...initialState,
        results,
      },
    })).toEqual(successState);
  });

  it('load error on MODULE_STREAMS_FAILURE', () => {
    const error = 'nothing worked';
    expect(reducer(initialState, {
      type: MODULE_STREAMS_FAILURE,
      error,
    })).toEqual({
      ...initialState,
      loading: false,
      error,
    });
  });
});

Version data entries

179 entries across 179 versions & 1 rubygems

Version Path
katello-4.15.0.rc2 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.15.0.rc1 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.14.1 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.14.0 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.14.0.rc3 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.14.0.rc2 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.14.0.rc1.1 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.14.0.rc1 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.13.1 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.13.0 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.12.1 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.13.0.rc1 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.12.0 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.12.0.rc3 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.12.0.rc2 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.12.0.rc1 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.11.1 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.11.0 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.11.0.rc2 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js
katello-4.11.0.rc1 webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js