diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-10-21 13:25:36 -0400 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-10-21 13:25:36 -0400 |
commit | 78f781fccd2b757afa80e543a03f591ab029550d (patch) | |
tree | 596e8110f12adb03da7e283e8aed3abf98aac16f /tests | |
parent | 132e9f0c72d556a5c97911af8b321b04e75d72aa (diff) | |
download | jquery-ui-78f781fccd2b757afa80e543a03f591ab029550d.tar.gz jquery-ui-78f781fccd2b757afa80e543a03f591ab029550d.zip |
Tooltip: Unit test for nested tooltips
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/tooltip/tooltip.html | 2 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip_core.js | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/unit/tooltip/tooltip.html b/tests/unit/tooltip/tooltip.html index 2c9667ff5..ca5a1239a 100644 --- a/tests/unit/tooltip/tooltip.html +++ b/tests/unit/tooltip/tooltip.html @@ -43,7 +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> + <span id="contains-tooltipped" title="parent"><span id="contained-tooltipped" title="child">baz</span></span> </div> </div> diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js index 06fb194cd..6e9bee208 100644 --- a/tests/unit/tooltip/tooltip_core.js +++ b/tests/unit/tooltip/tooltip_core.js @@ -57,4 +57,20 @@ test( "delegated removal", function() { equal( $( ".ui-tooltip" ).length, 0 ); }); +test( "nested tooltips", function() { + expect( 2 ); + + var child = $( "#contained-tooltipped" ), + parent = $( "#contains-tooltipped" ).tooltip({ + show: null, + hide: null + }); + + parent.trigger( "mouseover" ); + equal( $( ".ui-tooltip:visible" ).text(), "parent" ); + + child.trigger( "mouseover" ); + equal( $( ".ui-tooltip" ).text(), "child" ); +}); + }( jQuery ) ); |