in order to test a react App with enzyme, the app can be "mounted".
Code: Select all
var app_wrapper = mount(<App />);
For a Button:
Code: Select all
var button = app_wrapper.find('Button[<selector>]');
Code: Select all
var input= app_wrapper.find('InputText[<selector>]');
Code: Select all
var slider= app_wrapper.find('Slider[<selector>]');
Code: Select all
button .simulate("click"); // OK
input.simulate('change', { target: { value: "__TEXT__" } }); // OK.
But it seems, it doesn't work for a slider (not for a Dropdown) widget.
Code: Select all
slider.simulate('change', { target: { value: "55" } }); // does not work
slider.simulate('change', { value: "55" } ); // does not work
I didn't try other widgets.
Any tipps ?
Thanks in advance.
PS: Maybe I posted this twice. Sorry.