aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dialog.js
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2008-06-08 02:50:32 +0000
committerRichard Worth <rdworth@gmail.com>2008-06-08 02:50:32 +0000
commitf193346177ee558e43531ff4be6c2d57de82cb93 (patch)
treeb4ae4d7e55d31aec9793032e3c42d956eaccc512 /tests/dialog.js
parentfa7409b28bf0a4ab9b505a6b0da511a116729084 (diff)
downloadjquery-ui-f193346177ee558e43531ff4be6c2d57de82cb93.tar.gz
jquery-ui-f193346177ee558e43531ff4be6c2d57de82cb93.zip
tests dialog - added more to the buttons test
Diffstat (limited to 'tests/dialog.js')
-rw-r--r--tests/dialog.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/dialog.js b/tests/dialog.js
index e4efbe862..0a70da97e 100644
--- a/tests/dialog.js
+++ b/tests/dialog.js
@@ -167,13 +167,17 @@ test("autoOpen", function() {
});
test("buttons", function() {
- expect(6);
+ expect(10);
var buttons = {
- "Ok": function() {
- ok(true, "button 1 click fires callback");
+ "Ok": function(ev, ui) {
+ ok(true, "button click fires callback");
+ equals(this, el[0], "context of callback");
+ equals(ev.target, btn[0], "event target");
},
- "Cancel": function() {
- ok(true, "button 2 click fires callback");
+ "Cancel": function(ev, ui) {
+ ok(true, "button click fires callback");
+ equals(this, el[0], "context of callback");
+ equals(ev.target, btn[1], "event target");
}
}
el = $("<div/>").dialog({ buttons: buttons });
@@ -184,8 +188,8 @@ test("buttons", function() {
equals(btn.eq(i).text(), key, "text of button " + (i+1));
i += 1;
});
- btn.simulate("click");
equals(btn.parent().attr('className'), 'ui-dialog-buttonpane', "buttons in container");
+ btn.trigger("click");
});
module("dialog: Methods");