aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/menu/menu_events.js
diff options
context:
space:
mode:
authorCorey Frang <gnarf@gnarf.net>2011-09-22 13:56:53 -0500
committerCorey Frang <gnarf@gnarf.net>2011-09-22 15:30:46 -0500
commit34a0479d1cbb0acf5d86818506deec78bfbb373b (patch)
tree41ea75be84a6da78a55335f585210ad554cc5b0b /tests/unit/menu/menu_events.js
parentcb372b7c2022f0827a5aeab117f0a21ff7cb8193 (diff)
downloadjquery-ui-34a0479d1cbb0acf5d86818506deec78bfbb373b.tar.gz
jquery-ui-34a0479d1cbb0acf5d86818506deec78bfbb373b.zip
Menu: Refactoring the collapseAll to deal with some issues selecting - Updating unit tests. Thanks @kborchers
Diffstat (limited to 'tests/unit/menu/menu_events.js')
-rw-r--r--tests/unit/menu/menu_events.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js
index 6d1b02b87..55ec1e2ff 100644
--- a/tests/unit/menu/menu_events.js
+++ b/tests/unit/menu/menu_events.js
@@ -99,7 +99,7 @@ asyncTest( "handle submenu auto collapse: mouseleave", function() {
});
asyncTest( "handle custom menu item submenu auto collapse: mouseleave", function() {
- expect( 4 );
+ expect( 5 );
var $menu = $( "#menu5" ).menu( { items: "div" } );
$menu.children( ":nth-child(7)" ).trigger( "mouseover" );
@@ -110,6 +110,11 @@ asyncTest( "handle custom menu item submenu auto collapse: mouseleave", function
equal( $menu.find( "div[aria-expanded='true']" ).length, 2, "second submenu expanded" );
$menu.find( "div[aria-expanded='true']:first" ).trigger( "mouseleave" );
equal( $menu.find( "div[aria-expanded='true']" ).length, 1, "second submenu collapsed" );
+
+ $menu.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN });
+ ok( $menu.find( ".ui-state-active" ).is( "#menu5 :nth-child(7) a" ),
+ "down keypress selected an item from the first submenu" );
+
$menu.trigger( "mouseleave" );
equal( $menu.find( "div[aria-expanded='true']" ).length, 0, "first submenu collapsed" );
start();
@@ -117,6 +122,7 @@ asyncTest( "handle custom menu item submenu auto collapse: mouseleave", function
}, 200);
});
+
test("handle keyboard navigation on menu without scroll and without submenus", function() {
expect(12);
var element = $('#menu1').menu({