X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=sidebyside;f=test%2Funit%2Fmanipulation.js;h=1313783e0be4e2da4da6c02ab43608cc4944de4f;hb=a43a5ca9cf79afcd662df5b9110d7ccba45c0b53;hp=f0e2eaec2643820d9e5b68f853672e76164e2ec8;hpb=0a0cff9d29c4bd559da689d96c532d06c03fce09;p=jquery.git
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index f0e2eae..1313783 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("
").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.
@@ -995,7 +1006,7 @@ test("clone()", function() {
test("clone(form element) (Bug #3879, #6655)", function() {
expect(6);
- element = jQuery("");
+ var element = jQuery("");
equals( element.clone().find("option:selected").val(), element.find("option:selected").val(), "Selected option cloned correctly" );
@@ -1015,6 +1026,14 @@ test("clone(form element) (Bug #3879, #6655)", function() {
equals( clone[0].defaultValue, "foo", "Textarea defaultValue cloned correctly" );
});
+test("clone(multiple selected options) (Bug #8129)", function() {
+ expect(1);
+ var element = jQuery("");
+
+ equals( element.clone().find("option:selected").length, element.find("option:selected").length, "Multiple selected options cloned correctly" );
+
+});
+
if (!isLocal) {
test("clone() on XML nodes", function() {
expect(2);