From: Scott González Date: Mon, 30 May 2011 22:51:29 +0000 (-0400) Subject: Tooltip: Added tests for ui object in open and close events. X-Git-Tag: 1.9m6~110^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ab703d75f66412a92de34de10629c365861e17ef;p=jquery-ui.git Tooltip: Added tests for ui object in open and close events. --- 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" ); });