Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Conversation

@r4z3c
Copy link

@r4z3c r4z3c commented Apr 20, 2017

These are simple changes. It's about set two attributes into input element. The first one is required, that will tell browser to check if input was filled out; and the second one is value, that will avoid the validation error when an option is selected.

More details of html5 validations: https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Form_validation


test.deepEqual(ref.getValue(), 'Amsterdam');

test.equal(el.querySelector('input').value, 'Amsterdam');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get two more parameters in your test function: container and $. container is the el you've retrieved from the reference (or its parent, not sure by head :) and $ is actually a shortcut for container.querySelectorAll. I think it'd be nicer if you use those instead of relying on React internals.

Copy link
Owner

@arendjr arendjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks like a great PR! If you can clean up those tests a little bit (not relying on React internals) I'll happily merge this!

@r4z3c
Copy link
Author

r4z3c commented Apr 22, 2017

I've made the suggested fixes, and hope to contribute more in the future :)

@arendjr
Copy link
Owner

arendjr commented Apr 23, 2017

Great, thanks!

@arendjr arendjr merged commit 2e0fe35 into arendjr:master Apr 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants