2010-05-06 15:10:52 +00:00
|
|
|
/*
|
|
|
|
* menu_core.js
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
(function($) {
|
|
|
|
|
|
|
|
module("menu: core");
|
|
|
|
|
|
|
|
test("accessibility", function () {
|
2011-02-11 14:42:44 +00:00
|
|
|
expect(5);
|
2012-04-19 13:39:21 +00:00
|
|
|
var item,
|
|
|
|
menu = $('#menu1').menu(),
|
|
|
|
item0 = $("li:eq(0) a");
|
2010-05-06 15:10:52 +00:00
|
|
|
|
2012-01-22 17:26:41 +00:00
|
|
|
ok( menu.hasClass("ui-menu ui-widget ui-widget-content ui-corner-all"), "menu class");
|
2012-02-28 14:56:32 +00:00
|
|
|
equal( menu.attr("role"), "menu", "main role");
|
2012-01-22 17:26:41 +00:00
|
|
|
ok( !menu.attr("aria-activedescendant"), "aria attribute not yet active");
|
2011-05-02 18:35:58 +00:00
|
|
|
|
2012-04-19 13:39:21 +00:00
|
|
|
item = menu.find( "li:first" ).find( "a" ).attr( "id", "xid" ).end();
|
2012-01-22 17:26:41 +00:00
|
|
|
menu.menu( "focus", $.Event(), item );
|
2012-02-28 14:56:32 +00:00
|
|
|
equal( menu.attr("aria-activedescendant"), "xid", "aria attribute, id from dom");
|
2011-05-02 18:35:58 +00:00
|
|
|
|
2012-04-19 13:39:21 +00:00
|
|
|
item = menu.find( "li:last" );
|
2012-01-22 17:26:41 +00:00
|
|
|
menu.menu( "focus", $.Event(), item );
|
2012-02-28 14:56:32 +00:00
|
|
|
equal( menu.attr("aria-activedescendant"), "menu1-4", "aria attribute, generated id");
|
2010-05-06 15:10:52 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
})(jQuery);
|