I have a react component(this is simplified in order to demonstrate the issue):
class MyComponent extends Component { handleNameInput = (value) => {
@Miha's answer worked with a small change:
it('handleNameInput', () => { let wrapper = shallow(); const searchDishMock = jest.fn(); wrapper.instance().searchDish = searchDishMock; wrapper.update(); wrapper.instance().handleNameInput('BoB'); expect(searchDishMock).toBeCalledWith('BoB'); })