aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/sortable
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2013-03-14 19:08:21 -0400
committerScott González <scott.gonzalez@gmail.com>2013-03-14 19:08:21 -0400
commit44d07173db32b498e5f83f60db290ff1463daee3 (patch)
tree59537f38aae5d3aed4a1a491d0ebfb3635ba8768 /tests/unit/sortable
parentdb27541b3ccc8af8c558915d99bcf544d4afacc7 (diff)
downloadjquery-ui-44d07173db32b498e5f83f60db290ff1463daee3.tar.gz
jquery-ui-44d07173db32b498e5f83f60db290ff1463daee3.zip
Widget: Stop setting ui-state-disabled and aria by default on setting disabled option.
Fixes #5973 - Resizable: disabled should not have the ui-state-disabled class or aria attribute aria-disabled Fixes #5974 - Draggable: disabled should not have the ui-state-disabled class or aria attribute aria-disabled Fixes #6039 - Droppable: disabled should not have ui-state-disabled This reverts commit 23771d38ba9d2663f6db0243c8e992dc7ff6844a.
Diffstat (limited to 'tests/unit/sortable')
-rw-r--r--tests/unit/sortable/sortable_methods.js35
1 files changed, 18 insertions, 17 deletions
diff --git a/tests/unit/sortable/sortable_methods.js b/tests/unit/sortable/sortable_methods.js
index 07a7bc77d..f3fe240e7 100644
--- a/tests/unit/sortable/sortable_methods.js
+++ b/tests/unit/sortable/sortable_methods.js
@@ -64,29 +64,30 @@ test("enable", function() {
equal(actual, expected, "enable is chainable");
});
-test("disable", function() {
- expect(7);
+test( "disable", function() {
+ expect( 9 );
- var el, actual, expected;
+ var chainable,
+ element = $( "#sortable" ).sortable({ disabled: false });
- el = $("#sortable").sortable({ disabled: false });
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable({ disabled: false })");
+ TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" );
- el.sortable("disable");
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, "disabled.sortable getter");
+ chainable = element.sortable( "disable" );
+ TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 0, "disabled.sortable getter" );
- el.sortable("destroy");
+ element.sortable( "destroy" );
- el.sortable({ disabled: false });
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable({ disabled: false })");
- el.sortable("option", "disabled", true);
- equal(el.sortable("option", "disabled"), true, "disabled option setter");
- ok(el.sortable("widget").is(":not(.ui-state-disabled)"), "sortable element does not get ui-state-disabled since it's an interaction");
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, ".sortable('option', 'disabled', true)");
+ element.sortable({ disabled: false });
+ TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" );
+ element.sortable( "option", "disabled", true);
+ equal( element.sortable( "option", "disabled" ), true, "disabled option setter" );
- expected = $("<div></div>").sortable(),
- actual = expected.sortable("disable");
- equal(actual, expected, "disable is chainable");
+ ok( !element.sortable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" );
+ ok( !element.sortable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
+ ok( element.sortable( "widget" ).hasClass( "ui-sortable-disabled" ), "element gets ui-sortable-disabled" );
+
+ TestHelpers.sortable.sort($( "li", element )[ 0 ], 0, 44, 0, ".sortable('option', 'disabled', true)" );
+ equal( chainable, element, "disable is chainable" );
});
})(jQuery);