X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=2fc6f18899886570c5caa9f62de2728bc17feaa8;hb=879799fe955f01b85b59fd8a0096d415fc48df03;hp=87af324d2a07bbe70e82948d213a50ab33c69179;hpb=9ce1d09a0a002eb147411166dee800335a60f4e4;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 87af324..2fc6f18 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -899,7 +899,7 @@ var testHtml = function(valueObj) { equals( div.children().children().length, 1, "Make sure that a grandchild exists." ); var space = jQuery("
").html(valueObj(" "))[0].innerHTML; - ok( /^\s$|^ $/.test( space ), "Make sure entities are passed through correctly." ); + ok( /^\xA0$|^ $/.test( space ), "Make sure entities are passed through correctly." ); equals( jQuery("
").html(valueObj("&"))[0].innerHTML, "&", "Make sure entities are passed through correctly." ); jQuery("#main").html(valueObj("")); @@ -984,6 +984,11 @@ test("html(Function) with incoming value", function() { equals( val, old[i], "Make sure the incoming value is correct." ); return "bold"; }); + + // Handle the case where no comment is in the document + if ( j.length === 2 ) { + equals( null, null, "Make sure the incoming value is correct." ); + } j.find('b').removeData(); equals( j.html().replace(/ xmlns="[^"]+"/g, "").toLowerCase(), "bold", "Check node,textnode,comment with html()" ); @@ -1038,7 +1043,8 @@ var testRemove = function(method) { equals( jQuery("#ap").children().length, 0, "Check multi-filtered remove" ); // using contents will get comments regular, text, and comment nodes - equals( jQuery("#nonnodes").contents().length, 3, "Check node,textnode,comment remove works" ); + // Handle the case where no comment is in the document + ok( jQuery("#nonnodes").contents().length >= 2, "Check node,textnode,comment remove works" ); jQuery("#nonnodes").contents()[method](); equals( jQuery("#nonnodes").contents().length, 0, "Check node,textnode,comment remove works" );