Sha256: 86f1b129393600fc4b4d9a0d05160ce2931bcae69c73a84fb172750b17e230a5
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 { CancelButton } from './CancelButton'; const fixtures = { 'render with minimal props': { id: 'some-id', name: 'some-name', }, }; describe('CancelButton', () => { describe('rendering', () => testComponentSnapshotsWithFixtures(CancelButton, fixtures)); describe('should use id and name on click', () => { const onClick = jest.fn(); const id = 'some-id'; const name = 'some-name'; const component = shallow( <CancelButton 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