aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorMukul Hase <mukulhase@gmail.com>2016-02-12 00:59:54 +0530
committerScott González <scott.gonzalez@gmail.com>2016-06-09 17:44:32 -0400
commit622959b0116d7af0a0b642c4940cd8c0bdd88094 (patch)
tree8d29d66f8e50265111f6892dcc031ad88309edc1 /tests/unit
parenteb6d623589b50e9a1a39492d41914de01945be0c (diff)
downloadjquery-ui-622959b0116d7af0a0b642c4940cd8c0bdd88094.tar.gz
jquery-ui-622959b0116d7af0a0b642c4940cd8c0bdd88094.zip
Slider: Fixed max value miscalculation
Fixes #12852 Closes gh-1664 (cherry picked from commit a1905e2c5ed6e61e6a7206e005de9dda4f7135d0)
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/slider/slider_options.js25
1 files changed, 21 insertions, 4 deletions
diff --git a/tests/unit/slider/slider_options.js b/tests/unit/slider/slider_options.js
index 2badcc566..7f6591684 100644
--- a/tests/unit/slider/slider_options.js
+++ b/tests/unit/slider/slider_options.js
@@ -40,7 +40,7 @@ test( "disabled", function(){
});
test( "max", function() {
- expect( 5 );
+ expect( 7 );
element = $( "<div></div>" );
options = {
@@ -54,7 +54,7 @@ test( "max", function() {
element.slider( options );
ok( element.slider( "option", "value" ) === options.value, "value option is not contained by max" );
ok( element.slider( "value" ) === options.max, "value method is contained by max" );
-
+
options = {
max: 9,
min: 1,
@@ -65,7 +65,7 @@ test( "max", function() {
element.slider( options );
ok( element.slider( "value" ) === 7, "value method is within max, edge Case" );
-
+
options.step = 2;
element.slider( options );
@@ -84,7 +84,24 @@ 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() {
expect( 2 );