X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=e07108696aa2aa17f55c133cca44dd2861604928;hb=375b78783825b9adab7a01541faf99f98ef7ecbd;hp=739868bd7bf5d9d4b53e8f8cce78bb713d95dbd1;hpb=f1bd0cfc4d3eabf566b6a3345d888e6db67bc00b;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 739868b..e071086 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -883,6 +883,19 @@ test("jQuery.clone() (#8017)", function() { equals( main.childNodes.length, clone.childNodes.length, "Simple child length to ensure a large dom tree copies correctly" ); }); +test("clone() (#8070)", function () { + expect(2); + + jQuery('').appendTo('#main'); + var selects = jQuery('.test8070'); + selects.append(''); + + equals( selects[0].childNodes.length, 2, "First select got two nodes" ); + equals( selects[1].childNodes.length, 2, "Second select got two nodes" ); + + selects.remove(); +}); + test("clone()", function() { expect(37); equals( 'This is a normal link: Yahoo', jQuery('#en').text(), 'Assert text for #en' ); @@ -940,6 +953,17 @@ test("clone()", function() { div.remove(); clone.remove(); + var divEvt = jQuery("
").click(function(){ + ok( false, "Bound event still exists after .clone()." ); + }), + cloneEvt = divEvt.clone(); + + // Make sure that doing .clone() doesn't clone events + cloneEvt.trigger("click"); + + cloneEvt.remove(); + divEvt.remove(); + // this is technically an invalid object, but because of the special // classid instantiation it is the only kind that IE has trouble with, // so let's test with it too.