-
Notifications
You must be signed in to change notification settings - Fork 123
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
WIP: Add hasProperty() assertion #46
Conversation
There seems to be a permissions issue surrounding Chrome in CI 😥
Update: It's a known issue with Travis CI travis-ci/travis-ci#8836 A couple workarounds:
# travis.yml
sudo: required
addons:
chrome: stable
# travis.yml
addons:
firefox: 57.0 thoughts? |
@seansellek I'm currently on vacation, I'll have a look once I'm back (7 days) |
@seansellek 👋 we've just merged #48, which should fix the Chrome issue. Can you rebase this PR? |
.gitignore
Outdated
@@ -16,6 +16,7 @@ | |||
npm-debug.log* | |||
yarn-error.log | |||
testem.log | |||
.vscode/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stuff should be move to your global .gitignore
file (see https://help.github.com/articles/ignoring-files/)
Only project specific files should be added to this file, but no individual editor config files etc.
accb665
to
4215911
Compare
@Turbo87 sorry it took a bit for me to get back to this. Rebased, removed the .gitignore commit, and fixed a bug in the tests, getting coverage up to 100%. |
c0961ec
to
4215911
Compare
lib/assertions.js
Outdated
* if the property `value` matches the provided `value`. | ||
* | ||
* @param {string} property | ||
* @param {object?} options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should mimic the hasAttribute
API instead which accepts name, value?, message?
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to this. There's a lot to be said for the API being consistent for like methods/functions.
baa5066
to
3735ee1
Compare
**Examples** | ||
|
||
```javascript | ||
assert.dom('input#agreedToTOS').hasProperty('checked', { value: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as mentioned before, I think this should mimic the API that we have for hasAttribute()
Thanks for pinging on this, @Turbo87. I've been pushing on it over the last little while, but haven't had as much time to get it through. I've aligned it more to the |
sweet, thanks for working on it :) |
closing due to inactivity |
This takes the first steps towards addressing #38 by adding a base
.hasProperty()
assertion as mentioned by @Turbo87.The assertion supports providing a custom message to facilitate building shortcuts such as
.isChecked()
.Resolves #55