Fix tests related to Enzyme and React Context API #12625
Labels
component:code_quality
component:testing
migration:no-jira
migration:2024
qa:not_needed
repository:addons-frontend
Issue relating to addons-frontend
state:stale
Issues marked as stale. These can be re-opened should there be plans to fix them.
In #12611, we upgraded
react-cookie
, which relies on the React stable Context API. Enzyme does not support it though (not for shallow rendering): enzymejs/enzyme#1647.The workaround is to disable the HOC (with
jest.mock
) and to injectcookies
to the component under test manually. Ideally, we should not have to do this. Once Enzyme supports the Context API better, we should remove those workarounds.The text was updated successfully, but these errors were encountered: