Skip to content
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

Merged
merged 9 commits into from
Oct 26, 2017
Merged

Upgrade jest to v21 #103

merged 9 commits into from
Oct 26, 2017

Conversation

cjies
Copy link
Contributor

@cjies cjies commented Oct 25, 2017

Implement

  • Upgrade jest to v21.2.1.
  • Upgrade coveralls and sinon libraries to latest.

Fix bugs:

  • [Checkbox] Update indeterminate attr after the checkbox input element was generated.
  • [InfiniteScroll] Attach scroll listener when the scrollNode is existing.
  • [storybook] Fix stories.

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

@cjies cjies requested a review from zhusee2 October 25, 2017 10:15
@cjies
Copy link
Contributor Author

cjies commented Oct 25, 2017

@@ -57,7 +57,9 @@ class Checkbox extends PureComponent {
}

updateInputIndeterminate() {
this.inputRef.indeterminate = this.props.indeterminate;
if (this.inputRef) {
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@cjies
Copy link
Contributor Author

cjies commented Oct 26, 2017

Rebased with latest develop

@zhusee2
Copy link
Contributor

zhusee2 commented Oct 26, 2017

good to go

@cjies cjies merged commit faf1824 into develop Oct 26, 2017
@cjies cjies deleted the CJ/upgrade_jest branch October 26, 2017 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants