aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tooltip/tooltip_options.js
diff options
context:
space:
mode:
authorDaniel Owens <daniel@matchstickmixup.com>2013-05-08 12:15:44 -0500
committerJörn Zaefferer <joern.zaefferer@gmail.com>2015-01-12 18:37:57 +0100
commit42099e44610face58172ed0ed27115fb2b84ab50 (patch)
treee97d8b5f9603bf04be982295b35c1fb51d2a1702 /tests/unit/tooltip/tooltip_options.js
parentae1d6d5f90236405023964bb3061eccd6c625e39 (diff)
downloadjquery-ui-42099e44610face58172ed0ed27115fb2b84ab50.tar.gz
jquery-ui-42099e44610face58172ed0ed27115fb2b84ab50.zip
Tooltip: Accept HTMLElement and jQuery objects for the content option
Fixes #9278 Closes #983 Closes #1421
Diffstat (limited to 'tests/unit/tooltip/tooltip_options.js')
-rw-r--r--tests/unit/tooltip/tooltip_options.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js
index 17f0a4237..2d49533f2 100644
--- a/tests/unit/tooltip/tooltip_options.js
+++ b/tests/unit/tooltip/tooltip_options.js
@@ -100,6 +100,30 @@ test( "content: string", function() {
}).tooltip( "open" );
});
+test( "content: element", function() {
+ expect( 1 );
+ var content = "<p>this is a <i>test</i> of the emergency broadcast system.</p>",
+ element = $( content )[ 0 ];
+ $( "#tooltipped1" ).tooltip({
+ content: element,
+ open: function( event, ui ) {
+ equal( ui.tooltip.children().html().toLowerCase(), content );
+ }
+ }).tooltip( "open" );
+});
+
+test( "content: jQuery", function() {
+ expect( 1 );
+ var content = "<p>this is a <i>test</i> of the emergency broadcast system.</p>",
+ element = $( content );
+ $( "#tooltipped1" ).tooltip({
+ content: element,
+ open: function( event, ui ) {
+ equal( ui.tooltip.children().html().toLowerCase(), content );
+ }
+ }).tooltip( "open" );
+});
+
test( "items", function() {
expect( 2 );
var event,