aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarco Ziech <marco@ziech.net>2015-02-23 19:33:01 -0500
committerScott González <scott.gonzalez@gmail.com>2015-02-25 15:35:49 -0500
commitc4e367bb31c21d7c8b2701c626a92a2f13be5af4 (patch)
treeb32e37809008724254da38f4db2eecfe2cec4bec /tests
parentc1dfb98d4576901aacf35f99d2506e8f652c2690 (diff)
downloadjquery-ui-c4e367bb31c21d7c8b2701c626a92a2f13be5af4.tar.gz
jquery-ui-c4e367bb31c21d7c8b2701c626a92a2f13be5af4.zip
Tooltip: Register event handlers before content is loaded
Fixes #8740 Closes gh-1053 Closes gh-1456
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({