Describe the bug
The new React context elements (https://reactjs.org/docs/context.html) report their type as objects instead of functions (custom react components) or strings (native react components), which breaks dive(). I haven't tested whether other methods of ShallowWrapper break.
To Reproduce
https://codesandbox.io/s/zxj4898zxp?module=%2Fsrc%2FApp.test.js
Expected behavior
shallow and dive should implement actual render semantics when handling the new context API:
- Automatically update current context whenever a context provider is encountered and remove the provider node from the tree.
- Automatically pass the current context to childs of context consumer nodes and remove the consumer node from the tree.
I'm sure the above are not the exact semantics, but at least the most intuitive.
Describe the bug
The new React context elements (https://reactjs.org/docs/context.html) report their type as objects instead of functions (custom react components) or strings (native react components), which breaks
dive(). I haven't tested whether other methods ofShallowWrapperbreak.To Reproduce
https://codesandbox.io/s/zxj4898zxp?module=%2Fsrc%2FApp.test.js
Expected behavior
shallowanddiveshould implement actual render semantics when handling the new context API:I'm sure the above are not the exact semantics, but at least the most intuitive.