From 8b6aeae52d4c53a53468678ccd45e9dda9665004 Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Sun, 15 Feb 2015 02:22:09 +0300 Subject: [PATCH] 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 2d5c5d213f09fa0205d07a2d60a36581058cc40a --- test/unit/manipulation.js | 16 ++++++++-------- test/unit/traversing.js | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 5c73a192c..bd324a8e2 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -210,23 +210,23 @@ function testAppend( valueObj ) { equal( result.text(), defaultText + "buga", "Check if text appending works" ); equal( jQuery("#select3").append( valueObj("") ).find("option:last-child").attr("value"), "appendTest", "Appending html options to select element" ); - jQuery("form").append( valueObj("") ); - jQuery("form input[name=radiotest]").each(function() { + jQuery("#qunit-fixture form").append( valueObj("") ); + jQuery("#qunit-fixture form input[name=radiotest]").each(function() { ok( jQuery(this).is(":checked"), "Append checked radio" ); }).remove(); - jQuery("form").append( valueObj("") ); - jQuery("form input[name=radiotest2]").each(function() { + jQuery("#qunit-fixture form").append( valueObj("") ); + jQuery("#qunit-fixture form input[name=radiotest2]").each(function() { ok( jQuery(this).is(":checked"), "Append alternately formated checked radio" ); }).remove(); - jQuery("form").append( valueObj("") ); - jQuery("form input[name=radiotest3]").each(function() { + jQuery("#qunit-fixture form").append( valueObj("") ); + jQuery("#qunit-fixture form input[name=radiotest3]").each(function() { ok( jQuery(this).is(":checked"), "Append HTML5-formated checked radio" ); }).remove(); - jQuery("form").append( valueObj("") ); - jQuery("form input[name=radiotest4]").each(function() { + jQuery("#qunit-fixture form").append( valueObj("") ); + jQuery("#qunit-fixture form input[name=radiotest4]").each(function() { ok( jQuery(this).is(":checked"), "Append with name attribute after checked attribute" ); }).remove(); diff --git a/test/unit/traversing.js b/test/unit/traversing.js index fbc453c1d..b80b673ff 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -122,7 +122,7 @@ test("is(jQuery)", function() { ok( !jQuery("#radio1").is( jQuery("input:checked") ), "Check for pseudoclass: Expected not checked" ); // 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("#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'" );