-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
@@ -56,7 +54,7 @@ export default (Component, options: Conformant = {}) => { | |||
const componentType = typeof Component | |||
|
|||
const helperComponentNames = [ | |||
...[ThemeProvider, FelaTheme, Ref, RefFindNode], |
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.
ThemeProvider
is not needed anymore as we usewrappingComponent
FelaTheme
is not needed because we useThemeContext
directly perf(renderComponent): drop FelaTheme and use React.Context directly #1163
@@ -1075,7 +1075,7 @@ describe('Dropdown', () => { | |||
|
|||
expect(wrapper.find(Dropdown).state('searchQuery')).toBe('foo') | |||
|
|||
wrapper.setProps({ children: <Dropdown items={items} search searchQuery="bar" /> }) |
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 update also eliminates this craziness: previously we should update whole tree...
wrapper: wrapperWrapper, | ||
portal: wrapper, | ||
} | ||
} |
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 stuff was removed to make tests more clear
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.
|
@@ -408,7 +405,7 @@ export default (Component, options: Conformant = {}) => { | |||
'data-simulate-event-here': true, | |||
} | |||
|
|||
const component = mount(<Component {...props} />).childAt(0) |
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.
We don't need this because ThemeProvider
is now outside the tree
Cut from #1459.
Problem
ThemeProvider
was part of produced tree by Enzyme, it means that we should always should to call.find()
method to get actualButton
component. Also, withfela
upgradeThemeProvider
become stateless component and it was impossible to use.state()
method of Enzyme anymore.Solution
Use
wrappingComponent
component option ofshallow
/mount
that 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