Repository navigation
test: verify invalid is set appropriately when committing values - #4223
Merged
Merged
Conversation
invalid state is set appropriately when committing valuesinvalid is set appropriately when committing values
|
Kudos, SonarCloud Quality Gate passed!
|
vursen
commented
Jul 16, 2022
|
|
||
| it('should fail validation without value', () => { | ||
| expect(datePicker.checkValidity()).to.be.false; | ||
| expect(datePicker.validate()).to.be.false; |
Contributor
Author
There was a problem hiding this comment.
I added these validate() assertions in #4163 but now I think that they don't actually make much sense since the component doesn't override the validate() method, so asserting checkValidity() should be enough.
web-padawan
approved these changes
Jul 18, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Description
This PR improves test coverage of
date-pickerby making some of its validation tests verify that theinvalidproperty is updated appropriately after committing values rather than just thatcheckValidity()returns an expected result. In other words, the new version of tests ensures that the validation happens at the correct moment that is after the entered value has been committed (= thevalueproperty has been updated) and thus ensures that the validation uses the new value.A follow-up to #4163
Type of change
Checklist