X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=ec96c10b887bc55679b1cee118166fd62ec91c17;hb=0f0fd1aee34b81411419ae3b152e03dfdf58b4f4;hp=c942bfd38083747fc6ce74300eec8e112d2f5fe9;hpb=520f1a26845252dd6d7fd5f3b5bb7779ba91eb2c;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index c942bfd..ec96c10 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -4,9 +4,12 @@ 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) { @@ -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("