aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/menu/menu_events.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/menu/menu_events.js')
-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 a03bec3f6..2f713acf8 100644
--- a/tests/unit/menu/menu_events.js
+++ b/tests/unit/menu/menu_events.js
@@ -21,4 +21,25 @@ test("handle click on menu", function() {
equals( $("#log").html(), "1,3,2,afterclick,1,click,", "Click order not valid.");
});
+test( "handle blur: click", function() {
+ expect( 4 );
+ var $menu = $( "#menu1" ).menu({
+ focus: function( event, ui ) {
+ equal( event.originalEvent.type, "click", "focus triggered 'click'" );
+ equal( event.type, "menufocus", "focus event.type is 'menufocus'" );
+
+ },
+ blur: function( event, ui ) {
+ console.log( event, ui );
+ equal( event.originalEvent.type, "click", "blur triggered 'click'" );
+ equal( event.type, "menublur", "blur event.type is 'menublur'" );
+ }
+ });
+
+ $menu.find( "li a:first" ).trigger( "click" );
+ $( "<a/>", { id: "remove"} ).appendTo("body").trigger( "click" );
+
+ $("#remove").remove();
+});
+
})(jQuery);