Skip to content

Commit c4a7f45

Browse files
committed
Tooltip: Added missing items test
1 parent cfa4833 commit c4a7f45

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

tests/unit/tooltip/tooltip.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ <h2 id="qunit-userAgent"></h2>
3535
<ol id="qunit-tests">
3636
</ol>
3737

38-
<div id="main" style="position: absolute; top: -10000px; left: -10000px;">
38+
<div id="qunit-fixture">
3939
<div>
4040
<a id="tooltipped1" href="#" title="anchortitle">anchor</a>
4141
<input title="inputtitle" />
42+
<span data-tooltip="text">span</span>
4243
</div>
4344
</div>
4445

tests/unit/tooltip/tooltip_options.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ module("tooltip: options", {
1111

1212

1313
test("option: items", function() {
14-
ok(false, "missing items test");
14+
var event = $.Event("mouseenter");
15+
event.target = $("[data-tooltip]");
16+
$("#qunit-fixture").tooltip({
17+
items: "[data-tooltip]",
18+
content: function() {
19+
return $(this).attr("data-tooltip");
20+
}
21+
}).tooltip("open", event);
22+
same( $(".ui-tooltip").text(), "text" );
1523
});
1624

1725
test("content: default", function() {

0 commit comments

Comments
 (0)