jquery-ui/tests/unit/button/core.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

29 lines
679 B
JavaScript

define( [
"qunit",
"jquery",
"lib/helper",
"ui/safe-active-element",
"ui/widgets/button"
], function( QUnit, $, helper ) {
"use strict";
QUnit.module( "Button: core", { afterEach: helper.moduleAfterEach } );
QUnit.test( "Disabled button loses focus", function( assert ) {
var ready = assert.async();
assert.expect( 2 );
var element = $( "#button" ).button();
element.trigger( "focus" );
setTimeout( function() {
assert.equal( element[ 0 ], $.ui.safeActiveElement( document ), "Button is focused" );
element.button( "disable" );
assert.notEqual( element[ 0 ], $.ui.safeActiveElement( document ), "Button has had focus removed" );
ready();
} );
} );
} );