aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/menu
diff options
context:
space:
mode:
authorkborchers <k_borchers@yahoo.com>2011-09-12 08:43:49 -0500
committerkborchers <k_borchers@yahoo.com>2011-09-12 08:43:49 -0500
commit94317d7aa4ed439cb825d006fb461145a6d2aa5d (patch)
treebd9a5293b9b4e92ef0739e4789b32e8417e370bf /tests/unit/menu
parent38028f6de1ae1bb34a30d04cacab5d49a1433e7a (diff)
downloadjquery-ui-94317d7aa4ed439cb825d006fb461145a6d2aa5d.tar.gz
jquery-ui-94317d7aa4ed439cb825d006fb461145a6d2aa5d.zip
Menu: Added autoCollapse as the default and added a unit test
Diffstat (limited to 'tests/unit/menu')
-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 19ac11c68..ab691b782 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({