X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=cbc0b7715f843aa69b4a0ac743fcaf2436265d97;hb=4424bda377336342ce04ab5299bf1ce624cdb7b1;hp=6c3ecf8af800d4b7f0f44e21f3c108416d23335b;hpb=8b33e23ea07b206e96e39bb194675de80cff10ab;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 6c3ecf8..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,7 +385,7 @@ 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; @@ -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() {