I\'m confused about how to access value when using mount. Here\'s what I\'ve got as my test:
it(\'cancels changes w
Got it. (updated/improved version)
it('cancels changes when user presses esc', done => {
const wrapper = mount( );
const input = wrapper.find('input');
input.simulate('focus');
input.simulate('change', { target: { value: 'Changed' } });
input.simulate('keyDown', {
which: 27,
target: {
blur() {
// Needed since calls target.blur()
input.simulate('blur');
},
},
});
expect(input.get(0).value).to.equal('Hello');
done();
});