]> source.dussan.org Git - jquery-ui.git/commitdiff
Tests: Prevent default on anchor click to avoid navigation
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 6 Oct 2015 12:30:41 +0000 (14:30 +0200)
committerAlexander Schmitz <arschmitz@gmail.com>
Thu, 8 Oct 2015 18:02:59 +0000 (14:02 -0400)
tests/unit/button/events.js

index 0bec5a7d2a87225bd0ef3e9fde428837098e9d90..f780fb494e36f6daab111791537c3bf173cb2afc 100644 (file)
@@ -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();
        } );