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

25 lines
509 B
JavaScript
Raw Normal View History

define( [
"jquery",
"ui/safe-active-element",
"ui/widgets/button"
], function( $ ) {
2010-01-20 14:00:14 +00:00
module( "Button: core" );
2010-01-20 14:00:14 +00:00
asyncTest( "Disabled button loses focus", function() {
expect( 2 );
var element = $( "#button" ).button();
element.focus();
setTimeout( function() {
equal( element[ 0 ], $.ui.safeActiveElement( document ), "Button is focused" );
element.button( "disable" );
notEqual( element[ 0 ], $.ui.safeActiveElement( document ), "Button has had focus removed" );
start();
} );
} );
} );