aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/tooltip/tooltip_options.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js
index 2d49533f2..32f739544 100644
--- a/tests/unit/tooltip/tooltip_options.js
+++ b/tests/unit/tooltip/tooltip_options.js
@@ -71,6 +71,28 @@ asyncTest( "content: sync + async callback", function() {
}).tooltip( "open" );
});
+// http://bugs.jqueryui.com/ticket/8740
+asyncTest( "content: async callback loses focus before load", function() {
+ expect( 1 );
+
+ var element = $( "#tooltipped1" ).tooltip({
+ content: function( response ) {
+ setTimeout(function() {
+ element.trigger( "mouseleave" );
+ setTimeout(function() {
+ response( "sometext" );
+ setTimeout(function() {
+ ok( !$( "#" + element.data( "ui-tooltip-id" ) ).is( ":visible" ),
+ "Tooltip should not display" );
+ start();
+ });
+ });
+ });
+ }
+ });
+ element.trigger( "mouseover" );
+});
+
test( "content: change while open", function() {
expect( 2 ) ;
var element = $( "#tooltipped1" ).tooltip({