diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-09-12 23:54:19 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-09-12 23:54:19 +0200 |
commit | ae0c4e44ff4adee60ad4e9662661ce9564031c16 (patch) | |
tree | 5af1662a221a68c276fe77dc9d14638cc78f935a /tests/unit/menu/menu_events.js | |
parent | bf26bf1ac4b2be791c2f283a60453fc59ee389bb (diff) | |
parent | 94317d7aa4ed439cb825d006fb461145a6d2aa5d (diff) | |
download | jquery-ui-ae0c4e44ff4adee60ad4e9662661ce9564031c16.tar.gz jquery-ui-ae0c4e44ff4adee60ad4e9662661ce9564031c16.zip |
Merge remote branch 'kborchers/menu_autoCollapse'
Diffstat (limited to 'tests/unit/menu/menu_events.js')
-rw-r--r-- | tests/unit/menu/menu_events.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js index 9ea54faf0..563ed7c2d 100644 --- a/tests/unit/menu/menu_events.js +++ b/tests/unit/menu/menu_events.js @@ -41,6 +41,25 @@ test( "handle blur: click", function() { $("#remove").remove(); }); +asyncTest( "handle submenu auto collapse: mouseleave", function() { + expect( 4 ); + var $menu = $( "#menu2" ).menu(); + + $menu.find( "li:nth-child(7)" ).trigger( "mouseover" ); + setTimeout(function() { + equal( $menu.find( "ul[aria-expanded='true']" ).length, 1, "first submenu expanded" ); + $menu.find( "li:nth-child(7) li:first" ).trigger( "mouseover" ); + 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); +}); + test("handle keyboard navigation on menu without scroll and without submenus", function() { expect(12); var element = $('#menu1').menu({ |