X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=03f8f32c8e7666745f1183067f5c779c165a16eb;hb=5dc6b7ce3469eaadb37a151d449e8d36571d1894;hp=ca185a47ee78c90c211e05eb6b19863859119779;hpb=991dafae16e44512c5107b90bc8ce9675d8f5c12;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index ca185a4..03f8f32 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(12); + 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("