]> source.dussan.org Git - jquery-ui.git/commitdiff
Tooltip: Unit test for nested tooltips 782/head
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 21 Oct 2012 17:25:36 +0000 (13:25 -0400)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 21 Oct 2012 17:25:36 +0000 (13:25 -0400)
tests/unit/tooltip/tooltip.html
tests/unit/tooltip/tooltip_core.js

index 2c9667ff5071113ade4c771a41df8e1606cb449f..ca5a1239ae28f4f0902a4b8ff054969c88817bf6 100644 (file)
@@ -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>
index 06fb194cd7cec4aa3c6e5073d22f347d49899991..6e9bee2082fcbf1dfb3257e6db825330fa43aa4e 100644 (file)
@@ -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 ) );