aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2015-01-19 17:00:57 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2015-01-21 18:07:43 +0100
commit0bbd1569182bc03e8dc4f5f8aa203e8edbe15f99 (patch)
tree1328997e98da34765e5c468989edf467601e511c /tests
parent7137c90b1883bc19f23678582170e9df981a084d (diff)
downloadjquery-ui-0bbd1569182bc03e8dc4f5f8aa203e8edbe15f99.tar.gz
jquery-ui-0bbd1569182bc03e8dc4f5f8aa203e8edbe15f99.zip
Menu: Use ui-state-active consistently
So far we were using ui-state-active on active parent items, ui-state-focus on active child items. The theme update highlighted the visual inconsistency. With this change, only ui-state-active is used. Fixes #10692
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/autocomplete/autocomplete_core.js2
-rw-r--r--tests/unit/autocomplete/autocomplete_options.js2
-rw-r--r--tests/unit/menu/menu_events.js18
-rw-r--r--tests/unit/selectmenu/selectmenu_core.js2
4 files changed, 12 insertions, 12 deletions
diff --git a/tests/unit/autocomplete/autocomplete_core.js b/tests/unit/autocomplete/autocomplete_core.js
index fa3f9abb0..1208d89f1 100644
--- a/tests/unit/autocomplete/autocomplete_core.js
+++ b/tests/unit/autocomplete/autocomplete_core.js
@@ -16,7 +16,7 @@ test( "prevent form submit on enter when menu is active", function() {
event = $.Event( "keydown" );
event.keyCode = $.ui.keyCode.DOWN;
element.trigger( event );
- equal( menu.find( ".ui-menu-item-wrapper.ui-state-focus" ).length, 1,
+ equal( menu.find( ".ui-menu-item-wrapper.ui-state-active" ).length, 1,
"menu item is active" );
event = $.Event( "keydown" );
diff --git a/tests/unit/autocomplete/autocomplete_options.js b/tests/unit/autocomplete/autocomplete_options.js
index 226db29ed..8215dbe61 100644
--- a/tests/unit/autocomplete/autocomplete_options.js
+++ b/tests/unit/autocomplete/autocomplete_options.js
@@ -77,7 +77,7 @@ function autoFocusTest( afValue, focusedLength ) {
open: function() {
equal(
element.autocomplete( "widget" )
- .find( ".ui-menu-item-wrapper.ui-state-focus" )
+ .find( ".ui-menu-item-wrapper.ui-state-active" )
.length,
focusedLength,
"first item is " + (afValue ? "" : "not") + " auto focused" );
diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js
index f4d494f47..8156abbcd 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-menu-item-wrapper.ui-state-active" ).parent().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-menu-item-wrapper.ui-state-active" ).parent().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-menu-item-wrapper.ui-state-active:last" ).parent().index() );
}
});
@@ -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-menu-item-wrapper.ui-state-active:last" ).parent().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-menu-item-wrapper.ui-state-active:last" ).parent().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-menu-item-wrapper.ui-state-active" ).parent().index());
}
});
@@ -585,7 +585,7 @@ asyncTest( "handle keyboard navigation and mouse click on menu with dividers and
log( $( ui.item[0] ).text() );
},
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active" ).parent().index() );
}
});
@@ -612,7 +612,7 @@ asyncTest( "handle keyboard navigation with spelling of menu items", function()
expect( 3 );
var element = $( "#menu2" ).menu({
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active" ).parent().index() );
}
});
@@ -635,7 +635,7 @@ asyncTest( "Keep focus on selected item (see #10644)", function() {
expect( 1 );
var element = $( "#menu2" ).menu({
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active" ).parent().index() );
}
});
diff --git a/tests/unit/selectmenu/selectmenu_core.js b/tests/unit/selectmenu/selectmenu_core.js
index b4efb80f2..3b5472996 100644
--- a/tests/unit/selectmenu/selectmenu_core.js
+++ b/tests/unit/selectmenu/selectmenu_core.js
@@ -273,7 +273,7 @@ $.each([
});
function checkItemClasses() {
- focusedItem = menu.find( "li .ui-state-focus" );
+ focusedItem = menu.find( ".ui-menu-item-wrapper.ui-state-active" );
equal( focusedItem.length, 1, "only one item has ui-state-focus class" );
equal( focusedItem.attr( "id" ), wrappers.eq( element[ 0 ].selectedIndex ).attr( "id" ),
"selected item has ui-state-focus class" );