Skip to content

Commit

Permalink
Tests: new test for Step exception logic added
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and staabm committed Nov 12, 2015
1 parent b3c07e3 commit 792dad3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ <h3></h3>
<input type="number" id="rangeMinZeroValidEqual" name="rangeMinZeroValidEqual" min="0" value="0">
<input type="number" id="rangeMinZeroValidGreater" name="rangeMinZeroValidGreater" min="0" value="1">
</form>
<form id="stepOnUnsupportedType">
<input type="date" id="stepOnUnsupportedTypeInput" name="stepOnUnsupportedTypeInput" step="1">
</form>
<form id="rangeMinDateValid">
<input type="date" id="minDateValid" name="minDateValid" min="2012-11-21" value="2012-12-21">
</form>
Expand Down
17 changes: 17 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1732,6 +1732,23 @@ test( "Min, Max and Step set by data-rule valid", function() {
equal( label.text(), "", "Correct error label" );
} );

test( "Step attribute on element with unsupported input type", function() {
var form = $( "#stepOnUnsupportedType" ),
input = $( "#stepOnUnsupportedTypeInput" );

throws(
function() {
form.validate();
form.get( 0 ).reset();
input.valid();
},
function( err ) {
return err.message === "Step attribute on input type date is not supported.";
},
"Must throw an expected error to pass."
);
} );

test( "calling blur on ignored element", function() {
var form = $( "#ignoredElements" );

Expand Down

0 comments on commit 792dad3

Please sign in to comment.