mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
30 lines
766 B
JavaScript
30 lines
766 B
JavaScript
/*
|
|
* menu_core.js
|
|
*/
|
|
|
|
|
|
(function($) {
|
|
|
|
module("menu: core");
|
|
|
|
test("accessibility", function () {
|
|
expect(5);
|
|
var item,
|
|
menu = $('#menu1').menu(),
|
|
item0 = $("li:eq(0) a");
|
|
|
|
ok( menu.hasClass("ui-menu ui-widget ui-widget-content ui-corner-all"), "menu class");
|
|
equal( menu.attr("role"), "menu", "main role");
|
|
ok( !menu.attr("aria-activedescendant"), "aria attribute not yet active");
|
|
|
|
item = menu.find( "li:first" ).find( "a" ).attr( "id", "xid" ).end();
|
|
menu.menu( "focus", $.Event(), item );
|
|
equal( menu.attr("aria-activedescendant"), "xid", "aria attribute, id from dom");
|
|
|
|
item = menu.find( "li:last" );
|
|
menu.menu( "focus", $.Event(), item );
|
|
equal( menu.attr("aria-activedescendant"), "menu1-4", "aria attribute, generated id");
|
|
});
|
|
|
|
})(jQuery);
|