-
Notifications
You must be signed in to change notification settings - Fork 27.5k
fix(input): improve html5 validation support (v1.2.x) #7957
Conversation
This CL improves mocking support for HTML5 validation, and ensures that it works correctly along with debounced commission of view values.
@caitp I think adding some e2e tests for this might be a good idea. This way you can validate that this works without mocking of the browser's validity checks. |
We thought it would be a good idea the first time around too, but unfortunately webdriver was not really capable at the time, for whatever reason. It's probably still not able to do that. |
What exactly failed? I tried adding a simple test and it worked fine (failed on master and passed in your PR). If you'd like I can send you a PR. The test I tried adding: it('should be invalid if bad input', function() {
input.clear();
input.sendKeys('10a');
expect(element(by.css('#number-err')).isDisplayed()).toBeTruthy();
}); |
I think you should submit a separate PR to add E2E tests after this lands, because it's possible that these will need to be adjusted more, so I don't want to add extra stuff to them |
np |
@caitp Hi |
@aakash-cr7 is there something you're wanting to add or fix? github makes this pretty easy, and there are tutorials (eg at https://www.youtube.com/user/GitHubGuides) --- I don't think this bug is the right place to get into that stuff though =) |
@caitp |
This CL improves mocking support for HTML5 validation, fixes the behaviour which invokes validators. Previously, an input would only be revalidated if either its value changed, or if it was the empty string but did not suffer from bad input --- now, it will be revalidated if either the value has changed, or the value is the empty string, there is a ValidityState for the element, and that ValidityState is being tested by one of the validators in the pipeline. Closes #7937 Closes #7957
Closed by ab2e83c |
This CL improves mocking support for HTML5 validation, and ensures that it
works correctly along with debounced commission of view values.