Sha256: f962d88a7e74db41a90f30eafd48da59e66b611a3c9ea1bbd0613e4c4282679e

Contents?: true

Size: 1.1 KB

Versions: 20

Compression:

Stored size: 1.1 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

20 entries across 20 versions & 1 rubygems

Version Path
foreman_remote_execution-1.8.3 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.8.2 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.8.1 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.8.0 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.7.1 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.7.0 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.6.7 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.6.6 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.6.5 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.6.4 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.5.6 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.6.3 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.6.2 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.5.5 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.6.1 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.6.0 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.5.4 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.5.3 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.5.2 webpack/react_app/redux/reducers/jobInvocations/index.test.js
foreman_remote_execution-1.5.1 webpack/react_app/redux/reducers/jobInvocations/index.test.js