diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-05-22 11:06:44 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-05-22 11:06:44 -0400 |
commit | b6cc9dd870836b94d6f82729d56e592c548f24ea (patch) | |
tree | 2731c6661089fb3a7b723ede7601d12861403c3b /tests/unit/tooltip/tooltip_core.js | |
parent | d7359beee6f8103e997959efd4f070245e9d3225 (diff) | |
download | jquery-ui-b6cc9dd870836b94d6f82729d56e592c548f24ea.tar.gz jquery-ui-b6cc9dd870836b94d6f82729d56e592c548f24ea.zip |
Tooltip: Handle multiple aria-describedby values.
Diffstat (limited to 'tests/unit/tooltip/tooltip_core.js')
-rw-r--r-- | tests/unit/tooltip/tooltip_core.js | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js index e2569fb01..e25eb3c13 100644 --- a/tests/unit/tooltip/tooltip_core.js +++ b/tests/unit/tooltip/tooltip_core.js @@ -3,7 +3,7 @@ module( "tooltip: core" ); test( "markup structure", function() { - expect( 6 ); + expect( 7 ); var element = $( "#tooltipped1" ).tooltip(), tooltip = $( ".ui-tooltip" ); @@ -11,8 +11,9 @@ test( "markup structure", function() { equal( tooltip.length, 0, "no tooltip on init" ); element.tooltip( "open" ); - tooltip = $( "#" + element.attr( "aria-describedby" ) ); + tooltip = $( "#" + element.data( "ui-tooltip-id" ) ); equal( tooltip.length, 1, "tooltip exists" ); + equal( element.attr( "aria-describedby"), tooltip.attr( "id" ), "aria-describedby" ); ok( tooltip.hasClass( "ui-tooltip" ), "tooltip is .ui-tooltip" ); equal( tooltip.length, 1, ".ui-tooltip exists" ); equal( tooltip.find( ".ui-tooltip-content" ).length, 1, @@ -20,8 +21,19 @@ test( "markup structure", function() { }); test( "accessibility", function() { - // TODO: add tests - expect( 0 ); + // TODO: full tests + expect( 2 ); + + var tooltipId, + element = $( "#multiple-describedby" ).tooltip(); + + element.tooltip( "open" ); + tooltipId = element.data( "ui-tooltip-id" ); + equal( element.attr( "aria-describedby" ), "fixture-span " + tooltipId, + "multiple describedby when open" ); + element.tooltip( "close" ); + equal( element.attr( "aria-describedby" ), "fixture-span", + "correct describedby when closed" ); }); }( jQuery ) ); |