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

toHaveClass(..., { exact: true })'s Received/Expected output is buggy #397

Closed
nstepien opened this issue Aug 24, 2021 · 1 comment · Fixed by #405
Closed

toHaveClass(..., { exact: true })'s Received/Expected output is buggy #397

nstepien opened this issue Aug 24, 2021 · 1 comment · Fixed by #405
Labels

Comments

@nstepien
Copy link

  • @testing-library/jest-dom version: 5.14.1
  • node version: v16.7.0
  • npm (or yarn) version: 7.21.0
  • @testing-library/react version: 12.0.0

Relevant code or config:

expect(document.body).toHaveClass('abc', { exact: true });

What you did:

Testing an element's exact class

What happened:

When the assertion fails, the output is garbled:

image

Reproduction:

See relevant code above.

Problem description:

Well it's not the expected output that's for sure.

Suggested solution:

Should work similarly to when exact: false is used:

image

@github-actions
Copy link

github-actions bot commented Dec 6, 2021

🎉 This issue has been resolved in version 5.16.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants