git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ea8b158
)
Handle two more cases where comments were missing in the test case, in Blackberry...
author
John Resig
<jeresig@gmail.com>
Fri, 27 Aug 2010 18:16:27 +0000
(14:16 -0400)
committer
John Resig
<jeresig@gmail.com>
Fri, 27 Aug 2010 18:16:27 +0000
(14:16 -0400)
test/unit/manipulation.js
patch
|
blob
|
history
diff --git
a/test/unit/manipulation.js
b/test/unit/manipulation.js
index
87af324
..
e1d3dbf
100644
(file)
--- a/
test/unit/manipulation.js
+++ b/
test/unit/manipulation.js
@@
-984,6
+984,11
@@
test("html(Function) with incoming value", function() {
equals( val, old[i], "Make sure the incoming value is correct." );
return "<b>bold</b>";
});
equals( val, old[i], "Make sure the incoming value is correct." );
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();
equals( j.html().replace(/ xmlns="[^"]+"/g, "").toLowerCase(), "<b>bold</b>", "Check node,textnode,comment with html()" );
j.find('b').removeData();
equals( j.html().replace(/ xmlns="[^"]+"/g, "").toLowerCase(), "<b>bold</b>", "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("#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" );
jQuery("#nonnodes").contents()[method]();
equals( jQuery("#nonnodes").contents().length, 0, "Check node,textnode,comment remove works" );