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

Fragments in ReactWrapper are not rendered with html() if children are functions #2052

Closed
5 of 13 tasks
atsikov opened this issue Mar 14, 2019 · 6 comments
Closed
5 of 13 tasks

Comments

@atsikov
Copy link

atsikov commented Mar 14, 2019

I believe this issue is related to #2006 not being fully fixed.

This issue only affects ReactWrapper, ShallowWrapper seems to work fine.

Current behavior

.html() doesn't show children created from functions when component is wrapped with fragment.

Expected behavior

.html() returns exact markup if rendered children are either classes or functions.

Your environment

https://codesandbox.io/s/032mpxq6rv

API

  • shallow
  • mount
  • render

Version

library version
enzyme 3.9.0
react 16.7.0
react-dom 16.7.0
react-test-renderer
adapter (below) 1.11.2

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 ( )
@atsikov atsikov changed the title Fragments are not rendered with html() if children are functions Fragments in ReactWrapper are not rendered with html() if children are functions Mar 14, 2019
@atsikov
Copy link
Author

atsikov commented Mar 14, 2019

Tried a few enzyme-adapter-react-16 versions, looks like this issue is a regression 1.8.0 -> 1.9.0

@ljharb
Copy link
Member

ljharb commented Mar 15, 2019

Thanks, this was a very helpful repro.

@ljharb ljharb closed this as completed in 558d5cf Mar 15, 2019
@atsikov
Copy link
Author

atsikov commented Apr 23, 2019

@ljharb, as I can see, fix was released, but this test case still fails with enzyme-adapter-react-16@1.12.1

@atsikov
Copy link
Author

atsikov commented Apr 23, 2019

Repro fork with updated adapter version
https://codesandbox.io/s/n9v3j8p164

@ljharb
Copy link
Member

ljharb commented Apr 23, 2019

@atsikov it has not yet been released in enzyme proper; it will be included in the next one.

@ljharb
Copy link
Member

ljharb commented Jun 4, 2019

v3.10.0 has now been released.

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

No branches or pull requests

2 participants