aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2013-02-01 08:59:55 -0500
committerScott González <scott.gonzalez@gmail.com>2013-02-01 08:59:55 -0500
commit7bbda71a32cc4953715ed34eab2ab48c5e736154 (patch)
treeb2739ba5c4712fb87ec4bc75fdd68c2f7cf23736 /tests/unit/dialog
parent62cda1f95d0e7040153f0b5fe5745d199a0a094e (diff)
downloadjquery-ui-7bbda71a32cc4953715ed34eab2ab48c5e736154.tar.gz
jquery-ui-7bbda71a32cc4953715ed34eab2ab48c5e736154.zip
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.
Diffstat (limited to 'tests/unit/dialog')
-rw-r--r--tests/unit/dialog/dialog_options.js10
1 files changed, 10 insertions, 0 deletions
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 = $( "<div></div>" ).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 = $("<div></div>").dialog({ closeOnEscape: false });