Sha256: d30c099e8b9732797326a0a833f6ef1a6990697ef6836110f7ee29f64e774ce7

Contents?: true

Size: 1.15 KB

Versions: 95

Compression:

Stored size: 1.15 KB

Contents

import {
  JOB_INVOCATIONS_GET_JOB_INVOCATIONS,
  JOB_INVOCATIONS_POLLING_STARTED,
  JOB_INVOCATIONS_JOB_FINISHED,
} from '../../consts';

import {
  initialState,
  pollingStarted,
  jobInvocationsPayload,
  jobInvocationsReceived,
} from './index.fixtures';

import reducer from './index';

describe('job invocations chart reducer', () => {
  it('should return the initial state', () => {
    expect(reducer(undefined, {})).toEqual(initialState);
  });
  it('should start polling given POLLING_STARTED', () => {
    expect(
      reducer(initialState, {
        type: JOB_INVOCATIONS_POLLING_STARTED,
      })
    ).toEqual(pollingStarted);
  });
  it('should stop polling given JOB_FINISHED', () => {
    expect(
      reducer(pollingStarted, {
        type: JOB_INVOCATIONS_JOB_FINISHED,
        payload: { jobInvocations: { job_invocations: [], statuses: {} } },
      })
    ).toEqual(initialState);
  });
  it('should receive job invocations given GET_JOB_INVOCATIONS', () => {
    expect(
      reducer(pollingStarted, {
        type: JOB_INVOCATIONS_GET_JOB_INVOCATIONS,
        payload: jobInvocationsPayload,
      })
    ).toEqual(jobInvocationsReceived);
  });
});

Version data entries

95 entries across 95 versions & 1 rubygems

Version Path
foreman_remote_execution-14.1.2 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-14.1.1 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-14.1.0 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-14.0.2 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-14.0.1 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-13.2.6 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-14.0.0 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-13.2.5 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-13.2.4 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-13.2.3 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-13.2.2 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-12.0.7 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-13.2.1 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-13.2.0 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-10.1.3 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-13.0.0 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-12.0.5 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-12.0.4 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-12.0.1 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-12.0.2 webpack/react_app/redux/reducers/jobInvocations/index.test.js