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

should we keep be._empty as 4-in-1 condition and correspondingly remove its experimental _ prefix? #544

Open
yashaka opened this issue Jul 7, 2024 · 0 comments

Comments

@yashaka
Copy link
Owner

yashaka commented Jul 7, 2024

be._empty is similar to be.blank... But be.blank works only for singular elements: if they are a value-based elements (like inputs and textarea) then it checks for empty value, if they are text-based elements then it checks for empty text content.

The be._empty condition works same but if applied to collection
then will assert that it has size 0. Additionally, when applied to "form" element,
then it will check for all form "value-like" inputs to be empty.

Hence, the blank condition is more precise, while empty is more general. Because of its generality, the empty condition can be easier to remember, but can lead to some kind of confusion when applied to both element and collection in same test. Also, its behavior can be less predictable from the user perspective when applied to form with textarea, that is both "value-like" and "text-based" element. That's why it is still marked as experimental.

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

No branches or pull requests

1 participant