aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/selectable
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/selectable
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/selectable')
-rw-r--r--tests/unit/selectable/selectable_methods.js36
1 files changed, 21 insertions, 15 deletions
diff --git a/tests/unit/selectable/selectable_methods.js b/tests/unit/selectable/selectable_methods.js
index 72f9bb28d..179d4ecd6 100644
--- a/tests/unit/selectable/selectable_methods.js
+++ b/tests/unit/selectable/selectable_methods.js
@@ -71,34 +71,40 @@ test("enable", function() {
equal(actual, expected, "enable is chainable");
});
-test("disable", function() {
- expect(3);
- var expected, actual,
+test( "disable", function() {
+ expect( 6 );
+ var chainable,
fired = false,
- el = $("#selectable1");
+ element = $( "#selectable1" );
- el.selectable({
+ element.selectable({
disabled: false,
- start: function() { fired = true; }
+ start: function() {
+ fired = true;
+ }
});
- el.simulate( "drag", {
+ element.simulate( "drag", {
dx: 20,
dy: 20
});
- equal(fired, true, "start fired");
- el.selectable("disable");
+ equal( fired, true, "start fired" );
+
+ chainable = element.selectable( "disable" );
fired = false;
- el.simulate( "drag", {
+ element.simulate( "drag", {
dx: 20,
dy: 20
});
- equal(fired, false, "start fired");
- el.selectable("destroy");
+ equal( fired, false, "start fired" );
- expected = $("<div></div>").selectable();
- actual = expected.selectable("disable");
- equal(actual, expected, "disable is chainable");
+ ok( !element.selectable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" );
+ ok( !element.selectable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
+ ok( element.selectable( "widget" ).hasClass( "ui-selectable-disabled" ), "element gets ui-selectable-disabled" );
+
+ element.selectable( "destroy" );
+
+ equal( chainable, element, "disable is chainable" );
});
})(jQuery);