mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
Tooltip tests: Added accessibility tests.
This commit is contained in:
parent
cb70a5e302
commit
1339c1850f
@ -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 ) );
|
||||
|
Loading…
Reference in New Issue
Block a user