aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjzaefferer <joern.zaefferer@gmail.com>2010-10-26 17:07:22 +0200
committerjzaefferer <joern.zaefferer@gmail.com>2010-10-26 17:07:22 +0200
commit48a5977d3325869abd7b7ba835eb8ac331fd6eb5 (patch)
tree43fd0cda4af2cdcd33f5f2ae8205b13100caca83 /tests
parentbdd815e8dcdeace8be6dd8005ef443bc5ea20548 (diff)
downloadjquery-ui-48a5977d3325869abd7b7ba835eb8ac331fd6eb5.tar.gz
jquery-ui-48a5977d3325869abd7b7ba835eb8ac331fd6eb5.zip
Tooltip: Implementing event delegation support.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/tooltip/tooltip_defaults.js1
-rw-r--r--tests/unit/tooltip/tooltip_events.js4
-rw-r--r--tests/unit/tooltip/tooltip_options.js5
-rw-r--r--tests/visual/tooltip/tooltip.html45
4 files changed, 33 insertions, 22 deletions
diff --git a/tests/unit/tooltip/tooltip_defaults.js b/tests/unit/tooltip/tooltip_defaults.js
index c9960d334..419d7a085 100644
--- a/tests/unit/tooltip/tooltip_defaults.js
+++ b/tests/unit/tooltip/tooltip_defaults.js
@@ -4,6 +4,7 @@
var tooltip_defaults = {
disabled: false,
+ items: "[title]",
content: $.ui.tooltip.prototype.options.content,
position: {
my: "left center",
diff --git a/tests/unit/tooltip/tooltip_events.js b/tests/unit/tooltip/tooltip_events.js
index 51c56b62e..35620df47 100644
--- a/tests/unit/tooltip/tooltip_events.js
+++ b/tests/unit/tooltip/tooltip_events.js
@@ -24,11 +24,11 @@ test("mouse events", function() {
var e = $("#tooltipped1").tooltip({
open: function(event, ui) {
same( event.type, "tooltipopen" );
- same( event.originalEvent.type, "mouseenter" );
+ same( event.originalEvent.type, "mouseover" );
},
close: function(event, ui) {
same( event.type, "tooltipclose" );
- same( event.originalEvent.type, "mouseleave" );
+ same( event.originalEvent.type, "mouseout" );
}
});
e.trigger("mouseover").trigger("mouseout");
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js
index 99d582489..6962d1e86 100644
--- a/tests/unit/tooltip/tooltip_options.js
+++ b/tests/unit/tooltip/tooltip_options.js
@@ -9,6 +9,11 @@ module("tooltip: options", {
}
});
+
+test("option: items", function() {
+ ok(false, "missing items test");
+});
+
test("content: default", function() {
$("#tooltipped1").tooltip().tooltip("open");
same( $(".ui-tooltip").text(), "anchortitle" );
diff --git a/tests/visual/tooltip/tooltip.html b/tests/visual/tooltip/tooltip.html
index 1e2832e34..6d4e15c9e 100644
--- a/tests/visual/tooltip/tooltip.html
+++ b/tests/visual/tooltip/tooltip.html
@@ -21,16 +21,17 @@
function enable() {
// default
- $("#context1 a, form input, #childish").tooltip();
+ $("#context1, form, #childish").tooltip();
// custom class, replaces ui-widget-content
- $("#context2 [title]").tooltip().each(function() {
+ $("#context2").tooltip().each(function() {
$(this).tooltip("widget").addClass("ui-widget-header");
})
$("#right1").tooltip().tooltip("widget").addClass("ui-state-error");
// synchronous content
- $("#see-footnote").tooltip({
+ $("#footnotes").tooltip({
+ items: "[href^=#]",
content: function() {
return $($(this).attr("href")).html();
}
@@ -70,25 +71,25 @@
}
}).tooltip("widget").addClass("ui-state-highlight");
- var positionOnTop = {
- position: {
- my: "center bottom",
- at: "center top",
- offset: "0 -5"
- }
- };
- $("#button1").button().tooltip(positionOnTop);
+ $("#button1").button();
$("#button2").button({
icons: {
primary: "ui-icon-wrench"
}
- }).tooltip(positionOnTop);
+ });
$("#button3, #button4").button({
icons: {
primary: "ui-icon-wrench"
},
text: false
- }).tooltip(positionOnTop);
+ });
+ $("#buttons").tooltip({
+ position: {
+ my: "center bottom",
+ at: "center top",
+ offset: "0 -5"
+ }
+ });
}
enable();
@@ -121,8 +122,9 @@
collision detection should kick in around here
</div>
- <div style="margin: 2em 0">
- <a id="see-footnote" href="#footnote">I'm a link to a footnote.</a>
+ <div id="footnotes" style="margin: 2em 0">
+ <a href="#footnote1">I'm a link to a footnote.</a>
+ <a href="#footnote2">I'm another link to a footnote.</a>
</div>
<div id="right2" style="position: absolute; right: 1em" title="right aligned element with custom position">
@@ -159,12 +161,15 @@
</div>
</form>
- <button id="button1" title="Button Tooltip">Button Label</button>
- <button id="button2" title="Icon Button">Button with Icon</button>
- <button id="button3">Icon Only Button 1</button>
- <button id="button4">Icon Only Button 2</button>
+ <div id="buttons">
+ <button id="button1" title="Button Tooltip">Button Label</button>
+ <button id="button2" title="Icon Button">Button with Icon</button>
+ <button id="button3">Icon Only Button 1</button>
+ <button id="button4">Icon Only Button 2</button>
+ </div>
- <div id="footnote">This is <strong>the</strong> footnote, including other elements</div>
+ <div id="footnote1">This is <strong>the</strong> footnote, including other elements</div>
+ <div id="footnote2">This is <strong>the other</strong> footnote, including other elements</div>
<button id="disable">Toggle disabled</button>
<button id="toggle">Toggle widget</button>