aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog/dialog_options.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-08-31 10:17:53 -0400
committerScott González <scott.gonzalez@gmail.com>2010-08-31 10:17:53 -0400
commit95a34593f98217e3a99f223e2ef3ca0a0fa8343b (patch)
treec4aa2ddd57cdbe9722fc67e5ea992874cfddbb61 /tests/unit/dialog/dialog_options.js
parentdea2f8a7fc1d7c1d8fbf69aa50d7c1f28c3f35b6 (diff)
downloadjquery-ui-95a34593f98217e3a99f223e2ef3ca0a0fa8343b.tar.gz
jquery-ui-95a34593f98217e3a99f223e2ef3ca0a0fa8343b.zip
Dialog: Added additional syntax for creating buttons. Fixes #4344 - Dialog: Enhanced Button Option.
Diffstat (limited to 'tests/unit/dialog/dialog_options.js')
-rw-r--r--tests/unit/dialog/dialog_options.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js
index d20f1d764..2d0cbe907 100644
--- a/tests/unit/dialog/dialog_options.js
+++ b/tests/unit/dialog/dialog_options.js
@@ -71,6 +71,31 @@ test("buttons", function() {
el.remove();
});
+test("buttons - advanced", function() {
+ expect(5);
+
+ el = $("<div></div>").dialog({
+ buttons: [
+ {
+ text: "a button",
+ "class": "additional-class",
+ id: "my-button-id",
+ click: function() {
+ equals(this, el[0], "correct context");
+ }
+ }
+ ]
+ });
+ var buttons = dlg().find("button");
+ equals(buttons.length, 1, "correct number of buttons");
+ equals(buttons.attr("id"), "my-button-id", "correct id");
+ equals(buttons.text(), "a button", "correct label");
+ ok(buttons.hasClass("additional-class"), "additional classes added");
+ buttons.click();
+
+ el.remove();
+});
+
test("closeOnEscape", function() {
el = $('<div></div>').dialog({ closeOnEscape: false });
ok(true, 'closeOnEscape: false');