These are chat archives for airbnb/enzyme

Feb 2016
Feb 25 2016 14:52
Hello, I got a quick question, how do you simulate a input value change event and assert on the value, or assert onChange handler been called?
it('updates value on input change', function() {
    const changeSpy = sinon.spy();
    const wrapper = shallow(<Input value={'123'}
      handleChange={changeSpy} pos={1} />);
    wrapper.find('input[type=text]').simulate('change', '321');
Jordan Harband
Feb 25 2016 16:45
currently you have to fire the change event and set the value manually
Blaine Kasten
Feb 25 2016 17:00
@janusch, does the internals of Input have an onChange handle for input that calls the prop.handleChange?