Commit 43fbe3b3 authored by John Resig's avatar John Resig

Handle two more cases where comments were missing in the test case, in Blackberry 4.6.

parent ea8b1584
...@@ -985,6 +985,11 @@ test("html(Function) with incoming value", function() { ...@@ -985,6 +985,11 @@ test("html(Function) with incoming value", function() {
return "<b>bold</b>"; return "<b>bold</b>";
}); });
// 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(); j.find('b').removeData();
equals( j.html().replace(/ xmlns="[^"]+"/g, "").toLowerCase(), "<b>bold</b>", "Check node,textnode,comment with html()" ); equals( j.html().replace(/ xmlns="[^"]+"/g, "").toLowerCase(), "<b>bold</b>", "Check node,textnode,comment with html()" );
...@@ -1038,7 +1043,8 @@ var testRemove = function(method) { ...@@ -1038,7 +1043,8 @@ var testRemove = function(method) {
equals( jQuery("#ap").children().length, 0, "Check multi-filtered remove" ); equals( jQuery("#ap").children().length, 0, "Check multi-filtered remove" );
// using contents will get comments regular, text, and comment nodes // 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](); jQuery("#nonnodes").contents()[method]();
equals( jQuery("#nonnodes").contents().length, 0, "Check node,textnode,comment remove works" ); equals( jQuery("#nonnodes").contents().length, 0, "Check node,textnode,comment remove works" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment