Skip to content
Permalink
Browse files

Menu tests: Cleanup.

  • Loading branch information
scottgonzalez committed Jun 18, 2012
1 parent 35f7a67 commit f92f8bb56bf9e01ccc5d0c84e0f089c3660283d8
@@ -1,29 +1,24 @@
/*
* menu_core.js
*/
(function( $ ) {

module( "menu: core" );

(function($) {

module("menu: core");

test("accessibility", function () {
expect(5);
test( "accessibility", function () {
expect( 5 );
var item,
menu = $('#menu1').menu(),
item0 = $("li:eq(0) a");
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");
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");
equal( menu.attr("aria-activedescendant"), "xid", "aria attribute, id from DOM" );

item = menu.find( "li:last" );
menu.menu( "focus", $.Event(), item );
ok( /^ui-id-\d+$/.test( menu.attr( "aria-activedescendant" ) ), "aria attribute, generated id");
});

})(jQuery);
})( jQuery );

0 comments on commit f92f8bb

Please sign in to comment.
You can’t perform that action at this time.