aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-29 20:50:21 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-29 20:50:21 -0400
commit8c085cd27ce5d2c765a2d762a863e52d1fc6308c (patch)
tree5c7542bde1f5f43dbf26b7ca939c3bd07697b20f /tests
parent76586076ecc85fac044c02995c938a46aa1dbab2 (diff)
downloadjquery-ui-8c085cd27ce5d2c765a2d762a863e52d1fc6308c.tar.gz
jquery-ui-8c085cd27ce5d2c765a2d762a863e52d1fc6308c.zip
Tooltip: Fixed handling of disabled tooltips.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/tooltip/tooltip_methods.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js
index b1b319d96..798d55896 100644
--- a/tests/unit/tooltip/tooltip_methods.js
+++ b/tests/unit/tooltip/tooltip_methods.js
@@ -28,6 +28,32 @@ test( "open/close", function() {
$.fx.off = false;
});
+test( "enable/disable", function() {
+ expect( 7 );
+ $.fx.off = true;
+ var element = $( "#tooltipped1" ).tooltip();
+ equal( $( ".ui-tooltip" ).length, 0, "no tooltip on init" );
+
+ element.tooltip( "open" );
+ var tooltip = $( "#" + element.attr( "aria-describedby" ) );
+ ok( tooltip.is( ":visible" ) );
+
+ element.tooltip( "disable" );
+ equal( $( ".ui-tooltip" ).length, 0, "no tooltip when disabled" );
+ equal( tooltip.attr( "title" ), "", "title removed on disable" );
+
+ element.tooltip( "open" );
+ equal( $( ".ui-tooltip" ).length, 0, "open does nothing when disabled" );
+
+ element.tooltip( "enable" );
+ equal( element.attr( "title" ), "anchortitle", "title restored on enable" );
+
+ element.tooltip( "open" );
+ tooltip = $( "#" + element.attr( "aria-describedby" ) );
+ ok( tooltip.is( ":visible" ) );
+ $.fx.off = false;
+});
+
/*
TODO currently tooltip doesn't override widget
can't return anything useful if no element is kept around and there's no useful reference