Add tests for the Draggable component when rendered into an iframe#182
Merged
STRML merged 1 commit intoreact-grid-layout:masterfrom Jul 27, 2016
Merged
Add tests for the Draggable component when rendered into an iframe#182STRML merged 1 commit intoreact-grid-layout:masterfrom
STRML merged 1 commit intoreact-grid-layout:masterfrom
Conversation
I was unable to get these tests working using TestUtils’ renderIntoDocument function (or the various find* helpers) for these tests and had to use actual ReactDOM.render instead along with regular querySelector. Has something to do with the tricky parts of react-frame-component (rendering an iframe with React).
Contributor
Author
|
Just noticed that these new tests brings the number of tests running in CI up to 111, which strikes me as highly auspicious. 😉 |
Collaborator
|
|
Collaborator
|
Thanks for the contribution! |
Contributor
Author
|
My pleasure! And thanks to you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add tests for #180 (all passing ✅ )
Note that I was unable to get these tests working using TestUtils’
renderIntoDocumentfunction (or the variousfind*helpers) and had to use actualReactDOM.renderalong withquerySelectoron the returned DOM node to make assertions on the rendered results. Has something to do with the tricky parts of react-frame-component (rendering an iframe with React), and looking at the react-frame-component tests, they take the same approach.As a result of needing to use ReactDOM.render, I had to add a setTimeout before selecting the rendered nodes from the DOM to avoid the tests breaking in Firefox. Here’s the error I saw when I tried to select the nodes synchronously:
I had another weird seemingly unrelated test failure on Firefox that I worked around by rounding the mouse event’s
deltaYin the onDrag function’s assertions. Here’s that error: