X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=ca185a47ee78c90c211e05eb6b19863859119779;hb=991dafae16e44512c5107b90bc8ce9675d8f5c12;hp=d8dbca96c7b7c5e9d9d4d017ca2dc47537bae8db;hpb=ad5ba1a72ef90c4327e3eb3ee133fbf87e181638;p=jquery.git
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index d8dbca9..ca185a4 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -10,7 +10,7 @@ test("text()", function() {
});
var testWrap = function(val) {
- expect(10);
+ expect(12);
var defaultText = 'Try them out:'
var result = jQuery('#first').wrap(val( '
' )).text();
equals( defaultText, result, 'Check for wrapping of on-the-fly html' );
@@ -40,6 +40,11 @@ var testWrap = function(val) {
j = jQuery("").wrap(val( "" ));
equals( j[0].nodeName.toUpperCase(), "LABEL", "Element is a label" );
equals( j[0].parentNode.nodeName.toUpperCase(), "LI", "Element has been wrapped" );
+
+ // Wrap an element containing a text node
+ j = jQuery("").wrap("
test
");
+ equals( j[0].previousSibling.nodeType, 3, "Make sure the previous node is a text element" );
+ equals( j[0].parentNode.nodeName.toUpperCase(), "DIV", "And that we're in the div element." );
}
test("wrap(String|Element)", function() {