These are chat archives for airbnb/enzyme

12th
Dec 2017
Dan
@danielhazrati
Dec 12 2017 10:17

Hey all, I've recently upgraded to React 16 / Enzyme 3.2 but I'm having some difficulty passing additional params to .simulate()

Example:

              onClick={e => {
                console.log(e)
                if (e && e.stopPropagation) {
                  e.stopPropagation()
                }
                props.buttonHandler(player.getId())
              }}

e is undefined after calling handler like such:

    component
      .find('Button')
      .first()
      .simulate('click', {
        stopPropagation: () => {}
      })

Has anyone had any similar issues?

unfalse
@unfalse
Dec 12 2017 16:47
Hello, please look my issue with changing select value airbnb/enzyme#1427
Jordan Harband
@ljharb
Dec 12 2017 18:45
i would recommend avoiding .simulate entirely.
@danielhazrati did it work on react 15 and enzyme 3.2?