From ab703d75f66412a92de34de10629c365861e17ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 30 May 2011 18:51:29 -0400 Subject: [PATCH] Tooltip: Added tests for ui object in open and close events. --- tests/unit/tooltip/tooltip_events.js | 13 +++++++++---- 1 file 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" ); }); -- 2.39.5