Sha256: 29a4eb334c8fe30fae3abae0ce220e05c9b01d7495849a03916062ffb59db81a
Contents?: true
Size: 737 Bytes
Versions: 5
Compression:
Stored size: 737 Bytes
Contents
import React from 'react'; import { testComponentSnapshotsWithFixtures, shallow } from '@theforeman/test'; 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
5 entries across 5 versions & 1 rubygems