Skip to content

feat: toBeValid supports <form/> element #127

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

Merged

Conversation

jsphstls
Copy link
Contributor

@jsphstls jsphstls commented Aug 19, 2019

What:

toBeValid and toBeInvalid currently support checks against input elements by calling checkValidity().

also responds to checkValidity().

Why:

Discussed in this issue:
#125

How:

Added 'form' to the list of tags that can be checked by toBeValid and toBeInvalid.

Checklist:

  • [ x] Documentation
  • Tests
  • Updated Type Definitions "N/A"
  • Ready to be merged

@gnapse
Copy link
Member

gnapse commented Aug 20, 2019

@jsphstls this looks good. Thanks again!

I wanted to ask you to update the README a little bit to reflect that not only form elements, but the form itself can also be check for validity? At least mention in the README doc for toBeValid and toBeInvalid that an entire form can be checked. No need to add html examples of it, but do it if you feel like it.

@jsphstls
Copy link
Contributor Author

Let me know how that looks. I noticed that the README example closely matched the test cases, so I changed the invalid element example to be simpler to read.

@gnapse gnapse merged commit 567d3ad into testing-library:master Aug 21, 2019
@gnapse
Copy link
Member

gnapse commented Aug 21, 2019

🎉 This PR is included in version 4.1.0 🎉

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.

2 participants