X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=cbc0b7715f843aa69b4a0ac743fcaf2436265d97;hb=4424bda377336342ce04ab5299bf1ce624cdb7b1;hp=29c79a2d6aa997214ce0919326836e37dc69be6f;hpb=4fae75d575b20d887e4a273c7991c55f8821a62c;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 29c79a2..cbc0b77 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -1,5 +1,8 @@ module("manipulation"); +// Ensure that an extended Array prototype doesn't break jQuery +Array.prototype.arrayProtoFn = function(arg) { throw("arrayProtoFn should not be called"); }; + var bareObj = function(value) { return value; }; var functionReturningObj = function(value) { return (function() { return value; }); }; @@ -382,13 +385,13 @@ test("append(Function) with incoming value", function() { }); test("append the same fragment with events (Bug #6997, 5566)", function () { - expect(2 + (document.fireEvent ? 1 : 0)); + expect(4 + (document.fireEvent ? 1 : 0)); stop(1000); var element; // This patch modified the way that cloning occurs in IE; we need to make sure that - // native event handlers on the original object don’t get disturbed when they are + // native event handlers on the original object don't get disturbed when they are // modified on the clone if (!jQuery.support.noCloneEvent && document.fireEvent) { element = jQuery("div:first").click(function () { @@ -413,6 +416,14 @@ 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() { @@ -890,7 +901,7 @@ test("clone()", function() { // 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. + // so let's test with it too. div = jQuery("
").html(' '); clone = div.clone(true);