forked from guillaumepotier/Parsley.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests and docs for binding the validation to any DOM element
- Loading branch information
Showing
6 changed files
with
20 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,6 +131,9 @@ var testSuite = function () { | |
expect( $( '#hidden' ).hasClass( 'parsley-validated' ) ).to.be( false ); | ||
expect( $( '#hidden' ).parsley( 'validate' ) ).to.be( null ); | ||
} ) | ||
it ( 'Should bind a DOM element with data-bind value set to true', function () { | ||
expect( $( '#bindNonFormInput' ).hasClass( 'parsley-validated' ) ).to.be( true ); | ||
} ) | ||
} ) | ||
|
||
/*************************************** | ||
|
@@ -700,12 +703,12 @@ var testSuite = function () { | |
|
||
$( '#scenario-multiple-errors-and-required' ).val( '[email protected]' ); | ||
expect( $( '#scenario-multiple-errors-and-required' ).parsley( 'validate' ) ).to.be( false ); | ||
expect( $( 'ul#' + fieldHash + ' li' ).length ).to.be( 1 ); | ||
expect( $( 'ul#' + fieldHash + ' li' ).length ).to.be( 1 ); | ||
expect( $( 'ul#' + fieldHash + ' li' ).eq( 0 ).hasClass( 'rangelength' ) ).to.be( true ); | ||
|
||
$( '#scenario-multiple-errors-and-required' ).val( 'foo' ); | ||
expect( $( '#scenario-multiple-errors-and-required' ).parsley( 'validate' ) ).to.be( false ); | ||
expect( $( 'ul#' + fieldHash + ' li' ).length ).to.be( 2 ); | ||
expect( $( 'ul#' + fieldHash + ' li' ).length ).to.be( 2 ); | ||
} ) | ||
it ( 'Test keyup scenario for non-required field', function () { | ||
// do not pass the 3 chars min trigger | ||
|