I'm trying to simulate a scroll event with ReactJS and JSDOM.
Initially I tried the following:
var footer = TestUtils.findRenderedDOMComponentWithClass(Component, 'footer');
footer.scrollTop = 500;
TestUtils.Simulate.scroll(footer.getDOMNode());
//I tried this as well, but no luck
//TestUtils.Simulate.scroll(footer);
The scroll event is not propagated at all. Then, I've manually created the event and everything worked fine:
var evt = document.createEvent("HTMLEvents");
evt.initEvent("scroll", false, true);
element.dispatchEvent(evt);
Question: Am I doing something wrong with the TestUtils? How can I make that to work?