X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=8c3d1a55e679cf1096ac9ef395cfaac4cda95cc2;hb=da51cd0e43d6d61e0d3d6c197cef1e658bad29bc;hp=6de3e14eb2db2ef407f33450985b63d5c27b5ceb;hpb=4e9fed3b16ed9612ed373d14a89294e98054f4dd;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 6de3e14..8c3d1a5 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -739,15 +739,16 @@ test("html(String)", function() { test("html(Function)", function() { testHtml(functionReturningObj); -}) +}); var testText = function(valueObj) { expect(4); - equals( jQuery("#foo").text("
Hello cruel world!
")[0].innerHTML.replace(/>/g, ">"), "<div><b>Hello</b> cruel world!</div>", "Check escaped text" ); + var val = valueObj("
Hello cruel world!
"); + equals( jQuery("#foo").text(val)[0].innerHTML.replace(/>/g, ">"), "<div><b>Hello</b> cruel world!</div>", "Check escaped text" ); // using contents will get comments regular, text, and comment nodes var j = jQuery("#nonnodes").contents(); - j.text("hi!"); + j.text(valueObj("hi!")); equals( jQuery(j[0]).text(), "hi!", "Check node,textnode,comment with text()" ); equals( j[1].nodeValue, " there ", "Check node,textnode,comment with text()" ); equals( j[2].nodeType, 8, "Check node,textnode,comment with text()" );