Sha256: a2a97171f055d6b4b2792b771567bf641b430c6f8ab7748c4f4a10cabc6310d7

Contents?: true

Size: 768 Bytes

Versions: 7

Compression:

Stored size: 768 Bytes

Contents

import React from 'react';
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
import { shallow } from 'enzyme';
import { ResumeButton } from './ResumeButton';

const fixtures = {
  'render with minimal props': {
    id: 'some-id',
    name: 'some-name',
  },
};

describe('ResumeButton', () => {
  describe('rendering', () =>
    testComponentSnapshotsWithFixtures(ResumeButton, fixtures));
  describe('should use id and name on click', () => {
    const onClick = jest.fn();
    const id = 'some-id';
    const name = 'some-name';
    const component = shallow(
      <ResumeButton id={id} name={name} onClick={onClick} />
    );
    component.find('Button').simulate('click');

    expect(onClick).toHaveBeenCalledWith(id, name);
  });
});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
foreman-tasks-0.17.6 webpack/ForemanTasks/Components/common/ActionButtons/ResumeButton.test.js
foreman-tasks-1.0.0 webpack/ForemanTasks/Components/common/ActionButtons/ResumeButton.test.js
foreman-tasks-0.17.5 webpack/ForemanTasks/Components/common/ActionButtons/ResumeButton.test.js
foreman-tasks-0.17.4 webpack/ForemanTasks/Components/common/ActionButtons/ResumeButton.test.js
foreman-tasks-0.17.3 webpack/ForemanTasks/Components/common/ActionButtons/ResumeButton.test.js
foreman-tasks-0.17.2 webpack/ForemanTasks/Components/common/ActionButtons/ResumeButton.test.js
foreman-tasks-0.17.1 webpack/ForemanTasks/Components/common/ActionButtons/ResumeButton.test.js