2015-04-06 18:33:25 +00:00
|
|
|
define( [
|
2016-04-06 13:11:09 +00:00
|
|
|
"qunit",
|
2015-04-06 18:33:25 +00:00
|
|
|
"jquery",
|
2020-05-16 07:16:24 +00:00
|
|
|
"lib/helper",
|
2015-07-15 02:05:00 +00:00
|
|
|
"ui/widgets/resizable"
|
2020-05-16 07:16:24 +00:00
|
|
|
], function( QUnit, $, helper ) {
|
2021-06-06 22:58:12 +00:00
|
|
|
"use strict";
|
2009-02-02 14:36:08 +00:00
|
|
|
|
2020-05-16 07:16:24 +00:00
|
|
|
QUnit.module( "resizable: methods", { afterEach: helper.moduleAfterEach } );
|
2009-02-02 14:36:08 +00:00
|
|
|
|
2016-04-06 13:11:09 +00:00
|
|
|
QUnit.test( "disable", function( assert ) {
|
|
|
|
assert.expect( 5 );
|
2013-03-14 23:08:21 +00:00
|
|
|
|
2015-08-24 12:58:35 +00:00
|
|
|
var element = $( "#resizable1" ).resizable( { disabled: false } ),
|
2013-03-14 23:08:21 +00:00
|
|
|
chainable = element.resizable( "disable" );
|
|
|
|
|
2015-01-30 14:59:26 +00:00
|
|
|
assert.lacksClasses( element.resizable( "widget" ), "ui-state-disabled" );
|
2016-04-06 13:11:09 +00:00
|
|
|
assert.ok( !element.resizable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
|
2015-01-30 14:59:26 +00:00
|
|
|
assert.hasClasses( element.resizable( "widget" ), "ui-resizable-disabled" );
|
2016-04-06 13:11:09 +00:00
|
|
|
assert.equal( element.resizable( "option", "disabled" ), true, "disabled option setter" );
|
|
|
|
assert.equal( chainable, element, "disable is chainable" );
|
2015-08-24 12:58:35 +00:00
|
|
|
} );
|
2009-02-02 14:36:08 +00:00
|
|
|
|
2015-04-06 18:33:25 +00:00
|
|
|
} );
|