X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=b0a1c71af2f4067e5823a46db8f5bf33a7198a6c;hb=bed759c95ca6d796125653b540e8611dc63b38bb;hp=7db8d5bae0a2800fad2edbec77e91460ad485988;hpb=f06e0e5575bc8f82d0fcbd5880bb9d8ccf361bfa;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 7db8d5b..b0a1c71 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -197,7 +197,7 @@ test("unwrap()", function() { }); var testAppend = function(valueObj) { - expect(22); + expect(37); var defaultText = 'Try them out:' var result = jQuery('#first').append(valueObj('buga')); equals( result.text(), defaultText + 'buga', 'Check if text appending works' ); @@ -230,6 +230,24 @@ var testAppend = function(valueObj) { ok( jQuery("#sap").append(valueObj( [] )), "Check for appending an empty array." ); ok( jQuery("#sap").append(valueObj( "" )), "Check for appending an empty string." ); ok( jQuery("#sap").append(valueObj( document.getElementsByTagName("foo") )), "Check for appending an empty nodelist." ); + + reset(); + jQuery("form").append(valueObj('')); + jQuery("form input[name=radiotest]").each(function(){ + ok( jQuery(this).is(':checked'), "Append checked radio"); + }).remove(); + + reset(); + jQuery("form").append(valueObj('')); + jQuery("form input[name=radiotest]").each(function(){ + ok( jQuery(this).is(':checked'), "Append alternately formated checked radio"); + }).remove(); + + reset(); + jQuery("form").append(valueObj('')); + jQuery("form input[name=radiotest]").each(function(){ + ok( jQuery(this).is(':checked'), "Append HTML5-formated checked radio"); + }).remove(); reset(); jQuery("#sap").append(valueObj( document.getElementById('form') )); @@ -793,7 +811,7 @@ test("clone() on XML nodes", function() { } var testHtml = function(valueObj) { - expect(22); + expect(24); jQuery.scriptorder = 0; @@ -805,6 +823,11 @@ var testHtml = function(valueObj) { } ok( pass, "Set HTML" ); + div = jQuery("
").html( valueObj('
') ); + + equals( div.children().length, 2, "Make sure two child nodes exist." ); + equals( div.children().children().length, 1, "Make sure that a grandchild exists." ); + reset(); // using contents will get comments regular, text, and comment nodes var j = jQuery("#nonnodes").contents(); @@ -972,7 +995,7 @@ test("empty()", function() { }); test("jQuery.cleanData", function() { - expect(10); + expect(14); var type, pos, div, child; @@ -1002,6 +1025,9 @@ test("jQuery.cleanData", function() { // Should do nothing pos = "Inner"; child.trigger("click"); + + // Should trigger 2 + div.remove(); type = "html"; @@ -1018,6 +1044,9 @@ test("jQuery.cleanData", function() { // Should do nothing pos = "Inner"; child.trigger("click"); + + // Should trigger 2 + div.remove(); function getDiv() { var div = jQuery("
").click(function(){ @@ -1040,4 +1069,4 @@ test("jQuery.cleanData", function() { return div; } -}); \ No newline at end of file +});