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-adapter-react-{16,16.3}] [fix] forwardRef: respect .displayName #1817

Merged
merged 1 commit into from
Sep 12, 2018

Conversation

ljharb
Copy link
Member

@ljharb ljharb commented Sep 11, 2018

Fixes #1810.

Copy link
Collaborator

@jgzuke jgzuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth testing the .find() behaviour as seen in the original ticket

Out of curiosity, why are 16.1 and 16.2 adapters missing a bunch of special cases in displayNameOfNode that exist in 16.0 or 16.3 (https://github.com/airbnb/enzyme/blob/master/packages/enzyme-adapter-react-16/src/ReactSixteenAdapter.js#L442 vs https://github.com/airbnb/enzyme/blob/master/packages/enzyme-adapter-react-16.1/src/ReactSixteenOneAdapter.js#L420)?

@ljharb
Copy link
Member Author

ljharb commented Sep 12, 2018

@jgzuke because the 16 adapter is for 16.0 - 16.5, but the 16.3 adapter is only for 16.3, and those special cases are only in 16.3+.

@ljharb
Copy link
Member Author

ljharb commented Sep 12, 2018

I don't think it's really worth it; the original issue's repro requires styled-components, but in general, if it shows up in .debug(), it's findable.

@ljharb ljharb merged commit d2c06d9 into master Sep 12, 2018
@ljharb ljharb deleted the forward_ref_displayname branch September 12, 2018 23:16
@quantizor
Copy link

Thanks Jordan!

@darkowic
Copy link

Hello there! Will it be released anytime soon?

ljharb added a commit that referenced this pull request Oct 5, 2018
 - [new] add `isCustomComponentElement` (#1832)
 - [fix] `forwardRef`: respect `.displayName` on the forwardRef (#1817)
 - [deps] update `babel-preset-airbnb`, `chai`, `eslint`, `mocha`, `enzyme-adapter-utils`, `react-is`, `airbnb-js-shims`
ljharb added a commit that referenced this pull request Oct 5, 2018
 - [new] add `isCustomComponentElement` (#1832)
 - [fix] (<= v16.2) ensure that `this.state` starts out `null` when unspecified on a custom component (#1849)
 - [fix] `forwardRef`: respect `.displayName` on the forwardRef (#1817)
 - [deps] update `babel-preset-airbnb`, `chai`, `eslint`, `mocha`, `enzyme-adapter-utils`, `react-is`, `airbnb-js-shims`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants