2015-04-06 14:13:15 +00:00
|
|
|
define( [
|
|
|
|
"jquery",
|
2015-07-15 01:57:20 +00:00
|
|
|
"ui/widgets/button"
|
2015-04-06 14:13:15 +00:00
|
|
|
], function( $ ) {
|
2010-01-20 14:00:14 +00:00
|
|
|
|
2014-01-22 17:02:32 +00:00
|
|
|
module( "Button: events" );
|
2010-01-20 14:00:14 +00:00
|
|
|
|
2014-01-22 17:02:32 +00:00
|
|
|
asyncTest( "Anchor recieves click event when spacebar is pressed", function() {
|
2012-11-21 13:33:43 +00:00
|
|
|
expect( 1 );
|
2014-01-22 17:02:32 +00:00
|
|
|
var element = $( "#anchor-button" ).button();
|
2012-11-21 13:33:43 +00:00
|
|
|
|
2015-10-06 12:30:41 +00:00
|
|
|
element.on( "click", function( event ) {
|
|
|
|
event.preventDefault();
|
2014-01-22 17:02:32 +00:00
|
|
|
ok( true, "click occcured as a result of spacebar" );
|
|
|
|
start();
|
2015-08-21 04:12:35 +00:00
|
|
|
} );
|
2012-12-10 15:35:01 +00:00
|
|
|
|
2014-01-22 17:02:32 +00:00
|
|
|
element.trigger( $.Event( "keyup", { keyCode: $.ui.keyCode.SPACE } ) );
|
2015-08-21 04:12:35 +00:00
|
|
|
} );
|
2012-11-21 13:33:43 +00:00
|
|
|
|
2015-04-06 14:13:15 +00:00
|
|
|
} );
|