mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-14 20:35:47 +01:00
Tests: Add assertion to check form exists before validating
Co-authored-by: bytestream <1788397+bytestream@users.noreply.github.com>
This commit is contained in:
@@ -370,9 +370,11 @@ QUnit.test( "Ignore elements that have form attribute set to other forms", funct
|
||||
} );
|
||||
|
||||
QUnit.test( "Validate elements outside form with form attribute", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
assert.expect( 4 );
|
||||
|
||||
var form = $( "#testForm29" );
|
||||
assert.ok( form.length === 1, "Form should be found in the DOM" );
|
||||
|
||||
var v = form.validate();
|
||||
|
||||
// The form has one input inside and one input outside with form attribute
|
||||
@@ -385,9 +387,11 @@ QUnit.test( "Validate elements outside form with form attribute", function( asse
|
||||
} );
|
||||
|
||||
QUnit.test( "Validate checkboxes outside form with form attribute", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
assert.expect( 4 );
|
||||
|
||||
var form = $( "#testForm30" );
|
||||
assert.ok( form.length === 1, "Form should be found in the DOM" );
|
||||
|
||||
var v = form.validate();
|
||||
|
||||
// The form has one checkbox inside and one checkbox outside with form attribute
|
||||
|
||||
Reference in New Issue
Block a user