aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/menu/menu_options.js
diff options
context:
space:
mode:
authorTJ VanToll <tj.vantoll@gmail.com>2014-10-25 09:18:17 -0700
committerTJ VanToll <tj.vantoll@gmail.com>2014-10-25 10:10:30 -0700
commitde2ef2a585447cf75fc8d4a734c12aa2bbd028c2 (patch)
tree38f5491fedb4668ff8a55ea38934bf7f5561d777 /tests/unit/menu/menu_options.js
parent3002d460de2b854243d99634e69d394dfca78886 (diff)
downloadjquery-ui-de2ef2a585447cf75fc8d4a734c12aa2bbd028c2.tar.gz
jquery-ui-de2ef2a585447cf75fc8d4a734c12aa2bbd028c2.zip
Menu: Wrap menu items in a <div>
This avoids styling issues where ui-state-focus rules apply to submenus. Fixes #10162 Closes gh-1342
Diffstat (limited to 'tests/unit/menu/menu_options.js')
-rw-r--r--tests/unit/menu/menu_options.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/unit/menu/menu_options.js b/tests/unit/menu/menu_options.js
index c76673345..438b02a32 100644
--- a/tests/unit/menu/menu_options.js
+++ b/tests/unit/menu/menu_options.js
@@ -71,8 +71,10 @@ test( "{ role: 'menu' } ", function() {
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" ), "menuitem", "menu item ("+ item + ") role" );
- equal( $( this ).attr( "tabindex" ), "-1", "tabindex for menu item ("+ item + ")" );
+ equal( $( this ).find( ".ui-menu-item-wrapper" ).attr( "role" ),
+ "menuitem", "menu item ("+ item + ") role" );
+ equal( $( this ).find( ".ui-menu-item-wrapper" ).attr( "tabindex" ), "-1",
+ "tabindex for menu item ("+ item + ")" );
});
});
@@ -86,8 +88,10 @@ test( "{ role: 'listbox' } ", function() {
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" ), "option", "menu item ("+ item + ") role" );
- equal( $( this ).attr( "tabindex" ), "-1", "tabindex for menu item ("+ item + ")" );
+ equal( $( this ).find( ".ui-menu-item-wrapper" ).attr( "role" ), "option",
+ "menu item ("+ item + ") role" );
+ equal( $( this ).find( ".ui-menu-item-wrapper" ).attr( "tabindex" ), "-1",
+ "tabindex for menu item ("+ item + ")" );
});
});
@@ -101,8 +105,10 @@ test( "{ role: null }", function() {
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" ), undefined, "menu item ("+ item + ") role" );
- equal( $( this ).attr( "tabindex" ), "-1", "tabindex for menu item ("+ item + ")" );
+ equal( $( this ).find( ".ui-menu-item-wrapper" ).attr( "role" ), undefined,
+ "menu item ("+ item + ") role" );
+ equal( $( this ).find( ".ui-menu-item-wrapper" ).attr( "tabindex" ), "-1",
+ "tabindex for menu item ("+ item + ")" );
});
});