diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2013-01-06 14:20:35 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2013-01-06 14:20:35 -0500 |
commit | bbdf957e9886212cac9b72ee9dedd73118aa8427 (patch) | |
tree | 381d5e773edb105141fed812bff3ca4934d79609 /test | |
parent | b45c775ca971afab0c915fbc91aa8720a639f5d1 (diff) | |
download | jquery-bbdf957e9886212cac9b72ee9dedd73118aa8427.tar.gz jquery-bbdf957e9886212cac9b72ee9dedd73118aa8427.zip |
Fix #12336. Ensure oldIE really does .empty() selects.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/manipulation.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 86b26e040..d208b3b7a 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -1829,7 +1829,7 @@ test( "detach() event cleaning ", 1, function() { test("empty()", function() { - expect( 3 ); + expect( 6 ); equal( jQuery("#ap").children().empty().text().length, 0, "Check text is removed" ); equal( jQuery("#ap").children().length, 4, "Check elements are not removed" ); @@ -1838,7 +1838,13 @@ test("empty()", function() { var j = jQuery("#nonnodes").contents(); j.empty(); equal( j.html(), "", "Check node,textnode,comment empty works" ); -}); + + // Ensure oldIE empties selects (#12336) + notEqual( $("#select1").find("option").length, 0, "Have some initial options" ); + $("#select1").empty(); + equal( $("#select1").find("option").length, 0, "No more option elements found" ); + equal( $("#select1")[0].options.length, 0, "options.length cleared as well" ); + }); test( "jQuery.cleanData", function() { |