aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/menu
diff options
context:
space:
mode:
authorKris Borchers <kris.borchers@gmail.com>2013-07-14 21:52:35 -0500
committerKris Borchers <kris.borchers@gmail.com>2013-07-14 21:52:35 -0500
commita74ac174cca67c57ddd79a3c4f2f34d291edf2dd (patch)
treef818cabd7f420ba48ed2caf12886e5a27f872bbf /tests/unit/menu
parent2f497023261a7400295f4dd64c45139232a0ea4f (diff)
downloadjquery-ui-a74ac174cca67c57ddd79a3c4f2f34d291edf2dd.tar.gz
jquery-ui-a74ac174cca67c57ddd79a3c4f2f34d291edf2dd.zip
Menu tests: Check default is prevented on any click on disabled menus
Diffstat (limited to 'tests/unit/menu')
-rw-r--r--tests/unit/menu/menu_events.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js
index 3c94a5a6c..093c9fe07 100644
--- a/tests/unit/menu/menu_events.js
+++ b/tests/unit/menu/menu_events.js
@@ -598,4 +598,25 @@ asyncTest( "handle keyboard navigation with spelling of menu items", function()
element[0].focus();
});
+test( "ensure default is prevented when clicking on anchors in disabled menus ", function() {
+ expect( 1 );
+ var element = $( "#menu1" ).menu();
+ element.bind("click.menu", function(event) {
+ if ( !event.isDefaultPrevented() ) {
+ log();
+ }
+ });
+ log( "click", true );
+ click( $( "#menu1" ), "1" );
+ log( "afterclick,disable" );
+ element.menu("option", "disabled", true);
+ click( element, "2" );
+ click( $( "#menu1" ), "3" );
+ click( element, "1" );
+ log( "enable" );
+ element.menu("option", "disabled", false);
+ click( element, "3" );
+ equal( logOutput(), "click,1,afterclick,disable,enable,3", "Click order not valid." );
+});
+
})( jQuery );