aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/menu/menu.html321
-rw-r--r--tests/unit/menu/menu_events.js16
-rw-r--r--tests/unit/menu/menu_methods.js4
-rw-r--r--tests/unit/menu/menu_options.js27
-rw-r--r--tests/unit/menu/menu_test_helpers.js2
5 files changed, 179 insertions, 191 deletions
diff --git a/tests/unit/menu/menu.html b/tests/unit/menu/menu.html
index ed376232e..7de175b3c 100644
--- a/tests/unit/menu/menu.html
+++ b/tests/unit/menu/menu.html
@@ -48,220 +48,211 @@
<div id="qunit-fixture">
<ul class="foo" id="menu1">
- <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
- <li class="foo"><a class="foo" href="#">Ada</a></li>
- <li class="foo"><a class="foo" href="#">Adamsville</a></li>
- <li class="foo"><a id="testID1" class="foo" href="#">Addyston</a></li>
- <li class="foo"><a class="foo" href="#">Adelphi</a></li>
+ <li class="foo">Aberdeen</li>
+ <li class="foo">Ada</li>
+ <li class="foo">Adamsville</li>
+ <li id="testID1" class="foo">Addyston</li>
+ <li class="foo">Adelphi</li>
</ul>
<ul id="menu2">
- <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
- <li class="foo"><a class="foo" href="#">Ada</a></li>
- <li class="foo"><a class="foo" href="#">Adamsville</a></li>
- <li class="foo"><a class="foo" href="#"><span class="ui-icon ui-icon-print"></span>Addyston</a></li>
- <li>
- <a href="#">Delphi</a>
+ <li class="foo">Aberdeen</li>
+ <li class="foo">Ada</li>
+ <li class="foo">Adamsville</li>
+ <li class="foo"><span class="ui-icon ui-icon-print"></span>Addyston</li>
+ <li>Delphi
<ul>
- <li class="foo"><a class="foo" href="#">Ada</a></li>
- <li class="foo"><a class="foo" href="#">Saarland</a></li>
- <li class="foo"><a class="foo" href="#">Salzburg</a></li>
+ <li class="foo">Ada</li>
+ <li class="foo">Saarland</li>
+ <li class="foo">Salzburg</li>
</ul>
</li>
- <li class="foo"><a class="foo" href="#">Saarland</a></li>
- <li>
- <a href="#">Salzburg</a>
+ <li class="foo">Saarland</li>
+ <li>Salzburg
<ul>
- <li>
- <a href="#">Delphi</a>
+ <li>Delphi
<ul>
- <li class="foo"><a class="foo" href="#">Ada</a></li>
- <li class="foo"><a class="foo" href="#">Saarland</a></li>
- <li class="foo"><a class="foo" href="#">Salzburg</a></li>
+ <li class="foo">Ada</li>
+ <li class="foo">Saarland</li>
+ <li class="foo">Salzburg</li>
</ul>
</li>
- <li>
- <a href="#">Delphi</a>
+ <li>Delphi
<ul>
- <li class="foo"><a class="foo" href="#">Ada</a></li>
+ <li class="foo">Ada</li>
<li> - </li>
- <li class="foo"><a class="foo" href="#">Saarland</a></li>
+ <li class="foo">Saarland</li>
<li></li>
- <li class="foo"><a class="foo" href="#">Salzburg</a></li>
+ <li class="foo">Salzburg</li>
<li>&ndash;</li>
</ul>
</li>
- <li class="foo"><a class="foo" href="#">Perch</a></li>
+ <li class="foo">Perch</li>
</ul>
</li>
</ul>
<ul class="foo" id="menu3">
- <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
- <li class="foo"><a class="foo" href="#">Ada</a></li>
- <li class="foo"><a class="foo" href="#">Adamsville</a></li>
- <li class="foo"><a class="foo" href="#">Addyston</a></li>
- <li class="foo"><a class="foo" href="#">Adelphi</a></li>
- <li class="foo"><a class="foo" href="#">Adena</a></li>
- <li class="foo"><a class="foo" href="#">Adrian</a></li>
- <li class="foo"><a class="foo" href="#">Akron</a></li>
- <li class="foo"><a class="foo" href="#">Albany</a></li>
- <li class="foo"><a class="foo" href="#">Alexandria</a></li>
- <li class="foo"><a class="foo" href="#">Alger</a></li>
- <li class="foo"><a class="foo" href="#">Alledonia</a></li>
- <li class="foo"><a class="foo" href="#">Alliance</a></li>
- <li class="foo"><a class="foo" href="#">Alpha</a></li>
- <li class="foo"><a class="foo" href="#">Alvada</a></li>
- <li class="foo"><a class="foo" href="#">Alvordton</a></li>
- <li class="foo"><a class="foo" href="#">Amanda</a></li>
- <li class="foo"><a class="foo" href="#">Amelia</a></li>
- <li class="foo"><a class="foo" href="#">Amesville</a></li>
- <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
- <li class="foo"><a class="foo" href="#">Ada</a></li>
- <li class="foo"><a class="foo" href="#">Adamsville</a></li>
- <li class="foo"><a class="foo" href="#">Addyston</a></li>
- <li class="foo"><a class="foo" href="#">Adelphi</a></li>
- <li class="foo"><a class="foo" href="#">Adena</a></li>
- <li class="foo"><a class="foo" href="#">Adrian</a></li>
- <li class="foo"><a class="foo" href="#">Akron</a></li>
- <li class="foo"><a class="foo" href="#">Albany</a></li>
- <li class="foo"><a class="foo" href="#">Alexandria</a></li>
- <li class="foo"><a class="foo" href="#">Alger</a></li>
- <li class="foo"><a class="foo" href="#">Alledonia</a></li>
- <li class="foo"><a class="foo" href="#">Alliance</a></li>
- <li class="foo"><a class="foo" href="#">Alpha</a></li>
- <li class="foo"><a class="foo" href="#">Alvada</a></li>
- <li class="foo"><a class="foo" href="#">Alvordton</a></li>
- <li class="foo"><a class="foo" href="#">Amanda</a></li>
- <li class="foo"><a class="foo" href="#">Amelia</a></li>
- <li class="foo"><a class="foo" href="#">Amesville</a></li>
+ <li class="foo">Aberdeen</li>
+ <li class="foo">Ada</li>
+ <li class="foo">Adamsville</li>
+ <li class="foo">Addyston</li>
+ <li class="foo">Adelphi</li>
+ <li class="foo">Adena</li>
+ <li class="foo">Adrian</li>
+ <li class="foo">Akron</li>
+ <li class="foo">Albany</li>
+ <li class="foo">Alexandria</li>
+ <li class="foo">Alger</li>
+ <li class="foo">Alledonia</li>
+ <li class="foo">Alliance</li>
+ <li class="foo">Alpha</li>
+ <li class="foo">Alvada</li>
+ <li class="foo">Alvordton</li>
+ <li class="foo">Amanda</li>
+ <li class="foo">Amelia</li>
+ <li class="foo">Amesville</li>
+ <li class="foo">Aberdeen</li>
+ <li class="foo">Ada</li>
+ <li class="foo">Adamsville</li>
+ <li class="foo">Addyston</li>
+ <li class="foo">Adelphi</li>
+ <li class="foo">Adena</li>
+ <li class="foo">Adrian</li>
+ <li class="foo">Akron</li>
+ <li class="foo">Albany</li>
+ <li class="foo">Alexandria</li>
+ <li class="foo">Alger</li>
+ <li class="foo">Alledonia</li>
+ <li class="foo">Alliance</li>
+ <li class="foo">Alpha</li>
+ <li class="foo">Alvada</li>
+ <li class="foo">Alvordton</li>
+ <li class="foo">Amanda</li>
+ <li class="foo">Amelia</li>
+ <li class="foo">Amesville</li>
</ul>
<ul class="foo" id="menu4">
- <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
+ <li class="foo">Aberdeen</li>
<li class="foo">
- <a class="foo" href="#">Ada</a>
+ Ada
<ul class="foo">
- <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
- <li class="foo"><a class="foo" href="#">Ada</a></li>
- <li class="foo"><a class="foo" href="#">Adamsville</a></li>
- <li class="foo"><a class="foo" href="#">Addyston</a></li>
- <li class="foo"><a class="foo" href="#">Adelphi</a></li>
- <li class="foo"><a class="foo" href="#">Adena</a></li>
- <li class="foo"><a class="foo" href="#">Adrian</a></li>
- <li class="foo"><a class="foo" href="#">Akron</a></li>
- <li class="foo"><a class="foo" href="#">Albany</a></li>
- <li class="foo"><a class="foo" href="#">Alexandria</a></li>
- <li class="foo"><a class="foo" href="#">Alger</a></li>
- <li class="foo"><a class="foo" href="#">Alledonia</a></li>
- <li class="foo"><a class="foo" href="#">Alliance</a></li>
- <li class="foo"><a class="foo" href="#">Alpha</a></li>
- <li class="foo"><a class="foo" href="#">Alvada</a></li>
- <li class="foo"><a class="foo" href="#">Alvordton</a></li>
- <li class="foo"><a class="foo" href="#">Amanda</a></li>
- <li class="foo"><a class="foo" href="#">Amelia</a></li>
- <li class="foo"><a class="foo" href="#">Amesville</a></li>
- <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
- <li class="foo"><a class="foo" href="#">Ada</a></li>
- <li class="foo"><a class="foo" href="#">Adamsville</a></li>
- <li class="foo"><a class="foo" href="#">Addyston</a></li>
- <li class="foo"><a class="foo" href="#">Adelphi</a></li>
- <li class="foo"><a class="foo" href="#">Adena</a></li>
- <li class="foo"><a class="foo" href="#">Adrian</a></li>
- <li class="foo"><a class="foo" href="#">Akron</a></li>
- <li class="foo"><a class="foo" href="#">Albany</a></li>
+ <li class="foo">Aberdeen</li>
+ <li class="foo">Ada</li>
+ <li class="foo">Adamsville</li>
+ <li class="foo">Addyston</li>
+ <li class="foo">Adelphi</li>
+ <li class="foo">Adena</li>
+ <li class="foo">Adrian</li>
+ <li class="foo">Akron</li>
+ <li class="foo">Albany</li>
+ <li class="foo">Alexandria</li>
+ <li class="foo">Alger</li>
+ <li class="foo">Alledonia</li>
+ <li class="foo">Alliance</li>
+ <li class="foo">Alpha</li>
+ <li class="foo">Alvada</li>
+ <li class="foo">Alvordton</li>
+ <li class="foo">Amanda</li>
+ <li class="foo">Amelia</li>
+ <li class="foo">Amesville</li>
+ <li class="foo">Aberdeen</li>
+ <li class="foo">Ada</li>
+ <li class="foo">Adamsville</li>
+ <li class="foo">Addyston</li>
+ <li class="foo">Adelphi</li>
+ <li class="foo">Adena</li>
+ <li class="foo">Adrian</li>
+ <li class="foo">Akron</li>
+ <li class="foo">Albany</li>
</ul>
</li>
- <li class="foo"><a class="foo" href="#">Adamsville</a></li>
- <li class="foo"><a class="foo" href="#">Addyston</a></li>
- <li class="foo"><a class="foo" href="#">Adelphi</a></li>
- <li class="foo"><a class="foo" href="#">Adena</a></li>
- <li class="foo"><a class="foo" href="#">Adrian</a></li>
- <li class="foo"><a class="foo" href="#">Akron</a></li>
- <li class="foo"><a class="foo" href="#">Albany</a></li>
- <li class="foo"><a class="foo" href="#">Alexandria</a></li>
- <li class="foo"><a class="foo" href="#">Alger</a></li>
- <li class="foo"><a class="foo" href="#">Alledonia</a></li>
- <li class="foo"><a class="foo" href="#">Alliance</a></li>
- <li class="foo"><a class="foo" href="#">Alpha</a></li>
- <li class="foo"><a class="foo" href="#">Alvada</a></li>
- <li class="foo"><a class="foo" href="#">Alvordton</a></li>
- <li class="foo"><a class="foo" href="#">Amanda</a></li>
- <li class="foo"><a class="foo" href="#">Amelia</a></li>
- <li class="foo"><a class="foo" href="#">Amesville</a></li>
- <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
- <li class="foo"><a class="foo" href="#">Ada</a></li>
- <li class="foo"><a class="foo" href="#">Adamsville</a></li>
- <li class="foo"><a class="foo" href="#">Addyston</a></li>
- <li class="foo"><a class="foo" href="#">Adelphi</a></li>
- <li class="foo"><a class="foo" href="#">Adena</a></li>
- <li class="foo"><a class="foo" href="#">Adrian</a></li>
- <li class="foo"><a class="foo" href="#">Akron</a></li>
- <li class="foo"><a class="foo" href="#">Albany</a></li>
- <li class="foo"><a class="foo" href="#">Alexandria</a></li>
- <li class="foo"><a class="foo" href="#">Alger</a></li>
- <li class="foo"><a class="foo" href="#">Alledonia</a></li>
- <li class="foo"><a class="foo" href="#">Alliance</a></li>
- <li class="foo"><a class="foo" href="#">Alpha</a></li>
- <li class="foo"><a class="foo" href="#">Alvada</a></li>
- <li class="foo"><a class="foo" href="#">Alvordton</a></li>
- <li class="foo"><a class="foo" href="#">Amanda</a></li>
- <li class="foo"><a class="foo" href="#">Amelia</a></li>
- <li class="foo"><a class="foo" href="#">Amesville</a></li>
+ <li class="foo">Adamsville</li>
+ <li class="foo">Addyston</li>
+ <li class="foo">Adelphi</li>
+ <li class="foo">Adena</li>
+ <li class="foo">Adrian</li>
+ <li class="foo">Akron</li>
+ <li class="foo">Albany</li>
+ <li class="foo">Alexandria</li>
+ <li class="foo">Alger</li>
+ <li class="foo">Alledonia</li>
+ <li class="foo">Alliance</li>
+ <li class="foo">Alpha</li>
+ <li class="foo">Alvada</li>
+ <li class="foo">Alvordton</li>
+ <li class="foo">Amanda</li>
+ <li class="foo">Amelia</li>
+ <li class="foo">Amesville</li>
+ <li class="foo">Aberdeen</li>
+ <li class="foo">Ada</li>
+ <li class="foo">Adamsville</li>
+ <li class="foo">Addyston</li>
+ <li class="foo">Adelphi</li>
+ <li class="foo">Adena</li>
+ <li class="foo">Adrian</li>
+ <li class="foo">Akron</li>
+ <li class="foo">Albany</li>
+ <li class="foo">Alexandria</li>
+ <li class="foo">Alger</li>
+ <li class="foo">Alledonia</li>
+ <li class="foo">Alliance</li>
+ <li class="foo">Alpha</li>
+ <li class="foo">Alvada</li>
+ <li class="foo">Alvordton</li>
+ <li class="foo">Amanda</li>
+ <li class="foo">Amelia</li>
+ <li class="foo">Amesville</li>
</ul>
<div id="menu5">
- <blockquote><a href="#">Aberdeen</a></blockquote>
- <blockquote><a href="#">Ada</a></blockquote>
- <blockquote><a href="#">Adamsville</a></blockquote>
- <blockquote><a href="#">Addyston</a></blockquote>
- <blockquote>
- <a href="#">Delphi</a>
+ <blockquote>Aberdeen</blockquote>
+ <blockquote>Ada</blockquote>
+ <blockquote>Adamsville</blockquote>
+ <blockquote>Addyston</blockquote>
+ <blockquote>Delphi
<div>
- <blockquote><a href="#">Ada</a></blockquote>
- <blockquote><a href="#">Saarland</a></blockquote>
- <blockquote><a href="#">Salzburg</a></blockquote>
+ <blockquote>Ada</blockquote>
+ <blockquote>Saarland</blockquote>
+ <blockquote>Salzburg</blockquote>
</div>
</blockquote>
- <blockquote><a href="#">Saarland</a></blockquote>
- <blockquote>
- <a href="#">Salzburg</a>
+ <blockquote>Saarland</blockquote>
+ <blockquote>Salzburg
<div>
- <blockquote>
- <a href="#">Delphi</a>
+ <blockquote>Delphi
<div>
- <blockquote><a href="#">Ada</a></blockquote>
- <blockquote><a id="testID2" href="#">Saarland</a></blockquote>
- <blockquote><a href="#">Salzburg</a></blockquote>
+ <blockquote>Ada</blockquote>
+ <blockquote id="testID2">Saarland</blockquote>
+ <blockquote>Salzburg</blockquote>
</div>
</blockquote>
- <blockquote>
- <a href="#">Delphi</a>
+ <blockquote>Delphi
<div>
- <blockquote><a href="#">Ada</a></blockquote>
- <blockquote><a href="#">Saarland</a></blockquote>
- <blockquote><a href="#">Salzburg</a></blockquote>
+ <blockquote>Ada</blockquote>
+ <blockquote>Saarland</blockquote>
+ <blockquote>Salzburg</blockquote>
</div>
</blockquote>
- <blockquote><a href="#">Perch</a></blockquote>
+ <blockquote>Perch</blockquote>
</div>
</blockquote>
</div>
<ul id="menu6">
- <li class="foo"><a class="foo" href="#">Aberdeen</a></li>
- <li class="foo ui-state-disabled"><a class="foo" href="#">Ada</a></li>
- <li class="foo"><a class="foo" href="#">Adamsville</a></li>
- <li class="foo"><a class="foo" href="#">Addyston</a></li>
- <li class="ui-state-disabled">
- <a id="testID3" href="#">Delphi</a>
+ <li class="foo">Aberdeen</li>
+ <li class="foo ui-state-disabled">Ada</li>
+ <li class="foo">Adamsville</li>
+ <li class="foo">Addyston</li>
+ <li id="testID3" class="ui-state-disabled">Delphi
<ul>
- <li class="foo"><a class="foo" href="#">Ada</a></li>
- <li class="foo"><a class="foo" href="#">Saarland</a></li>
- <li class="foo"><a class="foo" href="#">Salzburg</a></li>
+ <li class="foo">Ada</li>
+ <li class="foo">Saarland</li>
+ <li class="foo">Salzburg</li>
</ul>
</li>
- <li class="foo"><a class="foo" href="#">Saarland</a></li>
+ <li class="foo">Saarland</li>
</ul>
</div>
diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js
index 405300c46..12bd5b703 100644
--- a/tests/unit/menu/menu_events.js
+++ b/tests/unit/menu/menu_events.js
@@ -91,7 +91,7 @@ asyncTest( "handle focus of menu with active item", function() {
expect( 1 );
var element = $( "#menu1" ).menu({
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-state-focus" ).index() );
}
});
@@ -177,7 +177,7 @@ asyncTest( "handle keyboard navigation on menu without scroll and without submen
log( $( ui.item[ 0 ] ).text() );
},
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-state-focus" ).index() );
}
});
@@ -243,7 +243,7 @@ asyncTest( "handle keyboard navigation on menu without scroll and with submenus"
log( $( ui.item[0] ).text() );
},
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-state-focus" ).index() );
}
});
@@ -341,7 +341,7 @@ asyncTest( "handle keyboard navigation on menu without scroll and with submenus"
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
- equal( logOutput(), "keydown,5,6,0,1,0,2,4,0", "Keydown skip dividers and items without anchors" );
+ equal( logOutput(), "keydown,5,6,0,1,0,2,4,0", "Keydown skip dividers" );
log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
@@ -363,7 +363,7 @@ asyncTest( "handle keyboard navigation on menu with scroll and without submenus"
log( $( ui.item[ 0 ] ).text() );
},
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index());
+ log( $( event.target ).find( ".ui-state-focus" ).index());
}
});
@@ -438,7 +438,7 @@ asyncTest( "handle keyboard navigation on menu with scroll and with submenus", f
log( $( ui.item[ 0 ] ).text() );
},
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index());
+ log( $( event.target ).find( ".ui-state-focus" ).index());
}
});
@@ -533,7 +533,7 @@ asyncTest( "handle keyboard navigation and mouse click on menu with disabled ite
log( $( ui.item[0] ).text() );
},
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index());
+ log( $( event.target ).find( ".ui-state-focus" ).index());
}
});
@@ -581,7 +581,7 @@ asyncTest( "handle keyboard navigation with spelling of menu items", function()
expect( 2 );
var element = $( "#menu2" ).menu({
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-state-focus" ).index() );
}
});
diff --git a/tests/unit/menu/menu_methods.js b/tests/unit/menu/menu_methods.js
index 51d772972..5a633998d 100644
--- a/tests/unit/menu/menu_methods.js
+++ b/tests/unit/menu/menu_methods.js
@@ -73,11 +73,11 @@ test( "refresh icons (see #9377)", function() {
expect( 3 );
var element = $( "#menu1" ).menu();
ok( !element.hasClass( "ui-menu-icons") );
- element.find( "li:first a" ).html( "<span class='ui-icon ui-icon-disk'></span>Save</a>" );
+ element.find( "li:first" ).html( "<span class='ui-icon ui-icon-disk'></span>Save</a>" );
element.menu( "refresh" );
ok( element.hasClass( "ui-menu-icons" ) );
- element.find( "li:first a" ).html( "Save" );
+ element.find( "li:first" ).html( "Save" );
element.menu( "refresh" );
ok( !element.hasClass( "ui-menu-icons" ) );
});
diff --git a/tests/unit/menu/menu_options.js b/tests/unit/menu/menu_options.js
index 27cea67a4..527cc4784 100644
--- a/tests/unit/menu/menu_options.js
+++ b/tests/unit/menu/menu_options.js
@@ -66,15 +66,14 @@ test( "{ icons: { submenu: 'custom' } }", function() {
test( "{ role: 'menu' } ", function() {
var element = $( "#menu1" ).menu(),
items = element.find( "li" );
- expect( 2 + 5 * items.length );
+ expect( 2 + 4 * items.length );
equal( element.attr( "role" ), "menu" );
ok( items.length > 0, "number of menu items" );
items.each(function( item ) {
ok( $( this ).hasClass( "ui-menu-item" ), "menu item ("+ item + ") class for item" );
- equal( $( this ).attr( "role" ), "presentation", "menu item ("+ item + ") role" );
- equal( $( "a", this ).attr( "role" ), "menuitem", "menu item ("+ item + ") role" );
- ok( $( "a", this ).hasClass( "ui-corner-all" ), "a element class for menu item ("+ item + ")" );
- equal( $( "a", this ).attr( "tabindex" ), "-1", "a element tabindex for menu item ("+ item + ")" );
+ equal( $( this ).attr( "role" ), "menuitem", "menu item ("+ item + ") role" );
+ ok( $( this ).hasClass( "ui-corner-all" ), "class for menu item ("+ item + ")" );
+ equal( $( this ).attr( "tabindex" ), "-1", "tabindex for menu item ("+ item + ")" );
});
});
@@ -83,15 +82,14 @@ test( "{ role: 'listbox' } ", function() {
role: "listbox"
}),
items = element.find( "li" );
- expect( 2 + 5 * items.length );
+ expect( 2 + 4 * items.length );
equal( element.attr( "role" ), "listbox" );
ok( items.length > 0, "number of menu items" );
items.each(function( item ) {
ok( $( this ).hasClass( "ui-menu-item" ), "menu item ("+ item + ") class for item" );
- equal( $( this ).attr( "role" ), "presentation", "menu item ("+ item + ") role" );
- equal( $( "a", this ).attr( "role" ), "option", "menu item ("+ item + ") role" );
- ok( $( "a", this ).hasClass( "ui-corner-all" ), "a element class for menu item ("+ item + ")" );
- equal( $( "a", this ).attr( "tabindex" ), "-1", "a element tabindex for menu item ("+ item + ")" );
+ equal( $( this ).attr( "role" ), "option", "menu item ("+ item + ") role" );
+ ok( $( this ).hasClass( "ui-corner-all" ), "class for menu item ("+ item + ")" );
+ equal( $( this ).attr( "tabindex" ), "-1", "tabindex for menu item ("+ item + ")" );
});
});
@@ -100,15 +98,14 @@ test( "{ role: null }", function() {
role: null
}),
items = element.find( "li" );
- expect( 2 + 5 * items.length );
+ expect( 2 + 4 * items.length );
strictEqual( element.attr( "role" ), undefined );
ok( items.length > 0, "number of menu items" );
items.each(function( item ) {
ok( $( this ).hasClass( "ui-menu-item" ), "menu item ("+ item + ") class for item" );
- equal( $( this ).attr( "role" ), "presentation", "menu item ("+ item + ") role" );
- equal( $( "a", this ).attr( "role" ), undefined, "menu item ("+ item + ") role" );
- ok( $( "a", this ).hasClass( "ui-corner-all" ), "a element class for menu item ("+ item + ")" );
- equal( $( "a", this ).attr( "tabindex" ), "-1", "a element tabindex for menu item ("+ item + ")" );
+ equal( $( this ).attr( "role" ), undefined, "menu item ("+ item + ") role" );
+ ok( $( this ).hasClass( "ui-corner-all" ), "class for menu item ("+ item + ")" );
+ equal( $( this ).attr( "tabindex" ), "-1", "tabindex for menu item ("+ item + ")" );
});
});
diff --git a/tests/unit/menu/menu_test_helpers.js b/tests/unit/menu/menu_test_helpers.js
index b6c09ad7a..77737c390 100644
--- a/tests/unit/menu/menu_test_helpers.js
+++ b/tests/unit/menu/menu_test_helpers.js
@@ -24,7 +24,7 @@ TestHelpers.menu = {
click: function( menu, item ) {
lastItem = item;
- menu.children( ":eq(" + item + ")" ).find( "a:first" ).trigger( "click" );
+ menu.children( ":eq(" + item + ")" ).trigger( "click" );
}
};