Skip to content
Permalink
Browse files

tests dialog - added more to the buttons test

  • Loading branch information
rdworth committed Jun 8, 2008
1 parent fa7409b commit f193346177ee558e43531ff4be6c2d57de82cb93
Showing with 10 additions and 6 deletions.
  1. +10 −6 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");

0 comments on commit f193346

Please sign in to comment.
You can’t perform that action at this time.