/[projects]/misc/horsensspejder-web/jquery/jquery-ui-1.10.3/tests/unit/menu/menu_core.js
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/jquery-ui-1.10.3/tests/unit/menu/menu_core.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2125 - (show annotations) (download) (as text)
Wed Mar 12 19:30:05 2014 UTC (10 years, 3 months ago) by torben
File MIME type: application/javascript
File size: 987 byte(s)
initial import
1 (function( $ ) {
2
3 module( "menu: core" );
4
5 test( "markup structure", function() {
6 expect( 6 );
7 var element = $( "#menu1" ).menu();
8 ok( element.hasClass( "ui-menu" ), "main element is .ui-menu" );
9 element.children().each(function( index ) {
10 ok( $( this ).hasClass( "ui-menu-item" ), "child " + index + " is .ui-menu-item" );
11 });
12 });
13
14 test( "accessibility", function () {
15 expect( 4 );
16 var element = $( "#menu1" ).menu();
17
18 equal( element.attr( "role" ), "menu", "main role" );
19 ok( !element.attr( "aria-activedescendant" ), "aria-activedescendant not set" );
20
21 element.menu( "focus", $.Event(), element.children().eq( -2 ) );
22 equal( element.attr( "aria-activedescendant" ), "testID1", "aria-activedescendant from existing id" );
23
24 element.menu( "focus", $.Event(), element.children().eq( 0 ) );
25 ok( /^ui-id-\d+$/.test( element.attr( "aria-activedescendant" ) ), "aria-activedescendant from generated id" );
26
27 // Item roles are tested in the role option tests
28 });
29
30 })( jQuery );

  ViewVC Help
Powered by ViewVC 1.1.20