diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-05-22 12:54:09 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-05-22 12:54:09 -0400 |
commit | 1339c1850f394b7200497f2de6e0d7dd13673b59 (patch) | |
tree | 1909bf86b866e840cba77eec6a28b7824cf6fdb3 | |
parent | cb70a5e302aae16fa4b47454c1d7d5aca514bfb7 (diff) | |
download | jquery-ui-1339c1850f394b7200497f2de6e0d7dd13673b59.tar.gz jquery-ui-1339c1850f394b7200497f2de6e0d7dd13673b59.zip |
Tooltip tests: Added accessibility tests.
-rw-r--r-- | tests/unit/tooltip/tooltip_core.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js index e25eb3c13..1c8817aa8 100644 --- a/tests/unit/tooltip/tooltip_core.js +++ b/tests/unit/tooltip/tooltip_core.js @@ -21,19 +21,24 @@ test( "markup structure", function() { }); test( "accessibility", function() { - // TODO: full tests - expect( 2 ); + expect( 5 ); var tooltipId, + tooltip, element = $( "#multiple-describedby" ).tooltip(); element.tooltip( "open" ); tooltipId = element.data( "ui-tooltip-id" ); + tooltip = $( "#" + tooltipId ); + equal( tooltip.attr( "role" ), "tooltip", "role" ); equal( element.attr( "aria-describedby" ), "fixture-span " + tooltipId, "multiple describedby when open" ); + // strictEqual to distinguish between .removeAttr( "title" ) and .attr( "title", "" ) + strictEqual( element.attr( "title" ), undefined, "no title when open" ); element.tooltip( "close" ); equal( element.attr( "aria-describedby" ), "fixture-span", "correct describedby when closed" ); + equal( element.attr( "title" ), "...", "title restored when closed" ); }); }( jQuery ) ); |