diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2013-03-11 21:28:51 -0400 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2013-03-11 22:08:21 -0400 |
commit | 4d67f4f34908a50ef88f95df4103ee001b777e45 (patch) | |
tree | e14cd5bcc22a960ab65db9bd6567f9b8638ce272 /tests/unit/selectable | |
parent | 4f95a0f396965e91982f1b5e67da814bb6640ce1 (diff) | |
download | jquery-ui-4d67f4f34908a50ef88f95df4103ee001b777e45.tar.gz jquery-ui-4d67f4f34908a50ef88f95df4103ee001b777e45.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
Diffstat (limited to 'tests/unit/selectable')
-rw-r--r-- | tests/unit/selectable/selectable_methods.js | 36 |
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); |