This repository was archived by the owner on Mar 4, 2020. It is now read-only.
Merged
Conversation
layershifter
commented
Jun 7, 2019
| const componentType = typeof Component | ||
|
|
||
| const helperComponentNames = [ | ||
| ...[ThemeProvider, FelaTheme, Ref, RefFindNode], |
Member
Author
There was a problem hiding this comment.
ThemeProvideris not needed anymore as we usewrappingComponentFelaThemeis not needed because we useThemeContextdirectly perf(renderComponent): drop FelaTheme and use React.Context directly #1163
layershifter
commented
Jun 7, 2019
|
|
||
| expect(wrapper.find(Dropdown).state('searchQuery')).toBe('foo') | ||
|
|
||
| wrapper.setProps({ children: <Dropdown items={items} search searchQuery="bar" /> }) |
Member
Author
There was a problem hiding this comment.
This update also eliminates this craziness: previously we should update whole tree...
layershifter
commented
Jun 7, 2019
| wrapper: wrapperWrapper, | ||
| portal: wrapper, | ||
| } | ||
| } |
Member
Author
There was a problem hiding this comment.
This stuff was removed to make tests more clear
Collaborator
Generated by 🚫 dangerJS |
Codecov Report
@@ Coverage Diff @@
## master #1469 +/- ##
=========================================
Coverage ? 73.45%
=========================================
Files ? 806
Lines ? 6088
Branches ? 1798
=========================================
Hits ? 4472
Misses ? 1610
Partials ? 6
Continue to review full report at Codecov.
|
bmdalex
approved these changes
Jun 10, 2019
layershifter
commented
Jun 10, 2019
| 'data-simulate-event-here': true, | ||
| } | ||
|
|
||
| const component = mount(<Component {...props} />).childAt(0) |
Member
Author
There was a problem hiding this comment.
We don't need this because ThemeProvider is now outside the tree
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Cut from #1459.
Problem
ThemeProviderwas part of produced tree by Enzyme, it means that we should always should to call.find()method to get actualButtoncomponent. Also, withfelaupgradeThemeProviderbecome stateless component and it was impossible to use.state()method of Enzyme anymore.Solution
Use
wrappingComponentcomponent option ofshallow/mountthat was introduced in new versions of Enzyme.https://github.com/airbnb/enzyme/blob/master/docs/api/shallow.md#shallownode-options--shallowwrapper
Before update
After update