From 42099e44610face58172ed0ed27115fb2b84ab50 Mon Sep 17 00:00:00 2001 From: Daniel Owens Date: Wed, 8 May 2013 12:15:44 -0500 Subject: Tooltip: Accept HTMLElement and jQuery objects for the content option Fixes #9278 Closes #983 Closes #1421 --- tests/unit/tooltip/tooltip_options.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests') 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 = "

this is a test of the emergency broadcast system.

", + 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 = "

this is a test of the emergency broadcast system.

", + 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, -- cgit v1.2.3