]> source.dussan.org Git - jquery-ui.git/commitdiff
Tooltip: Added tests for ui object in open and close events.
authorScott González <scott.gonzalez@gmail.com>
Mon, 30 May 2011 22:51:29 +0000 (18:51 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 30 May 2011 22:51:29 +0000 (18:51 -0400)
tests/unit/tooltip/tooltip_events.js

index 61026882ec7f5f469a43903d560c6bab3a0585c1..29220705f75fc1bb1903cf0e318366cb0d84fffc 100644 (file)
@@ -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" );
 });