diff options
author | Ablay Keldibek <atomio.ak@gmail.com> | 2015-04-17 14:34:33 +0600 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-04-20 19:27:26 -0400 |
commit | adcc8eff431847b4897666369310cb83275a8282 (patch) | |
tree | 78019c75e5a61f1d54a7cbe0ac4a78f659dcf952 /tests | |
parent | 0fc9bd208a0d42f3613c1519656203208195cd04 (diff) | |
download | jquery-ui-adcc8eff431847b4897666369310cb83275a8282.tar.gz jquery-ui-adcc8eff431847b4897666369310cb83275a8282.zip |
Slider: Pass 0 value if slider reaches it
Fixes #12196
Closes gh-1540
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/slider/events.js | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/unit/slider/events.js b/tests/unit/slider/events.js index 0d22577f1..db771ec27 100644 --- a/tests/unit/slider/events.js +++ b/tests/unit/slider/events.js @@ -169,7 +169,7 @@ test( "mouse based interaction part two: when handles overlap", function() { }); test( "event data", function() { - expect( 4 ); + expect( 6 ); var slideHandleIndex = 3, values = [ 8, 9, 7, 4 ], @@ -203,6 +203,30 @@ test( "event data", function() { }); handles.eq( slideHandleIndex ).simulate( "drag", { dx: 10 } ); + + element.slider( "destroy" ); + element = $( "#slider1" ).slider({ + min: 0, + max: 100, + value: 1, + slide: function ( event, ui ) { + equal( ui.value, 0, "should pass 0 value if slider reaches it" ); + } + }); + handles = element.find( ".ui-slider-handle" ); + handles.eq( 0 ).simulate( "drag", { dx: -10 } ); + + element.slider( "destroy" ); + element = $( "#slider1" ).slider({ + min: 0, + max: 100, + values: [ 1, 2 ], + slide: function ( event, ui ) { + equal( ui.value, 0, "should pass 0 value if one of handles reaches it" ); + } + }); + handles = element.find( ".ui-slider-handle" ); + handles.eq( 0 ).simulate( "drag", { dx: -10 } ); }); } ); |