diff options
author | Andrew Couch <acouch@bluewolf.com> | 2012-10-15 16:15:36 -0400 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-10-21 13:15:44 -0400 |
commit | 3b2d1e7736be99671af70aa3b775d67b917517e5 (patch) | |
tree | 470fd54aa9e2499c36964a53ba0875ef68499f8e /tests/unit | |
parent | 6b48ef5eca67f389d7a58f3c8a263ceb82c8becb (diff) | |
download | jquery-ui-3b2d1e7736be99671af70aa3b775d67b917517e5.tar.gz jquery-ui-3b2d1e7736be99671af70aa3b775d67b917517e5.zip |
Tooltip: handle removal of elements with delegated tooltips. Fixed #8646 - Delegated tooltips don't close when the tooltipped element is removed
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/tooltip/tooltip.html | 1 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip_core.js | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip.html b/tests/unit/tooltip/tooltip.html index f6e60b367..2c9667ff5 100644 --- a/tests/unit/tooltip/tooltip.html +++ b/tests/unit/tooltip/tooltip.html @@ -43,6 +43,7 @@ <input title="inputtitle"> <span id="multiple-describedby" aria-describedby="fixture-span" title="...">aria-describedby</span> <span id="fixture-span" title="title-text">span</span> + <span id="contains-tooltipped"><span id="contained-tooltipped" title="foobar">baz</span></span> </div> </div> diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js index 2b39253a2..06fb194cd 100644 --- a/tests/unit/tooltip/tooltip_core.js +++ b/tests/unit/tooltip/tooltip_core.js @@ -44,4 +44,17 @@ test( "accessibility", function() { equal( element.attr( "title" ), "...", "title restored when closed" ); }); +test( "delegated removal", function() { + expect( 2 ); + + var container = $( "#contains-tooltipped" ).tooltip(), + element = $( "#contained-tooltipped" ); + + element.trigger( "mouseover" ); + equal( $( ".ui-tooltip" ).length, 1 ); + + container.empty(); + equal( $( ".ui-tooltip" ).length, 0 ); +}); + }( jQuery ) ); |