jquense / teaspoon

A jQuery like API for testing React elements and rendered components.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trigger on Shallow Render does not Bubble

jacobp100 opened this issue · comments

const onChange = sinon.stub();
const $element = (
  <div onChange={onChange}>
    <input/>
  </div>
);

$element.find(`input`).trigger(`change`);

expect(onChange.called).toEqual(true);

you are correct! For the moment there is no real way for doing anything about that without writing a javascript implementation of the entire DOM event system, which is fairly out of scope for this little project.