aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tooltip
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2014-09-30 09:44:34 -0400
committerScott González <scott.gonzalez@gmail.com>2014-10-09 10:40:58 -0400
commit8825d93dc877d182cf4a3fce37b6c2593cf08552 (patch)
tree26f13bbbbf6c0e843b81ac329a624991acc7b91b /tests/unit/tooltip
parent6833a3169775d4c15dd5e68c96bc63ad0187035e (diff)
downloadjquery-ui-8825d93dc877d182cf4a3fce37b6c2593cf08552.tar.gz
jquery-ui-8825d93dc877d182cf4a3fce37b6c2593cf08552.zip
Tooltip: Properly track hiding and closing for delegated tooltips
Fixes #10602 Closes gh-1353
Diffstat (limited to 'tests/unit/tooltip')
-rw-r--r--tests/unit/tooltip/tooltip_core.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js
index 760ffeed2..2e029c7b0 100644
--- a/tests/unit/tooltip/tooltip_core.js
+++ b/tests/unit/tooltip/tooltip_core.js
@@ -174,4 +174,52 @@ asyncTest( "destroy during hide animation; only one close event", function() {
});
});
+// http://bugs.jqueryui.com/ticket/10602
+asyncTest( "multiple active delegated tooltips", function() {
+ expect( 1 );
+
+ var anchor = $( "#tooltipped1" ),
+ input = anchor.next(),
+ actions = [];
+
+ $( document ).tooltip({
+ show: false,
+ hide: false,
+ open: function( event, ui ) {
+ actions.push( "open:" + ui.tooltip.text() );
+ },
+ close: function( event, ui ) {
+ actions.push( "close:" + ui.tooltip.text() );
+ }
+ });
+
+ function step1() {
+ anchor.simulate( "mouseover" );
+ setTimeout( step2 );
+ }
+
+ function step2() {
+ input.simulate( "focus" );
+ setTimeout( step3 );
+ }
+
+ function step3() {
+ input.simulate( "blur" );
+ setTimeout( step4 );
+ }
+
+ function step4() {
+ anchor.simulate( "mouseout" );
+ deepEqual( actions, [
+ "open:anchortitle",
+ "open:inputtitle",
+ "close:inputtitle",
+ "close:anchortitle"
+ ], "Both tooltips open and close" );
+ start();
+ }
+
+ step1();
+});
+
}( jQuery ) );