Having following code:
it('componentDidUpdate should mount and change props', () => {
const onChange = jest.fn();
const wrapper = enzyme
.mount(
<JsonInput
onChange={onChange}
onValueChange={mockOnValueChange}
value={exampleJsonStringValidated}
/>,
{ wrappingComponent: withTestThemeWrapper },
);
expect(wrapper.find(JsonInput).hasClass(':valid')).toEqual(false);
wrapper.setProps({ value: exampleJsonStringNotValidated });
expect(wrapper.find(JsonInput).hasClass(':invalid')).toBe(false);
});
Gave me:
TypeError: Cannot read property 'target' of null
I was trying to pass onChange
as onChange
and onChange()
but does not work.
I would appreciate any help.