diff options
author | Felix Nagel <info@felixnagel.com> | 2012-10-12 22:56:45 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2012-10-12 22:56:45 +0200 |
commit | c59fbbaad74f7bee73b57985570f689c9a5d9383 (patch) | |
tree | 89209c996ac48c84a0ce20e77061eaef04f87d6c /tests/unit/tooltip/tooltip_methods.js | |
parent | fc729a8c8ebfbe9c05f8b1ebbd6629898f3fc6c0 (diff) | |
parent | 94221c4e5b11496ef927889e1541d84b5746fb31 (diff) | |
download | jquery-ui-c59fbbaad74f7bee73b57985570f689c9a5d9383.tar.gz jquery-ui-c59fbbaad74f7bee73b57985570f689c9a5d9383.zip |
Merge branch 'master' into selectmenu
Diffstat (limited to 'tests/unit/tooltip/tooltip_methods.js')
-rw-r--r-- | tests/unit/tooltip/tooltip_methods.js | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js index 0af1e06e9..c846d216c 100644 --- a/tests/unit/tooltip/tooltip_methods.js +++ b/tests/unit/tooltip/tooltip_methods.js @@ -3,13 +3,20 @@ module( "tooltip: methods" ); test( "destroy", function() { - expect( 2 ); + expect( 3 ); + var element = $( "#tooltipped1" ); + domEqual( "#tooltipped1", function() { - $( "#tooltipped1" ).tooltip().tooltip( "destroy" ); + element.tooltip().tooltip( "destroy" ); }); // make sure that open tooltips are removed on destroy - $( "#tooltipped1" ).tooltip().tooltip( "open" ).tooltip( "destroy" ); + domEqual( "#tooltipped1", function() { + element + .tooltip() + .tooltip( "open", $.Event( "mouseover", { target: element[0] }) ) + .tooltip( "destroy" ); + }); equal( $( ".ui-tooltip" ).length, 0 ); }); @@ -29,6 +36,23 @@ test( "open/close", function() { $.fx.off = false; }); +// #8626 - Calling open() without an event +test( "open/close with tracking", function() { + expect( 3 ); + $.fx.off = true; + var tooltip, + element = $( "#tooltipped1" ).tooltip({ track: true }); + equal( $( ".ui-tooltip" ).length, 0, "no tooltip on init" ); + + element.tooltip( "open" ); + tooltip = $( "#" + element.data( "ui-tooltip-id" ) ); + ok( tooltip.is( ":visible" ) ); + + element.tooltip( "close" ); + ok( tooltip.is( ":hidden" ) ); + $.fx.off = false; +}); + test( "enable/disable", function() { expect( 7 ); $.fx.off = true; |