Sha256: 7e8fb888f7cb93b4db36d020ddfb5e2fd557ac43e635a0bd69c08fb3a2cf8529

Contents?: true

Size: 1.14 KB

Versions: 12

Compression:

Stored size: 1.14 KB

Contents

import { testReducerSnapshotWithFixtures } from 'react-redux-test-utils';

import reducer, { initialState } from '../TemplateSyncResultReducer';
import { importTemplates } from '../__fixtures__/templateSyncResult.fixtures';

import {
  TEMPLATESYNC_FORM_SUBMITTED,
  SYNC_RESULT_PAGINATION_CHANGE,
} from '../../../consts';

const fixtures = {
  'should return initial state': {
    state: initialState,
    action: {
      type: undefined,
      payload: {},
    },
  },
  'should set new pagination': {
    state: initialState,
    action: {
      type: SYNC_RESULT_PAGINATION_CHANGE,
      payload: {
        pagination: {
          page: 2,
          perPage: 5,
        },
      },
    },
  },
  'should update state when form submitted': {
    state: initialState,
    action: {
      type: TEMPLATESYNC_FORM_SUBMITTED,
      payload: {
        data: {
          templates: importTemplates,
          repo: 'https://github.com/theforeman/community-templates.git',
          branch: 'master',
          result_action: 'import',
        },
      },
    },
  },
};

describe('TemplateSyncResultReducer', () =>
  testReducerSnapshotWithFixtures(reducer, fixtures));

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
foreman_templates-9.2.0 webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js
foreman_templates-9.1.0 webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js
foreman_templates-9.0.2 webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js
foreman_templates-9.0.1 webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js
foreman_templates-9.0.0 webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js
foreman_templates-7.0.7 webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js
foreman_templates-8.0.0 webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js
foreman_templates-7.0.6 webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js
foreman_templates-7.0.5 webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js
foreman_templates-7.0.4 webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js
foreman_templates-7.0.3 webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js
foreman_templates-7.0.2 webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js