aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tooltip
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2012-10-03 22:37:03 +0200
committerFelix Nagel <info@felixnagel.com>2012-10-03 22:37:03 +0200
commitcca4e77a95eb7024c204f4d0719baa2ef6195ed2 (patch)
tree732a8e171647d9b25b1b2988f09dccc5d182bad7 /tests/unit/tooltip
parent5e12c54be1813e1f627d3214c11d7520fb46c647 (diff)
parente8bdf468614e59309b4a02ad4f6c29c1d06083c1 (diff)
downloadjquery-ui-cca4e77a95eb7024c204f4d0719baa2ef6195ed2.tar.gz
jquery-ui-cca4e77a95eb7024c204f4d0719baa2ef6195ed2.zip
Merge branch 'master' into selectmenu
Diffstat (limited to 'tests/unit/tooltip')
-rw-r--r--tests/unit/tooltip/all.html2
-rw-r--r--tests/unit/tooltip/tooltip_options.js29
2 files changed, 30 insertions, 1 deletions
diff --git a/tests/unit/tooltip/all.html b/tests/unit/tooltip/all.html
index 367eb4584..6329326b9 100644
--- a/tests/unit/tooltip/all.html
+++ b/tests/unit/tooltip/all.html
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Tooltip Test Suite</title>
- <script src="../../../jquery-1.8.0.js"></script>
+ <script src="../../../jquery-1.8.2.js"></script>
<link rel="stylesheet" href="../../../external/qunit.css">
<link rel="stylesheet" href="../qunit-composite.css">
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js
index 771da6da7..db193e8fa 100644
--- a/tests/unit/tooltip/tooltip_options.js
+++ b/tests/unit/tooltip/tooltip_options.js
@@ -46,6 +46,35 @@ asyncTest( "content: sync + async callback", function() {
}).tooltip( "open" );
});
+test( "content: change while open", function() {
+ expect( 2 ) ;
+ var element = $( "#tooltipped1" ).tooltip({
+ content: function() {
+ return "old";
+ }
+ });
+
+ element.one( "tooltipopen", function( event, ui ) {
+ equal( ui.tooltip.text(), "old", "original content" );
+ element.tooltip( "option", "content", function() {
+ return "new";
+ });
+ equal( ui.tooltip.text(), "new", "updated content" );
+ });
+
+ element.tooltip( "open" );
+});
+
+test( "content: string", function() {
+ expect( 1 );
+ var element = $( "#tooltipped1" ).tooltip({
+ content: "just a string",
+ open: function( event, ui ) {
+ equal( ui.tooltip.text(), "just a string" );
+ }
+ }).tooltip( "open" );
+});
+
test( "items", function() {
expect( 2 );
var event,