Skip to content
Permalink
Browse files

Tooltip: Unit test for nested tooltips

  • Loading branch information...
jzaefferer committed Oct 21, 2012
1 parent 132e9f0 commit 78f781fccd2b757afa80e543a03f591ab029550d
Showing with 17 additions and 1 deletion.
  1. +1 −1 tests/unit/tooltip/tooltip.html
  2. +16 −0 tests/unit/tooltip/tooltip_core.js
@@ -43,7 +43,7 @@ <h2 id="qunit-userAgent"></h2>
<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>
@@ -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 ) );

0 comments on commit 78f781f

Please sign in to comment.
You can’t perform that action at this time.