jquery-ui/tests/unit/button/methods.js
Alexander Schmitz 02033262ee Button: Initial commit of button re-factor
Move to using element stats rather then js class states remove
ui-button-text spans.
Removed button set
2015-10-07 10:57:59 -04:00

35 lines
999 B
JavaScript

define( [
"jquery",
"ui/widgets/button"
], function( $ ) {
module( "Button: methods" );
test( "destroy", function( assert ) {
expect( 1 );
assert.domEqual( "#button", function() {
$( "#button" ).button().button( "destroy" );
} );
} );
test( "refresh: Ensure disabled state is preserved correctly.", function() {
expect( 3 );
var element = $( "<a href='#'></a>" );
element.button( { disabled: true } ).button( "refresh" );
ok( element.button( "option", "disabled" ),
"Anchor button should remain disabled after refresh" );
element = $( "<button></button>" );
element.button( { disabled: true } ).button( "refresh" );
ok( element.button( "option", "disabled" ), "<button> should remain disabled after refresh" );
element = $( "<button></button>" );
element.button( { disabled: true } ).prop( "disabled", false ).button( "refresh" );
ok( !element.button( "option", "disabled" ),
"Changing a <button>'s disabled property should update the state after refresh." );
} );
} );