diff options
author | kborchers <kris.borchers@gmail.com> | 2011-12-20 11:49:48 -0600 |
---|---|---|
committer | kborchers <kris.borchers@gmail.com> | 2011-12-20 11:49:48 -0600 |
commit | c88add2269c195513b1127d4e6842373fb9f6e60 (patch) | |
tree | c6cfef8f914ed2b7626b527f2e3ce3e0d6b946a8 /tests/unit/menu/menu_events.js | |
parent | 76c7bf6c3ffbe4952b4cfd50443ff13745202605 (diff) | |
download | jquery-ui-c88add2269c195513b1127d4e6842373fb9f6e60.tar.gz jquery-ui-c88add2269c195513b1127d4e6842373fb9f6e60.zip |
Menu: Fix close delay and increase the default delay
Diffstat (limited to 'tests/unit/menu/menu_events.js')
-rw-r--r-- | tests/unit/menu/menu_events.js | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js index 79b98163b..9e68e0c67 100644 --- a/tests/unit/menu/menu_events.js +++ b/tests/unit/menu/menu_events.js @@ -93,12 +93,16 @@ asyncTest( "handle submenu auto collapse: mouseleave", function() { setTimeout(function() { equal( $menu.find( "ul[aria-expanded='true']" ).length, 2, "second submenu expanded" ); $menu.find( "ul[aria-expanded='true']:first" ).trigger( "mouseleave" ); - equal( $menu.find( "ul[aria-expanded='true']" ).length, 1, "second submenu collapsed" ); - $menu.trigger( "mouseleave" ); - equal( $menu.find( "ul[aria-expanded='true']" ).length, 0, "first submenu collapsed" ); - start(); - }, 400); - }, 200); + setTimeout(function() { + equal( $menu.find( "ul[aria-expanded='true']" ).length, 1, "second submenu collapsed" ); + $menu.trigger( "mouseleave" ); + setTimeout(function() { + equal( $menu.find( "ul[aria-expanded='true']" ).length, 0, "first submenu collapsed" ); + start(); + }, 1400); + }, 1050); + }, 700); + }, 350); }); asyncTest( "handle custom menu item submenu auto collapse: mouseleave", function() { @@ -112,17 +116,19 @@ asyncTest( "handle custom menu item submenu auto collapse: mouseleave", function setTimeout(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(); - }, 400); - }, 200); + setTimeout(function() { + 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" ); + setTimeout(function() { + equal( $menu.find( "div[aria-expanded='true']" ).length, 0, "first submenu collapsed" ); + start(); + }, 1400); + }, 1050); + }, 700); + }, 350); }); |