-
Notifications
You must be signed in to change notification settings - Fork 60
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
@remote-ui/testing: Fix debug to filter props according to all option #169
Conversation
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.
Just one comment on an existing bit of code, but otherwise this change LGTM!
return !/^(className)$|^(aria|data)-/.test(key); | ||
}) | ||
.reduce<string[]>((list, key) => { | ||
if (!key) { |
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.
It looks like we had this condition before, but do you know when it can actually happen? It seems like key
would always be defined, so this would only trip up on ''
, which shouldn't be a key name?
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 this was here before, but I think you're right that key
should always be truthy and this condition will never be hit. Even if there was node that somehow used 0
or undefined
as a prop, these would come through non-empty truthy strings from Object.keys
.
@jackokerman-stripe you'll also need to sign the CLA (let me know if you have any issues with process). |
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.
@jackokerman-stripe you'll also need to sign the CLA (let me know if you have any issues with process).
Last week I emailed shopify-cla@shopify.com
to get myself and @tennhard-stripe added to the existing CLA that Stripe has. Is there anything else I need to do?
return !/^(className)$|^(aria|data)-/.test(key); | ||
}) | ||
.reduce<string[]>((list, key) => { | ||
if (!key) { |
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 this was here before, but I think you're right that key
should always be truthy and this condition will never be hit. Even if there was node that somehow used 0
or undefined
as a prop, these would come through non-empty truthy strings from Object.keys
.
92582ae
to
d1199dc
Compare
@lemonmade I finally got the CLA sorted out. Let me know your thoughts on the |
Sorry it took me so long to get around to this. Thank you for getting it all in a good state, will release this in |
The object returned from
mount
has adebug
method that is supposed to accept anall
option according to the linked @shopify/react-testing docs (This option is actually calledallProps
in@shopify/react-testing
which is potentially confusing). This adds the filtering behavior described in the docs so thatclassName
,aria-*
, anddata-*
prop names are omitted by default, but included it the{ all: true }
option is passed in.