X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=03f8f32c8e7666745f1183067f5c779c165a16eb;hb=5dc6b7ce3469eaadb37a151d449e8d36571d1894;hp=6de3e14eb2db2ef407f33450985b63d5c27b5ceb;hpb=4b70f006f579fba24a882d80ca67f1971dbb4922;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 6de3e14..03f8f32 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -105,7 +105,7 @@ test("wrapAll(String|Element)", function() { // TODO: Figure out why each(wrapAll) is not equivalent to wrapAll // test("wrapAll(Function)", function() { -// testWrapAll(functionReturningObj); +// testWrapAll(functionReturningObj); // }) var testWrapInner = function(val) { @@ -130,7 +130,7 @@ test("wrapInner(String|Element)", function() { // TODO: wrapInner uses wrapAll -- get wrapAll working with Function // test("wrapInner(Function)", function() { -// testWrapInner(functionReturningObj) +// testWrapInner(functionReturningObj) // }) var testUnwrap = function() { @@ -251,7 +251,7 @@ var testAppend = function(valueObj) { } test("append(String|Element|Array<Element>|jQuery)", function() { - testAppend(bareObj); + testAppend(bareObj); }); test("append(Function)", function() { @@ -658,9 +658,9 @@ var testVal = function(valueObj) { jQuery("#select1").val(valueObj( 2 )); equals( jQuery("#select1").val(), "2", "Check for modified (via val(Number)) value of select element" ); - jQuery("#select1").append(""); - jQuery("#select1").val(valueObj( 4 )); - equals( jQuery("#select1").val(), "4", "Should be possible to set the val() to a newly created option" ); + jQuery("#select1").append(""); + jQuery("#select1").val(valueObj( 4 )); + equals( jQuery("#select1").val(), "4", "Should be possible to set the val() to a newly created option" ); // using contents will get comments regular, text, and comment nodes var j = jQuery("#nonnodes").contents(); @@ -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()" );