Sha256: f160bc42f13e5374f9f6796387b5f4e79ed0449b7e5b6c1419dbeda612ce779b

Contents?: true

Size: 870 Bytes

Versions: 7

Compression:

Stored size: 870 Bytes

Contents

import React from 'react';
import { mount } from '@theforeman/test';
import { DescriptionField } from '../DescriptionField';

describe('DescriptionField', () => {
  it('rendring', () => {
    const component = mount(
      <DescriptionField
        inputs={[{ name: 'command' }]}
        value="Run %{command}"
        setValue={jest.fn()}
      />
    );
    const preview = component.find('#description-preview').hostNodes();
    const findLink = () => component.find('.pf-m-link.pf-m-inline');
    expect(findLink().text()).toEqual('Edit job description template');
    expect(preview.props().value).toEqual('Run command');
    findLink().simulate('click');
    const description = component.find('#description').hostNodes();
    expect(description.props().value).toEqual('Run %{command}');
    expect(findLink().text()).toEqual('Preview job description');
  });
});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
foreman_remote_execution-4.8.0 webpack/JobWizard/steps/AdvancedFields/__tests__/DescriptionField.test.js
foreman_remote_execution-4.5.6 webpack/JobWizard/steps/AdvancedFields/__tests__/DescriptionField.test.js
foreman_remote_execution-4.5.5 webpack/JobWizard/steps/AdvancedFields/__tests__/DescriptionField.test.js
foreman_remote_execution-4.5.4 webpack/JobWizard/steps/AdvancedFields/__tests__/DescriptionField.test.js
foreman_remote_execution-4.7.0 webpack/JobWizard/steps/AdvancedFields/__tests__/DescriptionField.test.js
foreman_remote_execution-4.5.3 webpack/JobWizard/steps/AdvancedFields/__tests__/DescriptionField.test.js
foreman_remote_execution-4.5.2 webpack/JobWizard/steps/AdvancedFields/__tests__/DescriptionField.test.js