diff options
author | Scott González <scott.gonzalez@gmail.com> | 2013-06-03 15:14:08 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2013-06-03 15:14:46 -0400 |
commit | 2ba75e2c93638d89e89de52347da0013a7a841b8 (patch) | |
tree | 01fd7789c9b1ba6371ecf9bd77a597b04213e6c8 /tests | |
parent | 3ec371bca47f614249b90e0b7dfd7bf7389588af (diff) | |
download | jquery-ui-2ba75e2c93638d89e89de52347da0013a7a841b8.tar.gz jquery-ui-2ba75e2c93638d89e89de52347da0013a7a841b8.zip |
Slider: Remove range div when changing range option to false. Fixes #9355 - Slider: Changing range option to false does not remove range div.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/slider/slider_options.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/unit/slider/slider_options.js b/tests/unit/slider/slider_options.js index 3a6f55390..b89981115 100644 --- a/tests/unit/slider/slider_options.js +++ b/tests/unit/slider/slider_options.js @@ -200,7 +200,7 @@ test( "values", function() { }); test( "range", function() { - expect( 27 ); + expect( 33 ); var range; // min @@ -300,6 +300,21 @@ test( "range", function() { equal( element.slider( "option", "values" ), null, "values" ); deepEqual( element.slider( "values" ), [] , "values" ); element.slider( "destroy" ); + + // Change range from true to false + element = $( "<div></div>" ).slider({ + range: true, + min: 1, + max: 10, + step: 1 + }).slider( "option", "range", false ); + equal( element.find( ".ui-slider-handle" ).length, 2, "range switch from true to false, both handles remain" ); + equal( element.find( ".ui-slider-range" ).length, 0, "range switch from true to false" ); + equal( element.slider( "option", "value" ), 0 , "option value" ); + equal( element.slider( "value" ), 1 , "value" ); + deepEqual( element.slider( "option", "values" ), [1, 1], "option values" ); + deepEqual( element.slider( "values" ), [1, 1], "values" ); + element.slider( "destroy" ); }); })( jQuery ); |