Using the "when deeply rendered" assertion on an element created with the styled-components library, v4+, fails in strange ways due to the result being misidentified as the RenderedReactElementData type. If (as is typical) another assertion follows this, no meaningful error is given, the assertion simply fails with no message, identifying a location in unexpected itself as the fault location.
It seems likely that this is due to styled-components v4 using React.forwardRef. This seems to foil the identification of RenderedReactElement types somehow.
Using the "when deeply rendered" assertion on an element created with the styled-components library, v4+, fails in strange ways due to the result being misidentified as the
RenderedReactElementData
type. If (as is typical) another assertion follows this, no meaningful error is given, the assertion simply fails with no message, identifying a location in unexpected itself as the fault location.It seems likely that this is due to styled-components v4 using
React.forwardRef
. This seems to foil the identification ofRenderedReactElement
types somehow.