You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I have a fairly simple component that takes advantage of React 16 and renders multiple elements, <p> to be precise. It changes a string or an array of strings to a paragraph or an array of paaragrahps, respectively. One of my test cases is like so:
I'd expect that in this case .html() would return either a string as provided above in my expect().toBe() or an array of three strings. Instead, this ends in a following error:
Trying to get host node of an array
at _nodeToHostNode (../node_modules/enzyme-adapter-react-16/build/ReactSixteenAdapter.js:172:11)
at ReactSixteenAdapter.nodeToHostNode (../node_modules/enzyme-adapter-react-16/build/ReactSixteenAdapter.js:421:16)
at ReactWrapper.<anonymous> (../node_modules/enzyme/build/ReactWrapper.js:823:30)
at ReactWrapper.single (../node_modules/enzyme/build/ReactWrapper.js:1534:25)
at ReactWrapper.html (../node_modules/enzyme/build/ReactWrapper.js:820:21)
at Object.<anonymous> (components/_common/__tests__/Paragraph.jsx:141:50)
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hey @wojtekmaj, we still don't have array-rendered support in the 16 adapter, though I don't think it will be difficult to add. I appreciate your patience at this time.
If you're interested, opening up a PR with this as a test would be a great start... and you could even try to patch up some of what's going on here. But that's up to you. I will be addressing this soon...
Hi!
I have a fairly simple component that takes advantage of React 16 and renders multiple elements,
<p>
to be precise. It changes a string or an array of strings to a paragraph or an array of paaragrahps, respectively. One of my test cases is like so:I'd expect that in this case
.html()
would return either a string as provided above in myexpect().toBe()
or an array of three strings. Instead, this ends in a following error:Thanks in advance!
The text was updated successfully, but these errors were encountered: