-
Notifications
You must be signed in to change notification settings - Fork 6
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
First class support for test id's #286
Conversation
4741404
to
3f3b66b
Compare
Pull Request Test Coverage Report for Build 1203
💛 - Coveralls |
This is more consistent with other assertions we have.
3f3b66b
to
4adf6ab
Compare
4adf6ab
to
4aee4a7
Compare
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 all for this and doubly so for allowing not when doing the contain elements assertion.
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.
Looks good! 🚀
(expect, subject, testId) => { | ||
expect.errorMode = 'nested'; | ||
expect.subjectOutput = output => | ||
expect.inspect(subject, Infinity, output); |
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.
Is this to avoid dotting out? Is it something we want in some of the other assertions as well?
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.
Yes, I have experience cases where we dot out stuff that contains conflicts. We should go through all of the assertions and make sure that we don't remove useful information, but that is a separate task: #287
Released as [email protected] |
It is becoming a recognised pattern for DOM testing to use test id's on elements.
Test id's is just a adding a
data-test-id
attribute to elements so you have a stable way of finding them from your tests.We can already handle those, but it is kind of inconvenient and given how often it is used, I think we should add first class support for the concept.
Fixes: #285