X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=52becfefb37a5a7281da1147df2362ab06476d4b;hb=36a98b95c2f3f7617ddf51beec7515acf67d98ba;hp=a7e1f7e4548e0a145314ac6c9a479f28ccdb93d0;hpb=366039a6f05ffa09630e95be604e3f4f26a33bd6;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index a7e1f7e..52becfe 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -626,7 +626,7 @@ test("insertAfter(String|Element|Array<Element>|jQuery)", function() { }); var testReplaceWith = function(val) { - expect(14); + expect(16); jQuery('#yahoo').replaceWith(val( 'buga' )); ok( jQuery("#replace")[0], 'Replace element with string' ); ok( !jQuery("#yahoo")[0], 'Verify that original element is gone, after string' ); @@ -648,6 +648,15 @@ var testReplaceWith = function(val) { ok( jQuery("#mark")[0], 'Replace element with set of elements' ); ok( !jQuery("#yahoo")[0], 'Verify that original element is gone, after set of elements' ); + reset(); + var tmp = jQuery("
").appendTo("body").click(function(){ ok(true, "Newly bound click run." ); }); + var y = jQuery('#yahoo').click(function(){ ok(true, "Previously bound click run." ); }); + y.replaceWith( tmp ); + tmp.click(); + y.click(); + + reset(); + var set = jQuery("
").replaceWith(val("test")); equals( set[0].nodeName.toLowerCase(), "span", "Replace the disconnected node." ); equals( set.length, 1, "Replace the disconnected node." );