Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enzyme and React 16 workarounds #11214

Closed
3 tasks
oandregal opened this issue Oct 29, 2018 · 2 comments
Closed
3 tasks

Enzyme and React 16 workarounds #11214

oandregal opened this issue Oct 29, 2018 · 2 comments
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Comments

@oandregal
Copy link
Member

This issue is to document the workarounds that we have in place to work with some of React 16 features that aren't supported by Enzyme yet. For reference, enzymejs/enzyme#1553 is where the enzyme project is tracking their support of React 16 features.

At the time of creating this issue, we're still using enzyme 3.3.0 and enzyme-adapter-react-16 1.1.1 but the latest releases are 3.7.0 and 1.6.0. Some of the issues may have been fixed.

  • Mock for forwardRef in Button.
  • BlockContros's skipped test.
  • Only supports the legacy context API.
@oandregal oandregal added the Framework Issues related to broader framework topics, especially as it relates to javascript label Oct 29, 2018
@aduth
Copy link
Member

aduth commented Feb 27, 2019

cc @gziolo with consideration of progress in enzymejs/enzyme#1553 and enzymejs/enzyme#1604 , the current workarounds might no longer be necessary given our recent upgrade to enzyme and enzyme-adapter-react in #13922 . (There's also been another release of enzyme-adapter-react since then).

I'll poke around a bit to get a better sense of where things stand.

@aduth aduth added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Feb 27, 2019
@gziolo
Copy link
Member

gziolo commented Mar 4, 2019

Nice work @aduth. I wasn't sure whether we want to fix those workarounds with the updated Enzyme API or replace them with React test utils. The approach you took is probably better as it is less work :) We have over 80 test suites using enzyme so I bet we are in a position where we will have to support it for quite some time knowing that they will always be a few weeks or even months behind React releases. I hope that at some point we will build our own abstractions which will allow to replace shallow, mount and render easily. We are not there yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

No branches or pull requests

3 participants