This repository has been archived by the owner on Aug 13, 2023. It is now read-only.
Deep snapshots have ForwardRef instead of component names #95
Labels
blocked
This issue should not be worked on until another internal issue is completed - see desc for details
bug
Something isn't working
Refinement Needed
This is ready for refinement. It shouldn't be worked on until it has been refined by Dev & Test.
Projects
Describe the bug
When using deep rendering with
styled-components
V4, snapshot references to other React components are replaced with<ForwardRef />
. An example of this is visible in the original Simorgh PR for styled-components V4.Luckily, as most Psammead components are currently only composed to a depth of 1, this isn't yet visible in this repo. However, it will become an issue as we introduce more complex or nested components.
Possible Solutions/Approaches
This issue is caused by our dependency
jest-styled-components
. If we stick with using jest-styled-components alone, we will have to await or contribute to their resolution of this issue. They have a ticket on it here. We could potentially contribute to the PRs that spawn out of it if we considered it a high priority.Alternatively, if we are evaluating using Enzyme or react-testing-library alongside jest-styled-components, one of the benefits from either of these moves would be that this would no longer be an issue.
The text was updated successfully, but these errors were encountered: