-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Slide] Add test coverage for componentDidMount()
#6679
Conversation
src/transitions/Slide.spec.js
Outdated
instance = mountWrapper.instance(); | ||
instance.componentDidMount(); | ||
assert.strictEqual( | ||
ReactDOM.findDOMNode(mountWrapper.instance().transition).style.transform, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for saving me the time of finding out what this is all about. Regardless it is a bad styled line. I'll work on this. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had that issue some time ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Read the entire thread, both on the React repo and our internal issue. Not sure how to overcome this. What if findDOMNode
returns Text here? Why would that happen? Should I throw an error then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about ignoring that issue? It's testing after all, how cares to be safe?
We could create a $FlowIgnore
type for that case: https://flow.org/en/docs/config/options/#toc-suppress-type-string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, we could be using if (X instanceof HTMLElement)
but that might fails with some old browser through browserstack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put in a change for usage of instanceof
. If it doesn't fail that is best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Reallllllyyy weird behaviour. Will look into creating our own $FlowIgnore
@agamrafaeli This one is tough, some weird fails 😆 ! |
7cf8d3c
to
e4800de
Compare
} | ||
|
||
return 'translate3d(0, 0, 0)'; | ||
// direction === 'down' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have cherry-picked that changed into #6911, good catch 👍 !
But I'm closing this PR as has been inactive for quite some time. The test is inconsistent across the different browser. I'm not sure what's going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I actually knew I needed to deal with it and didn't get around. Thanks!
No description provided.