X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=9242dddb5f7ebcb5e886d75e1088397cf92ce633;hb=66975de2d249643779e2b3daad0457f7f5f92508;hp=b9cb35dedd1680da037669dbaa2c75b983eedc7d;hpb=69e6e53555f21f07b534f1169298f7b33011bb4b;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index b9cb35d..9242ddd 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -4,13 +4,16 @@ var bareObj = function(value) { return value; }; var functionReturningObj = function(value) { return (function() { return value; }); }; test("text()", function() { - expect(1); + expect(2); var expected = "This link has class=\"blog\": Simon Willison's Weblog"; equals( jQuery('#sap').text(), expected, 'Check for merged text of more then one element.' ); + + // Check serialization of text values + equals( jQuery(document.createTextNode("foo")).text(), "foo", "Text node was retreived from .text()." ); }); var testWrap = function(val) { - expect(15); + expect(18); var defaultText = 'Try them out:' var result = jQuery('#first').wrap(val( '
' )).text(); equals( defaultText, result, 'Check for wrapping of on-the-fly html' ); @@ -34,7 +37,7 @@ var testWrap = function(val) { var j = jQuery("#nonnodes").contents(); j.wrap(val( "" )); equals( jQuery("#nonnodes > i").length, 3, "Check node,textnode,comment wraps ok" ); - equals( jQuery("#nonnodes > i").text(), j.text() + j[1].nodeValue, "Check node,textnode,comment wraps doesn't hurt text" ); + equals( jQuery("#nonnodes > i").text(), j.text(), "Check node,textnode,comment wraps doesn't hurt text" ); // Try wrapping a disconnected node j = jQuery("