import { shallow } from 'enzyme' const props = { onClick: jest.fn() } const wrapper = <App {...props} /> const domNode = document.querySelector('#root') const component = shallow(wrapper, domNode) const selector = '.fld-input' const eventName = 'change' const eventInfo = { target: { value: 'hello' }} component.find(selector).simulate(eventName, eventInfo) expect(component.value()).toBe('hello')
Last updated 5 years ago
Was this helpful?