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

Fix .toHaveTextContent("") causing false positive #138

Merged

Conversation

kandros
Copy link
Contributor

@kandros kandros commented Oct 5, 2019

What:

fix #104

Why:

It can cause false-positive tests passing

How:

throwing when matching against an empty string, suggesting to use .toBeEmpty() instead

Checklist:

  • Documentation N/A
  • Tests
  • Updated Type Definitions N/A
  • Ready to be merged

@kandros kandros changed the title Fix to have text content empty string Fix .toHaveTextContent empty string causing false positive Oct 5, 2019
@kandros kandros changed the title Fix .toHaveTextContent empty string causing false positive Fix .toHaveTextContent("") causing false positive Oct 5, 2019
@kandros kandros force-pushed the fix-toHaveTextContent-empty-string branch from 5dc0e7a to 5fab8a4 Compare October 5, 2019 13:36
@gnapse gnapse merged commit cdc8a06 into testing-library:master Oct 7, 2019
@gnapse
Copy link
Member

gnapse commented Oct 7, 2019

@all-contributors please add @kandros for bug, test

@allcontributors
Copy link
Contributor

@gnapse

I've put up a pull request to add @kandros! 🎉

@gnapse
Copy link
Member

gnapse commented Oct 7, 2019

🎉 This PR is included in version 4.1.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 this pull request may close these issues.

toHaveTextContent("") matches element with non-empty content
2 participants