aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorkborchers <k_borchers@yahoo.com>2011-07-19 16:15:59 -0500
committerCorey Frang <gnarf@gnarf.net>2011-07-19 16:15:59 -0500
commit8224c675e19bf5cb9ed0b00159dc572715ad7727 (patch)
treec1041c76e95dadba96098ee936ed1c7f1e17a036 /tests
parentc8a11ce4f0e5459a331fc2ac9f3e217a91452a22 (diff)
downloadjquery-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.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);