aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tooltip/tooltip_options.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-28 17:55:45 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-28 17:55:45 -0400
commit215599309660733221d51830d12f2ed117961b36 (patch)
treeb589b19adc2eeaa2cd8bdd793bc655b78b45c904 /tests/unit/tooltip/tooltip_options.js
parent4dbfdcede3878415dbf5c777e9e2ce17c6916edc (diff)
downloadjquery-ui-215599309660733221d51830d12f2ed117961b36.tar.gz
jquery-ui-215599309660733221d51830d12f2ed117961b36.zip
Tooltip: Fixed tooltipClass option and added test.
Diffstat (limited to 'tests/unit/tooltip/tooltip_options.js')
-rw-r--r--tests/unit/tooltip/tooltip_options.js46
1 files changed, 27 insertions, 19 deletions
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js
index bbbab72ff..04bb4c6a4 100644
--- a/tests/unit/tooltip/tooltip_options.js
+++ b/tests/unit/tooltip/tooltip_options.js
@@ -2,25 +2,6 @@
module( "tooltip: options" );
-test( "items", function() {
- expect( 2 );
- var element = $( "#qunit-fixture" ).tooltip({
- items: "#fixture-span"
- });
-
- var event = $.Event( "mouseenter" );
- event.target = $( "#fixture-span" )[ 0 ];
- element.tooltip( "open", event );
- same( $( "#" + $( "#fixture-span" ).attr( "aria-describedby" ) ).text(), "title-text" );
-
- // make sure default [title] doesn't get used
- event.target = $( "#tooltipped1" )[ 0 ];
- element.tooltip( "open", event );
- same( $( "#tooltipped1" ).attr( "aria-describedby" ), undefined );
-
- element.tooltip( "destroy" );
-});
-
test( "content: default", function() {
var element = $( "#tooltipped1" ).tooltip().tooltip( "open" );
same( $( "#" + element.attr( "aria-describedby" ) ).text(), "anchortitle" );
@@ -62,4 +43,31 @@ asyncTest( "content: sync + async callback", function() {
}).tooltip( "open" );
});
+test( "items", function() {
+ expect( 2 );
+ var element = $( "#qunit-fixture" ).tooltip({
+ items: "#fixture-span"
+ });
+
+ var event = $.Event( "mouseenter" );
+ event.target = $( "#fixture-span" )[ 0 ];
+ element.tooltip( "open", event );
+ same( $( "#" + $( "#fixture-span" ).attr( "aria-describedby" ) ).text(), "title-text" );
+
+ // make sure default [title] doesn't get used
+ event.target = $( "#tooltipped1" )[ 0 ];
+ element.tooltip( "open", event );
+ same( $( "#tooltipped1" ).attr( "aria-describedby" ), undefined );
+
+ element.tooltip( "destroy" );
+});
+
+test( "tooltipClass", function() {
+ expect( 1 )
+ var element = $( "#tooltipped1" ).tooltip({
+ tooltipClass: "custom"
+ }).tooltip( "open" );
+ ok( $( "#" + element.attr( "aria-describedby" ) ).hasClass( "custom" ) );
+});
+
}( jQuery ) );