Closed linzhaoqiang closed 2 years ago
What is component.debug()
?
console.log src/App.test.js:48
<ContextConsumer>
[function]
</ContextConsumer>
ok, so since it's shallow, it looks like you need another .dive()
there - it needs one .dive()
per HOC.
I tried component.dive().debug()
and returned <Func intl...}} />
and still couldn't find the element I wanted
and component.dive().dive().debug()
?
Oh, it works, but there's only one HOC. Why do you need two dive()
?
because there's obviously more than one HOC :-) injectIntl
must use two, not one, and that implementation detail isn't something enzyme can hide.
OK, thank you very much for your patience. 👍 :-)
When I tested the class component using enzyme + jest, I found that the component rendered the result I wanted, using the format*() method of injectIntl in the react-intl library.
Api
Version
Adapter