aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/menu/menu_events.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2011-09-12 23:54:19 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2011-09-12 23:54:19 +0200
commitae0c4e44ff4adee60ad4e9662661ce9564031c16 (patch)
tree5af1662a221a68c276fe77dc9d14638cc78f935a /tests/unit/menu/menu_events.js
parentbf26bf1ac4b2be791c2f283a60453fc59ee389bb (diff)
parent94317d7aa4ed439cb825d006fb461145a6d2aa5d (diff)
downloadjquery-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.js19
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({