Sha256: 68a4d8483ea4036566732a9dab22716f2651c0ef3dd1c9a0ae0d7fd35105d1ee

Contents?: true

Size: 989 Bytes

Versions: 6

Compression:

Stored size: 989 Bytes

Contents

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

import { NEW_TEMPLATE_SYNC_FORM_NAME } from '../NewTemplateSyncFormConstants';
import {
  registeredImportSettings,
  initialValues,
  stateFactory,
  importSettings,
  exportSettings,
} from '../../../__fixtures__/templateSyncSettings.fixtures';

import {
  selectInitialFormValues,
  selectRegisteredFields,
} from '../NewTemplateSyncFormSelectors';

const formStateFactory = obj => ({
  form: {
    [NEW_TEMPLATE_SYNC_FORM_NAME]: obj,
  },
});

const fixtures = {
  'should return registered fields': () =>
    selectRegisteredFields(
      NEW_TEMPLATE_SYNC_FORM_NAME,
      formStateFactory(registeredImportSettings)
    ),
  'should return initial form values': () =>
    selectInitialFormValues({
      ...stateFactory({ importSettings, exportSettings }),
      ...formStateFactory(initialValues),
    }),
};

describe('NewTemplateSyncFormSelectors', () =>
  testSelectorsSnapshotWithFixtures(fixtures));

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman_templates-7.0.7 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncFormSelectors.test.js
foreman_templates-7.0.6 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncFormSelectors.test.js
foreman_templates-7.0.5 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncFormSelectors.test.js
foreman_templates-7.0.4 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncFormSelectors.test.js
foreman_templates-7.0.3 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncFormSelectors.test.js
foreman_templates-7.0.2 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncFormSelectors.test.js