]> source.dussan.org Git - jquery-ui.git/commitdiff
Slider: Verify value constraint with a max that is a step mismatch
authorAblay Keldibek <atomio.ak@gmail.com>
Thu, 12 Mar 2015 07:26:24 +0000 (13:26 +0600)
committerScott González <scott.gonzalez@gmail.com>
Thu, 9 Jun 2016 16:08:29 +0000 (12:08 -0400)
Ref #10078
Closes gh-1485

(cherry picked from commit 21831f5036bd695cc2734ec3f44e97549d2f7660)

tests/unit/slider/slider_methods.js

index ce26620e22173b53713415d36f23b3bfa661f200..1a82e6edfbf8acac9c2c46c62f97e7ae4a9c6156 100644 (file)
@@ -62,7 +62,7 @@ test( "disable", function() {
 });
 
 test( "value", function() {
-       expect( 18 );
+       expect( 19 );
        $( [ false, "min", "max" ] ).each(function() {
                var element = $( "<div></div>" ).slider({
                        range: this,
@@ -98,6 +98,16 @@ test( "value", function() {
        });
        element.slider( "option", "value", 2.4 );
        equal( element.slider( "value" ), 2.4, "value is set to max with 0.01 step" );
+
+       element = $( "<div></div>" ).slider({
+               value: 100,
+               min: 10,
+               max: 500,
+               step: 50
+       });
+
+       element.slider( "option", "value", 510 );
+       equal( element.slider( "value" ), 460, "value is restricted to maximum valid step" );
 });
 
 //test( "values", function() {