We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems that as per the documentation toMatchElement is meant to match on props, however when the prop is an array it ignores the content.
Ex:
it("renders 5 0's", () => { const wrapper = shallow(<MyComponent />) expect(wrapper).toMatchElement(<MyRow row={[0, 0, 0, 0]} />) );
This would successfully match on:
<MyRow row={["some", "random", "values"]} />
The text was updated successfully, but these errors were encountered:
So, the logic for matching element is actually really simple. It just runs enzyme's debug() method and compares the strings.
debug()
I did a test and enzyme masks objects and arrays. This is unexpected, I thought it used to work..
Either way, I've got a ticket going with Enzyme to see where the fix lies: enzymejs/enzyme#1476
Sorry, something went wrong.
I put up a PR in enzyme for this. So hopefully this will get fixed soon
toMatchElement
No branches or pull requests
It seems that as per the documentation toMatchElement is meant to match on props, however when the prop is an array it ignores the content.
Ex:
This would successfully match on:
The text was updated successfully, but these errors were encountered: