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

react-is@16.12.0 changed the behavior of isMemo function, which cause enzyme selector fail. #2297

Closed
2 of 13 tasks
changran52m opened this issue Nov 27, 2019 · 9 comments
Closed
2 of 13 tasks

Comments

@changran52m
Copy link

changran52m commented Nov 27, 2019

Current behavior

https://codesandbox.io/s/gracious-sun-qih2n broken
https://codesandbox.io/s/agitated-firefly-ows1l working

Expected behavior

console.log("Icon is icon?:", mount().is(EditIcon)); // true

Your environment

React + Enzyme

Root cause

Please check in detail here facebook/react#17278

Proposal:

  1. fix the is function call to isMemo to take component.type instead of component itself.
  2. pin the dependency of react-is to 16.11.0

API

  • shallow
  • mount
  • render

Version

library version
enzyme 3.10.0
react 16.12.0
react-dom
react-test-renderer
adapter (below) 15.1

Adapter

  • enzyme-adapter-react-16
  • enzyme-adapter-react-16.3
  • enzyme-adapter-react-16.2
  • 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 ( )

Related issue facebook/react#17457
Related issue facebook/react#17278

@ljharb
Copy link
Member

ljharb commented Nov 27, 2019

Yes, this is blocking #2292.

If you think you have a fix that's not pinning to 16.11, please link me to a branch and I'll pull in the commit :-)

@lh0x00
Copy link
Contributor

lh0x00 commented Nov 28, 2019

If you think you have a fix that's not pinning to 16.11, please link me to a branch and I'll pull in the commit :-)

I created #2298 , please review it :) .

@ljharb
Copy link
Member

ljharb commented Nov 28, 2019

Thanks; i was hoping for a branch instead of a second PR, but I’ll take a look.

@lh0x00
Copy link
Contributor

lh0x00 commented Nov 30, 2019

I closed PR #2298 and created #2300 . Please check it again.

@ljharb

This comment has been minimized.

@lh0x00

This comment has been minimized.

@ljharb

This comment has been minimized.

@lh0x00

This comment has been minimized.

@ljharb
Copy link
Member

ljharb commented Dec 19, 2019

Fixed in #2300.

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

Successfully merging a pull request may close this issue.

3 participants