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

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

Closed
caitp wants to merge 1 commit into
angular:v1.2.xfrom
caitp:issue-7936-v1.2.x
Closed

caitp wants to merge 1 commit into
angular:v1.2.xfrom
caitp:issue-7936-v1.2.x

Conversation

@caitp

@caitp caitp commented Jun 23, 2014

Copy link
Copy Markdown
Contributor

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

shahata commented Jun 23, 2014

Copy link
Copy Markdown
Contributor

@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

caitp commented Jun 23, 2014

Copy link
Copy Markdown
Contributor Author

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

shahata commented Jun 23, 2014

Copy link
Copy Markdown
Contributor

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

caitp commented Jun 23, 2014

Copy link
Copy Markdown
Contributor Author

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

shahata commented Jun 23, 2014

Copy link
Copy Markdown
Contributor

np

@aakashtyg

Copy link
Copy Markdown

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

@caitp

caitp commented Jun 23, 2014

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown

@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

caitp commented Jun 24, 2014

Copy link
Copy Markdown
Contributor Author

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.

4 participants