aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/manipulation.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2011-02-01 08:57:18 -0500
committerjeresig <jeresig@gmail.com>2011-02-01 08:57:18 -0500
commit375b78783825b9adab7a01541faf99f98ef7ecbd (patch)
tree4aacc47e913c40599d9952a9946c4c8fc05745d7 /test/unit/manipulation.js
parenteb5aab99525ede9f8609fbfc741c6337cf2d5061 (diff)
downloadjquery-375b78783825b9adab7a01541faf99f98ef7ecbd.tar.gz
jquery-375b78783825b9adab7a01541faf99f98ef7ecbd.zip
The default for .clone() is to not clone any events. Fixes #8123.
Diffstat (limited to 'test/unit/manipulation.js')
-rw-r--r--test/unit/manipulation.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index f0e2eaec2..e07108696 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -953,6 +953,17 @@ test("clone()", function() {
div.remove();
clone.remove();
+ var divEvt = jQuery("<div><ul><li>test</li></ul></div>").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.