Tooltip: Added missing items test

This commit is contained in:
jzaefferer 2011-02-11 16:01:23 +01:00
parent cfa4833fe9
commit c4a7f45dbc
2 changed files with 11 additions and 2 deletions

View File

@ -35,10 +35,11 @@
<ol id="qunit-tests"> <ol id="qunit-tests">
</ol> </ol>
<div id="main" style="position: absolute; top: -10000px; left: -10000px;"> <div id="qunit-fixture">
<div> <div>
<a id="tooltipped1" href="#" title="anchortitle">anchor</a> <a id="tooltipped1" href="#" title="anchortitle">anchor</a>
<input title="inputtitle" /> <input title="inputtitle" />
<span data-tooltip="text">span</span>
</div> </div>
</div> </div>

View File

@ -11,7 +11,15 @@ module("tooltip: options", {
test("option: items", function() { test("option: items", function() {
ok(false, "missing items test"); var event = $.Event("mouseenter");
event.target = $("[data-tooltip]");
$("#qunit-fixture").tooltip({
items: "[data-tooltip]",
content: function() {
return $(this).attr("data-tooltip");
}
}).tooltip("open", event);
same( $(".ui-tooltip").text(), "text" );
}); });
test("content: default", function() { test("content: default", function() {