diff options
Diffstat (limited to 'tests/unit/tooltip/tooltip_methods.js')
-rw-r--r-- | tests/unit/tooltip/tooltip_methods.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js index cb99ea457..1487672cb 100644 --- a/tests/unit/tooltip/tooltip_methods.js +++ b/tests/unit/tooltip/tooltip_methods.js @@ -3,15 +3,25 @@ module( "tooltip: methods" ); test( "destroy", function() { - var beforeHtml = $( "#tooltipped1" ).parent().html(); - var afterHtml = $( "#tooltipped1" ).tooltip().tooltip( "destroy" ).parent().html(); - equal( afterHtml, beforeHtml ); + domEqual( "#tooltipped1", function() { + $( "#tooltipped1" ).tooltip().tooltip( "destroy" ); + }); }); -test( "open", function() { +test( "open/close", function() { + expect( 3 ); + $.fx.off = true; var element = $( "#tooltipped1" ).tooltip(); + equal( $( ".ui-tooltip" ).length, 0, "no tooltip on init" ); +$( ".ui-tooltip" ).each(function() { + console.log( $( this ).html() ); +}); element.tooltip( "open" ); - ok( $( ".ui-tooltip" ).is( ":visible" ) ); + var tooltip = $( "#" + element.attr( "aria-describedby" ) ); + ok( tooltip.is( ":visible" ) ); + element.tooltip( "close" ); + ok( tooltip.is( ":hidden" ) ); + $.fx.off = false; }); /* |