I'm trying to test a react component children and I wanted to get a text representation of its children.
Is there a tool that does something similar to node.textContent
for React?
I would like to have something like this:
let testComponent = (
<Test>
<p>abc</p>
<p>abc2</p>
</Test>
);
expect(testComponent.props.children.toString()).to.equal('abc abc2');
from React: Is there something similar to node.textContent?
No comments:
Post a Comment