jquery-ui/tests/unit/button/events.js

22 lines
459 B
JavaScript
Raw Normal View History

define( [
"jquery",
"ui/widgets/button"
], function( $ ) {
2010-01-20 14:00:14 +00:00
module( "Button: events" );
2010-01-20 14:00:14 +00:00
asyncTest( "Anchor recieves click event when spacebar is pressed", function() {
expect( 1 );
var element = $( "#anchor-button" ).button();
element.on( "click", function( event ) {
event.preventDefault();
ok( true, "click occcured as a result of spacebar" );
start();
} );
element.trigger( $.Event( "keyup", { keyCode: $.ui.keyCode.SPACE } ) );
} );
} );