diff options
author | Richard Worth <rdworth@gmail.com> | 2009-09-19 15:19:42 +0000 |
---|---|---|
committer | Richard Worth <rdworth@gmail.com> | 2009-09-19 15:19:42 +0000 |
commit | f164edbdd97fb0c4e1dd1012d79225b8a66205e5 (patch) | |
tree | 584bbf12f81b28e30910cf19149ca49b5425c83a /tests/unit/slider | |
parent | 122a6cdd5fbc1b3e1769bb4669dc68e7d8279177 (diff) | |
download | jquery-ui-f164edbdd97fb0c4e1dd1012d79225b8a66205e5.tar.gz jquery-ui-f164edbdd97fb0c4e1dd1012d79225b8a66205e5.zip |
slider: fixed disabled on init, methods enable and disable
Diffstat (limited to 'tests/unit/slider')
-rw-r--r-- | tests/unit/slider/slider_methods.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/unit/slider/slider_methods.js b/tests/unit/slider/slider_methods.js index 711c16f2c..37977efb9 100644 --- a/tests/unit/slider/slider_methods.js +++ b/tests/unit/slider/slider_methods.js @@ -69,14 +69,26 @@ test("enable", function() { var expected = $('<div></div>').slider(), actual = expected.slider('enable'); equals(actual, expected, 'enable is chainable'); - ok(false, "missing test - untested code is broken code."); + + var el = $('<div></div>').slider({ disabled: true }); + ok(el.hasClass('.ui-disabled'), 'slider has ui-disabled class before enable method call'); + ok(el.hasClass('.ui-slider-disabled'), 'slider has ui-slider-disabled class before enable method call'); + el.slider('enable'); + ok(!el.hasClass('.ui-disabled'), 'slider does not have ui-disabled class after enable method call'); + ok(!el.hasClass('.ui-slider-disabled'), 'slider does not have ui-slider-disabled class after enable method call'); }); test("disable", function() { var expected = $('<div></div>').slider(), actual = expected.slider('disable'); equals(actual, expected, 'disable is chainable'); - ok(false, "missing test - untested code is broken code."); + + var el = $('<div></div>').slider({ disabled: false }); + ok(!el.hasClass('.ui-disabled'), 'slider does not have ui-disabled class before disabled method call'); + ok(!el.hasClass('.ui-slider-disabled'), 'slider does not have ui-slider-disabled class before disable method call'); + el.slider('disable'); + ok(el.hasClass('.ui-disabled'), 'slider has ui-disabled class after disable method call'); + ok(el.hasClass('.ui-slider-disabled'), 'slider has ui-slider-disabled class after disable method call'); }); test("value", function() { |