Changeset 216

Show
Ignore:
Timestamp:
06/07/08 19:50:32 (22 months ago)
Author:
rdworth
Message:

tests dialog - added more to the buttons test

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/dialog.js

    r214 r216  
    168168 
    169169test("buttons", function() { 
    170         expect(6); 
     170        expect(10); 
    171171        var buttons = { 
    172                 "Ok": function() { 
    173                         ok(true, "button 1 click fires callback"); 
     172                "Ok": function(ev, ui) { 
     173                        ok(true, "button click fires callback"); 
     174                        equals(this, el[0], "context of callback"); 
     175                        equals(ev.target, btn[0], "event target"); 
    174176                }, 
    175                 "Cancel": function() { 
    176                         ok(true, "button 2 click fires callback"); 
     177                "Cancel": function(ev, ui) { 
     178                        ok(true, "button click fires callback"); 
     179                        equals(this, el[0], "context of callback"); 
     180                        equals(ev.target, btn[1], "event target"); 
    177181                } 
    178182        } 
     
    185189                i += 1; 
    186190        }); 
    187         btn.simulate("click"); 
    188191        equals(btn.parent().attr('className'), 'ui-dialog-buttonpane', "buttons in container"); 
     192        btn.trigger("click"); 
    189193}); 
    190194