aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog
diff options
context:
space:
mode:
authorDouglas Neiner <doug@pixelgraphics.us>2011-03-02 12:52:21 -0500
committerScott González <scott.gonzalez@gmail.com>2011-03-03 09:37:16 -0500
commit15c97e0b76b4576d0c7bee9d54dc4662c23502b9 (patch)
treead1b0605c342c93193607876faa2073c900c5a33 /tests/unit/dialog
parent5c6afa8e7bcf0b7111245ad703d28cfcefc1d59f (diff)
downloadjquery-ui-15c97e0b76b4576d0c7bee9d54dc4662c23502b9.tar.gz
jquery-ui-15c97e0b76b4576d0c7bee9d54dc4662c23502b9.zip
Dialog: Added a class to dialog wrapper when it is currently displaying buttons, includes unit tests for changes. Fixed #7057 - An extra class is needed on the dialog wrapper to specify when a buttonset is showing
Diffstat (limited to 'tests/unit/dialog')
-rw-r--r--tests/unit/dialog/dialog_options.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js
index 82f28bf85..fb8dea775 100644
--- a/tests/unit/dialog/dialog_options.js
+++ b/tests/unit/dialog/dialog_options.js
@@ -18,7 +18,7 @@ test("autoOpen", function() {
});
test("buttons", function() {
- expect(17);
+ expect(21);
var buttons = {
"Ok": function(ev, ui) {
@@ -44,6 +44,8 @@ test("buttons", function() {
});
ok(btn.parent().hasClass('ui-dialog-buttonset'), "buttons in container");
+ ok(el.parent().hasClass('ui-dialog-buttons'), "dialog wrapper adds class about having buttons");
+
btn.trigger("click");
var newButtons = {
@@ -67,6 +69,12 @@ test("buttons", function() {
equals(btn.eq(i).text(), key, "text of button " + (i+1));
i += 1;
});
+
+ el.dialog("option", "buttons", null);
+ btn = $("button", dlg());
+ equals(btn.length, 0, "all buttons have been removed");
+ equals(el.find(".ui-dialog-buttonset").length, 0, "buttonset has been removed");
+ equals(el.parent().hasClass('ui-dialog-buttons'), false, "dialog wrapper removes class about having buttons");
el.remove();
});