-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Core: guard against null & undefined values in required method #2053
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
Core: guard against null & undefined values in required method #2053
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.
Please add a test
a8f6905
to
92faa3b
Compare
I don't think there is a way to test it without using the normalizer. But the normalizer will not return I will update the tests of the other PR and merge it and then update this one to use the normalizer. For now, I added a description to the commit describing the needs for this fix. |
Merged the other pr, we can add the tests here |
c43f371
to
7b535ef
Compare
We are good to go. |
An input element will never have undefined or null as value but the normalizer may return null or undefined for an element. Also, jQuery (< 3.x) returns `null` for select element with the multiple attribute set if no options are selected. As a result, the required method should guard against that.
7b535ef
to
83bfd48
Compare
I'm going to merge this for now. |
Awesome that our normalizer layer also turned out to be a good value-mocking test utility 😸 Great job, thx |
Yes, and also I see (from Stackoverflow and here) that a lot of folks are using it and found it useful too. Thanks :) |
Ref #2049