wyze / bs-react-testing-library

BuckleScript bindings for react-testing-library.
https://yarn.pm/bs-react-testing-library
MIT License
36 stars 15 forks source link

FireEvent #11

Closed justinba1010 closed 4 years ago

justinba1010 commented 4 years ago

I have a branch where I was working on a transition to JSX 3, and I am having some trouble figuring out how to invoke FireEvent. After reading the source, it seems that it should correctly link to bs-dom-testing-library, will look into it more.

Feel free to checkout the FireEvent example I have up. https://github.com/justinba1010/bs-react-testing-library/tree/jsx3-fire-event

wyze commented 4 years ago

Here you can see an example of a test working: https://github.com/wyze/reason-calculator/blob/3fc8340b59bbac6cded5d627f945cf2e98d78f86/src/components/__tests__/App_test.re#L57

In your test on your branch, you are firing a click event on the container, not the element being rendered into the container. You need to either select the element or use firstChild and it should work as expected.

justinba1010 commented 4 years ago

Ok, I'll see if I can fix that, thank you! Are you interested in a JS X 3 PR?

justinba1010 commented 4 years ago

Closing because this is an erroneous issue.

wyze commented 4 years ago

Are you interested in a JS X 3 PR?

Sure!

justinba1010 commented 4 years ago

I can put one up, but we're still figuring out the issue on our side. It seems that 0.5.0 works perfectly well for us. Once we figure it out, I can go ahead and put up a PR for JS X 3, but you're right it doesn't matter if its JS X 2, or 3.

Edit: Also thanks so much for the library, tremendous help for us!