How do you simulate an keyDown enter event (or others) in Enzyme?
I'm using 'shallow' mount (Enzyme 3.7.0 with Jest 23.6.0). This work for me:
const input = wrapper.find('input');
input.simulate('change', { target: { value: 'abcdefg'} });
input.simulate('keydown', { keyCode: 13 });
Instead of using a keyCode, I used a key, in the case of 'Enter', using mount
:
wrapper.find('input').simulate('keypress', {key: 'Enter'})