X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=ec96c10b887bc55679b1cee118166fd62ec91c17;hb=0f0fd1aee34b81411419ae3b152e03dfdf58b4f4;hp=d8dbca96c7b7c5e9d9d4d017ca2dc47537bae8db;hpb=35951021545a3ae88018fc5ea3bebd1bc7d09c6a;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index d8dbca9..ec96c10 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(10); + expect(15); var defaultText = 'Try them out:' var result = jQuery('#first').wrap(val( '
' )).text(); equals( defaultText, result, 'Check for wrapping of on-the-fly html' ); @@ -34,12 +37,23 @@ 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("