From: Jörn Zaefferer Date: Tue, 6 Oct 2015 12:30:41 +0000 (+0200) Subject: Tests: Prevent default on anchor click to avoid navigation X-Git-Tag: 1.12.0-beta.1~56 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e310d9f16094e5236dbfcfbfa6fc684091dd7668;p=jquery-ui.git Tests: Prevent default on anchor click to avoid navigation --- diff --git a/tests/unit/button/events.js b/tests/unit/button/events.js index 0bec5a7d2..f780fb494 100644 --- a/tests/unit/button/events.js +++ b/tests/unit/button/events.js @@ -9,7 +9,8 @@ asyncTest( "Anchor recieves click event when spacebar is pressed", function() { expect( 1 ); var element = $( "#anchor-button" ).button(); - element.on( "click", function() { + element.on( "click", function( event ) { + event.preventDefault(); ok( true, "click occcured as a result of spacebar" ); start(); } );