diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-10-05 11:26:49 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-10-05 11:26:49 -0400 |
commit | 96f2aa4c72b5f29782b0736ed95468e50d338d6e (patch) | |
tree | 71a3a5608b36f783841db7c2a220d072df68ac41 /tests/unit | |
parent | f417a92c544d48dd61134b2d60336aaebf405afa (diff) | |
download | jquery-ui-96f2aa4c72b5f29782b0736ed95468e50d338d6e.tar.gz jquery-ui-96f2aa4c72b5f29782b0736ed95468e50d338d6e.zip |
Tooltip: Check if event exists before checking properties in open(). Fixes #8626 - Programatically opening a tooltip with out giving an event results in a javascript error.
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/tooltip/tooltip_methods.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js index 0af1e06e9..896e910c6 100644 --- a/tests/unit/tooltip/tooltip_methods.js +++ b/tests/unit/tooltip/tooltip_methods.js @@ -29,6 +29,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; |