From 78f781fccd2b757afa80e543a03f591ab029550d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Zaefferer?= Date: Sun, 21 Oct 2012 13:25:36 -0400 Subject: [PATCH] Tooltip: Unit test for nested tooltips --- tests/unit/tooltip/tooltip.html | 2 +- tests/unit/tooltip/tooltip_core.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) 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 @@ aria-describedby span - baz + baz 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 ) ); -- 2.39.5