Use the original element/fragment as the last item to be appended to the document...
[jquery.git] / test / unit / manipulation.js
index a68c214..f0e2eae 100644 (file)
@@ -880,7 +880,20 @@ test("jQuery.clone() (#8017)", function() {
        var main = jQuery("#main")[0],
                        clone = jQuery.clone( main );
 
-       equals( main.children.length, clone.children.length, "Simple child length to ensure a large dom tree copies correctly" );
+       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('<select class="test8070"></select><select class="test8070"></select>').appendTo('#main');
+       var selects = jQuery('.test8070');
+       selects.append('<OPTION>1</OPTION><OPTION>2</OPTION>');
+
+       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() {