X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=37234d86d3e2443496239573080d92d1ac1e3668;hb=c1d719b580ea78c33961113030d7fa25bcc98e6f;hp=de841445f66811129c5b83c751b77b81e8c53db0;hpb=e2941d5a98e91c5f61b200b2763e5fa0eb339365;p=jquery.git
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index de84144..37234d8 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -402,7 +402,7 @@ test("append(Function) with incoming value", function() {
});
test("append the same fragment with events (Bug #6997, 5566)", function () {
- expect(4 + (document.fireEvent ? 1 : 0));
+ expect(2 + (document.fireEvent ? 1 : 0));
stop(1000);
var element;
@@ -437,14 +437,6 @@ test("append the same fragment with events (Bug #6997, 5566)", function () {
jQuery("#listWithTabIndex li").before(element);
jQuery("#listWithTabIndex li.test6997").eq(1).click();
-
- element = jQuery("");
-
- equals( element.clone().find("option:selected").val(), element.find("option:selected").val(), "Selected option cloned correctly" );
-
- element = jQuery("").attr('checked', 'checked');
-
- equals( element.clone().is(":checked"), element.is(":checked"), "Checked input cloned correctly" );
});
test("appendTo(String|Element|Array<Element>|jQuery)", function() {
@@ -976,6 +968,28 @@ test("clone()", function() {
equal( jQuery("body").clone().children()[0].id, "qunit-header", "Make sure cloning body works" );
});
+test("clone(form element) (Bug #3879, #6655)", function() {
+ expect(6);
+ element = jQuery("");
+
+ equals( element.clone().find("option:selected").val(), element.find("option:selected").val(), "Selected option cloned correctly" );
+
+ element = jQuery("").attr('checked', 'checked');
+ clone = element.clone();
+
+ equals( clone.is(":checked"), element.is(":checked"), "Checked input cloned correctly" );
+ equals( clone[0].defaultValue, "foo", "Checked input defaultValue cloned correctly" );
+ equals( clone[0].defaultChecked, !jQuery.support.noCloneEvent, "Checked input defaultChecked cloned correctly" );
+
+ element = jQuery("");
+ clone = element.clone();
+ equals( clone[0].defaultValue, "foo", "Text input defaultValue cloned correctly" );
+
+ element = jQuery("");
+ clone = element.clone();
+ equals( clone[0].defaultValue, "foo", "Textarea defaultValue cloned correctly" );
+});
+
if (!isLocal) {
test("clone() on XML nodes", function() {
expect(2);