From e310d9f16094e5236dbfcfbfa6fc684091dd7668 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=CC=88rn=20Zaefferer?= Date: Tue, 6 Oct 2015 14:30:41 +0200 Subject: [PATCH] Tests: Prevent default on anchor click to avoid navigation --- tests/unit/button/events.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); } ); -- 2.39.5