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

Unexpected behavior with legacy context (both shallow and mount) #2114

Open
3 of 13 tasks
ms opened this issue Apr 28, 2019 · 1 comment
Open
3 of 13 tasks

Unexpected behavior with legacy context (both shallow and mount) #2114

ms opened this issue Apr 28, 2019 · 1 comment
Labels

Comments

@ms
Copy link

ms commented Apr 28, 2019

Current behavior

Cannot test legacy context behavior (mount and shallow, on the providing and on the consuming component) → .context either throws or returns an empty context depending on how it's used.

Expected behavior

.context returns the context somehow (after .dive or not, I'm not positive what the correct behavior should be)

Your environment

Original issue was on React 16.2. Reproduction on React 16.8: https://codesandbox.io/s/oqo7nvxp2q (Notice the app works but the tests fail)

API

  • shallow
  • mount
  • render

Version

library version
enzyme 3.9.0
react 16.8.6
react-dom 16.8.6
react-test-renderer N/A
adapter (below) 1.12.1 (react-16)

Adapter

  • enzyme-adapter-react-16
  • enzyme-adapter-react-16.3
  • enzyme-adapter-react-16.2 (← also the case here, but not for the above code sandbox)
  • enzyme-adapter-react-16.1
  • enzyme-adapter-react-15
  • enzyme-adapter-react-15.4
  • enzyme-adapter-react-14
  • enzyme-adapter-react-13
  • enzyme-adapter-react-helper
  • others ( )
@craigkovatch
Copy link

Broken for me, too. Same environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants