]> source.dussan.org Git - jquery-ui.git/commitdiff
Tooltip: Added missing items test
authorjzaefferer <joern.zaefferer@gmail.com>
Fri, 11 Feb 2011 15:01:23 +0000 (16:01 +0100)
committerjzaefferer <joern.zaefferer@gmail.com>
Fri, 11 Feb 2011 15:01:23 +0000 (16:01 +0100)
tests/unit/tooltip/tooltip.html
tests/unit/tooltip/tooltip_options.js

index 64efb72e11d0d4a391c87e78b3a66cc3c8da6bc0..086192d4fa4e79bd97a554feb6d0c0680752aa79 100644 (file)
 <ol id="qunit-tests">
 </ol>
 
-<div id="main" style="position: absolute; top: -10000px; left: -10000px;">
+<div id="qunit-fixture">
        <div>
                <a id="tooltipped1" href="#" title="anchortitle">anchor</a>
                <input title="inputtitle" />
+               <span data-tooltip="text">span</span>
        </div>
 </div>
 
index 6962d1e8600787e652638c1148deee16c86993db..ea4b14229c09f8e4dfe4181d6fe925610c6c6f4a 100644 (file)
@@ -11,7 +11,15 @@ module("tooltip: options", {
 
 
 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() {