Skip to content

Commit 78f781f

Browse files
committed
Tooltip: Unit test for nested tooltips
1 parent 132e9f0 commit 78f781f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

tests/unit/tooltip/tooltip.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h2 id="qunit-userAgent"></h2>
4343
<input title="inputtitle">
4444
<span id="multiple-describedby" aria-describedby="fixture-span" title="...">aria-describedby</span>
4545
<span id="fixture-span" title="title-text">span</span>
46-
<span id="contains-tooltipped"><span id="contained-tooltipped" title="foobar">baz</span></span>
46+
<span id="contains-tooltipped" title="parent"><span id="contained-tooltipped" title="child">baz</span></span>
4747
</div>
4848

4949
</div>

tests/unit/tooltip/tooltip_core.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,20 @@ test( "delegated removal", function() {
5757
equal( $( ".ui-tooltip" ).length, 0 );
5858
});
5959

60+
test( "nested tooltips", function() {
61+
expect( 2 );
62+
63+
var child = $( "#contained-tooltipped" ),
64+
parent = $( "#contains-tooltipped" ).tooltip({
65+
show: null,
66+
hide: null
67+
});
68+
69+
parent.trigger( "mouseover" );
70+
equal( $( ".ui-tooltip:visible" ).text(), "parent" );
71+
72+
child.trigger( "mouseover" );
73+
equal( $( ".ui-tooltip" ).text(), "child" );
74+
});
75+
6076
}( jQuery ) );

0 commit comments

Comments
 (0)