jquery-ui/tests/unit/button/events.js
Michał Gołębiowski-Owczarek 70dae67b73
Build: Migrate from JSHint & JSCS to ESLint
Fixes #15393
Closes gh-1958
2021-06-07 00:58:12 +02:00

26 lines
611 B
JavaScript

define( [
"qunit",
"jquery",
"lib/helper",
"ui/widgets/button"
], function( QUnit, $, helper ) {
"use strict";
QUnit.module( "Button: events", { afterEach: helper.moduleAfterEach } );
QUnit.test( "Anchor recieves click event when spacebar is pressed", function( assert ) {
var ready = assert.async();
assert.expect( 1 );
var element = $( "#anchor-button" ).button();
element.on( "click", function( event ) {
event.preventDefault();
assert.ok( true, "click occcured as a result of spacebar" );
ready();
} );
element.trigger( $.Event( "keyup", { keyCode: $.ui.keyCode.SPACE } ) );
} );
} );