diff options
author | kborchers <k_borchers@yahoo.com> | 2011-07-19 16:15:59 -0500 |
---|---|---|
committer | Corey Frang <gnarf@gnarf.net> | 2011-07-19 16:15:59 -0500 |
commit | 8224c675e19bf5cb9ed0b00159dc572715ad7727 (patch) | |
tree | c1041c76e95dadba96098ee936ed1c7f1e17a036 /tests | |
parent | c8a11ce4f0e5459a331fc2ac9f3e217a91452a22 (diff) | |
download | jquery-ui-8224c675e19bf5cb9ed0b00159dc572715ad7727.tar.gz jquery-ui-8224c675e19bf5cb9ed0b00159dc572715ad7727.zip |
Menu: Passed the original event that causes a blur through collapseAll to blur, then trigger a blur on the menu. Fixes failing unit test provided by @rwaldron which has been included in this commit
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/menu/menu_events.js | 21 |
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); |