Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(input): improve html5 validation support (v1.2.x) #7957

Closed
wants to merge 1 commit into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Jun 23, 2014

This CL improves mocking support for HTML5 validation, and ensures that it
works correctly along with debounced commission of view values.

This CL improves mocking support for HTML5 validation, and ensures that it works correctly along
with debounced commission of view values.
@caitp caitp added cla: yes and removed cla: no labels Jun 23, 2014
@shahata
Copy link
Contributor

shahata commented Jun 23, 2014

@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.

@caitp
Copy link
Contributor Author

caitp commented Jun 23, 2014

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.

@shahata
Copy link
Contributor

shahata commented Jun 23, 2014

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();
});

@caitp
Copy link
Contributor Author

caitp commented Jun 23, 2014

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

@shahata
Copy link
Contributor

shahata commented Jun 23, 2014

np

@aakashtyg
Copy link

@caitp Hi
I am new to open source. Can you please help me how to contribute to this project.

@caitp
Copy link
Contributor Author

caitp commented Jun 23, 2014

@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 =)

@tbosch tbosch self-assigned this Jun 23, 2014
@tbosch tbosch added this to the Backlog milestone Jun 23, 2014
@tbosch tbosch removed their assignment Jun 23, 2014
@aakashtyg
Copy link

@caitp
Thanks a lot for the advice!

caitp added a commit that referenced this pull request Jun 24, 2014
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
@caitp
Copy link
Contributor Author

caitp commented Jun 24, 2014

Closed by ab2e83c

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants