diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-05-30 18:51:29 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-05-30 18:51:29 -0400 |
commit | ab703d75f66412a92de34de10629c365861e17ef (patch) | |
tree | 347d8aa8ad8b2060db0e97935c5d537803b49f9d /tests | |
parent | e530d06c98571c9330fc8cfda62a438d07e8f65b (diff) | |
download | jquery-ui-ab703d75f66412a92de34de10629c365861e17ef.tar.gz jquery-ui-ab703d75f66412a92de34de10629c365861e17ef.zip |
Tooltip: Added tests for ui object in open and close events.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/tooltip/tooltip_events.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/unit/tooltip/tooltip_events.js b/tests/unit/tooltip/tooltip_events.js index 61026882e..29220705f 100644 --- a/tests/unit/tooltip/tooltip_events.js +++ b/tests/unit/tooltip/tooltip_events.js @@ -3,16 +3,21 @@ module( "tooltip: events" ); test( "programmatic triggers", function() { - expect( 2 ); - var element = $( "#tooltipped1" ).tooltip(); + expect( 4 ); + var tooltip, + element = $( "#tooltipped1" ).tooltip(); - element.one( "tooltipopen", function( event ) { + element.one( "tooltipopen", function( event, ui ) { + tooltip = ui.tooltip; ok( !( "originalEvent" in event ), "open" ); + strictEqual( ui.tooltip[0], + $( "#" + element.attr( "aria-describedby" ) )[0], "ui.tooltip" ); }); element.tooltip( "open" ); - element.one( "tooltipclose", function( event ) { + element.one( "tooltipclose", function( event, ui ) { ok( !( "originalEvent" in event ), "close" ); + strictEqual( ui.tooltip[0], tooltip[0], "ui.tooltip" ); }); element.tooltip( "close" ); }); |