-
Notifications
You must be signed in to change notification settings - Fork 2
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
Upgrade jest to v21 #103
Upgrade jest to v21 #103
Conversation
Enzyme migration guide: |
packages/core/src/Checkbox.js
Outdated
@@ -57,7 +57,9 @@ class Checkbox extends PureComponent { | |||
} | |||
|
|||
updateInputIndeterminate() { | |||
this.inputRef.indeterminate = this.props.indeterminate; | |||
if (this.inputRef) { |
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.
This makes coverage drops slightly. Wanna cover this?
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, i will fix it
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.
This change is make for enzyme v3 previously. But i misunderstood the real reason that make the test failed, so I revert it back first.
In v3, ref
callback will not fired in shallow test. Since ref
is actual returned a DOM, but shallow test do not handled it. But shallow test still support some life cycle methods. (Check enzymejs/enzyme#318)
So the better solution is use mount()
API to test the component which use ref
to some action.
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.
In next PR, I will switch the shallow()
to mount()
in checkbox test.
This change is made for enzyme v3 previously. During v3, ref wont be called in shallow test, use mount() API instead.
b32a64c
to
5aa9045
Compare
Rebased with latest |
good to go |
Implement
v21.2.1
.Fix bugs:
[Checkbox] Updateindeterminate
attr after the checkbox input element was generated.scrollNode
is existing.Note
Actually I plan to upgrade enzyme to v3 too, but much APIs are changed and this issue... 😕
I need more times to fix them XD