From a1905e2c5ed6e61e6a7206e005de9dda4f7135d0 Mon Sep 17 00:00:00 2001 From: Mukul Hase Date: Fri, 12 Feb 2016 00:59:54 +0530 Subject: Slider: Fixed max value miscalculation Fixes #12852 Closes gh-1664 --- tests/unit/slider/options.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'tests/unit') diff --git a/tests/unit/slider/options.js b/tests/unit/slider/options.js index 031031cdc..5f3ea1111 100644 --- a/tests/unit/slider/options.js +++ b/tests/unit/slider/options.js @@ -43,7 +43,7 @@ test( "disabled", function( assert ) { } ); test( "max", function() { - expect( 5 ); + expect( 7 ); element = $( "
" ); options = { @@ -87,6 +87,23 @@ test( "max", function() { ok( element.slider( "value" ) === options.max, "value method will max, step is changed and step is float" ); element.slider( "destroy" ); + options = { + max: 10.75, + min: 1.22, + orientation: "horizontal", + step: 0.01, + value: 10.75 + }; + + element.slider( options ); + ok( element.slider( "value" ) === options.max, "value method will max, step is changed, step is float and max is float" ); + element.slider( "destroy" ); + + options.max = 10.749999999; + + element.slider( options ); + ok( element.slider( "value" ) === 10.74, "value method will max, step is changed, step is float, max is float and not divisible" ); + element.slider( "destroy" ); } ); test( "min", function() { -- cgit v1.2.3