Tests: Add assertion to check form exists before validating

Co-authored-by: bytestream <1788397+bytestream@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-12 15:49:00 +00:00
parent dff7ce8640
commit e3c28f7912

View File

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