import {shallow} from 'enzyme'; import React from 'react'; import ActorTile from './ActorTile'; describe('', function () { it('renders without crashing ', function () { const wrapper = shallow(); wrapper.unmount(); }); it('simulate click', function () { const wrapper = shallow(); const func = jest.fn(); prepareViewBinding(func); wrapper.simulate('click'); expect(func).toBeCalledTimes(1); }); it('simulate click with custom handler', function () { const func = jest.fn((_) => {}); const wrapper = shallow( func()}/>); const func1 = jest.fn(); prepareViewBinding(func1); wrapper.simulate('click'); expect(func1).toBeCalledTimes(0); expect(func).toBeCalledTimes(1); }); });