X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=f921ea190518a5780bffb1f2c3829adda22dfcfa;hb=f95147f465932cb91e1a6aace50c556820ca4074;hp=bbf9a3a25e747f720e5a23fa01a659c8cb052bc9;hpb=9f17e70ae95cc2d4b945bc94283b87cc5b8b23db;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index bbf9a3a..f921ea1 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -720,6 +720,16 @@ test("replaceWith(String|Element|Array<Element>|jQuery)", function() { test("replaceWith(Function)", function() { testReplaceWith(functionReturningObj); + + expect(16); + + var y = jQuery("#yahoo")[0]; + + jQuery(y).replaceWith(function(){ + equals( this, y, "Make sure the context is coming in correctly." ); + }); + + reset(); }) test("replaceAll(String|Element|Array<Element>|jQuery)", function() { @@ -747,7 +757,7 @@ test("replaceAll(String|Element|Array<Element>|jQuery)", function() { }); test("clone()", function() { - expect(30); + expect(31); equals( 'This is a normal link: Yahoo', jQuery('#en').text(), 'Assert text for #en' ); var clone = jQuery('#yahoo').clone(); equals( 'Try them out:Yahoo', jQuery('#first').append(clone).text(), 'Check for clone' ); @@ -797,6 +807,14 @@ test("clone()", function() { div = div.clone(true); equals( div.data("a"), true, "Data cloned." ); equals( div.data("b"), true, "Data cloned." ); + + var form = document.createElement("form"); + form.action = "/test/"; + var div = document.createElement("div"); + div.appendChild( document.createTextNode("test") ); + form.appendChild( div ); + + equals( jQuery(form).clone().children().length, 1, "Make sure we just get the form back." ); }); if (!isLocal) {