-
Notifications
You must be signed in to change notification settings - Fork 669
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
Support for classes(), etc #139
Comments
I agree. Value assertions are more useful than boolean assertions. We could replace hasClass, hasAttribute, and hasProp with We've got a good opportunity to remove these before the official release. The one method I think is useful is hasStyle, because it allows you to check What do people think? |
I haven't had much occasion to use I agree that |
I personally prefer the notation |
I also prefer the notation What do other people think? |
The Alternatively, it could go fully the other way and implement the functions as getters, so they would expose a property-like API |
I've changed my mind, as you said we already have html and text methods. |
This has been released in 1.0.0-beta.6 🎉. Thanks @tim-hutchinson 😀 Happy to continue discussing API, but I find: wrapper.props().someProp Is more elegant that wrapper.getProps().someProp Plus we can extend the wrapper.props('someProp') |
This came up in #118. We've found it easier to work with tests that use the assertion library's comparison functions, rather than the comparison functions like
hasClass
,hasProp
, etc.I'd like to propose adding helpers that are more like
html()
andtext()
that simply return a consumable form of the element feature requested. IE,classes()
would return an array of class names on the element. I've got an implementation ofclasses
and can submit a PR for it and others that make sense, but wanted to see if it made sense before going further.The text was updated successfully, but these errors were encountered: