From 7bbda71a32cc4953715ed34eab2ab48c5e736154 Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 1 Feb 2013 08:59:55 -0500 Subject: Dialog: Check for empty array in addition to empty object when checking if there are buttons. Fixes #9043 - Dialog: Buttonpane shown with no buttons when modifying native prototypes. --- tests/unit/dialog/dialog_options.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/unit/dialog/dialog_options.js') diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js index a295b904d..07c2d6860 100644 --- a/tests/unit/dialog/dialog_options.js +++ b/tests/unit/dialog/dialog_options.js @@ -174,6 +174,16 @@ test("buttons - advanced", function() { element.remove(); }); +test("#9043: buttons with Array.prototype modification", function() { + expect( 1 ); + Array.prototype.test = $.noop; + var element = $( "
" ).dialog(); + equal( element.dialog( "widget" ).find( ".ui-dialog-buttonpane" ).length, 0, + "no button pane" ); + element.remove(); + delete Array.prototype.test; +}); + test("closeOnEscape", function() { expect( 6 ); var element = $("
").dialog({ closeOnEscape: false }); -- cgit v1.2.3