aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAblay Keldibek <atomio.ak@gmail.com>2015-04-17 14:34:33 +0600
committerScott González <scott.gonzalez@gmail.com>2015-04-20 19:27:26 -0400
commitadcc8eff431847b4897666369310cb83275a8282 (patch)
tree78019c75e5a61f1d54a7cbe0ac4a78f659dcf952 /tests
parent0fc9bd208a0d42f3613c1519656203208195cd04 (diff)
downloadjquery-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.js26
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 } );
});
} );