Build: fix broken assertions caused by QUnit update

QUnit update broke couple traversing and manipulation tests, since new qunit
added another form to the test-suite while some of
jQuery selectors weren't specific

Ref 2d5c5d213f
This commit is contained in:
Oleg Gaidarenko 2015-02-15 02:22:09 +03:00
parent 97ef1f2612
commit 8b6aeae52d
2 changed files with 9 additions and 9 deletions

View File

@ -210,23 +210,23 @@ function testAppend( valueObj ) {
equal( result.text(), defaultText + "buga", "Check if text appending works" ); equal( result.text(), defaultText + "buga", "Check if text appending works" );
equal( jQuery("#select3").append( valueObj("<option value='appendTest'>Append Test</option>") ).find("option:last-child").attr("value"), "appendTest", "Appending html options to select element" ); equal( jQuery("#select3").append( valueObj("<option value='appendTest'>Append Test</option>") ).find("option:last-child").attr("value"), "appendTest", "Appending html options to select element" );
jQuery("form").append( valueObj("<input name='radiotest' type='radio' checked='checked' />") ); jQuery("#qunit-fixture form").append( valueObj("<input name='radiotest' type='radio' checked='checked' />") );
jQuery("form input[name=radiotest]").each(function() { jQuery("#qunit-fixture form input[name=radiotest]").each(function() {
ok( jQuery(this).is(":checked"), "Append checked radio" ); ok( jQuery(this).is(":checked"), "Append checked radio" );
}).remove(); }).remove();
jQuery("form").append( valueObj("<input name='radiotest2' type='radio' checked = 'checked' />") ); jQuery("#qunit-fixture form").append( valueObj("<input name='radiotest2' type='radio' checked = 'checked' />") );
jQuery("form input[name=radiotest2]").each(function() { jQuery("#qunit-fixture form input[name=radiotest2]").each(function() {
ok( jQuery(this).is(":checked"), "Append alternately formated checked radio" ); ok( jQuery(this).is(":checked"), "Append alternately formated checked radio" );
}).remove(); }).remove();
jQuery("form").append( valueObj("<input name='radiotest3' type='radio' checked />") ); jQuery("#qunit-fixture form").append( valueObj("<input name='radiotest3' type='radio' checked />") );
jQuery("form input[name=radiotest3]").each(function() { jQuery("#qunit-fixture form input[name=radiotest3]").each(function() {
ok( jQuery(this).is(":checked"), "Append HTML5-formated checked radio" ); ok( jQuery(this).is(":checked"), "Append HTML5-formated checked radio" );
}).remove(); }).remove();
jQuery("form").append( valueObj("<input type='radio' checked='checked' name='radiotest4' />") ); jQuery("#qunit-fixture form").append( valueObj("<input type='radio' checked='checked' name='radiotest4' />") );
jQuery("form input[name=radiotest4]").each(function() { jQuery("#qunit-fixture form input[name=radiotest4]").each(function() {
ok( jQuery(this).is(":checked"), "Append with name attribute after checked attribute" ); ok( jQuery(this).is(":checked"), "Append with name attribute after checked attribute" );
}).remove(); }).remove();

View File

@ -122,7 +122,7 @@ test("is(jQuery)", function() {
ok( !jQuery("#radio1").is( jQuery("input:checked") ), "Check for pseudoclass: Expected not checked" ); ok( !jQuery("#radio1").is( jQuery("input:checked") ), "Check for pseudoclass: Expected not checked" );
// Some raw elements // Some raw elements
ok( jQuery("#form").is( jQuery("form")[0] ), "Check for element: A form is a form" ); ok( jQuery("#form").is( jQuery("#qunit-fixture form")[0] ), "Check for element: A form is a form" );
ok( !jQuery("#form").is( jQuery("div")[0] ), "Check for element: A form is not a div" ); ok( !jQuery("#form").is( jQuery("div")[0] ), "Check for element: A form is not a div" );
ok( jQuery("#mark").is( jQuery(".blog")[0] ), "Check for class: Expected class 'blog'" ); ok( jQuery("#mark").is( jQuery(".blog")[0] ), "Check for class: Expected class 'blog'" );
ok( !jQuery("#mark").is( jQuery(".link")[0] ), "Check for class: Did not expect class 'link'" ); ok( !jQuery("#mark").is( jQuery(".link")[0] ), "Check for class: Did not expect class 'link'" );