@@ -856,6 +856,35 @@ describe('Range', () => {
856856 } ) ;
857857 } ) ;
858858
859+ it ( 'keeps pushable when clicking the track' , ( ) => {
860+ const onChange = jest . fn ( ) ;
861+ const { container } = render (
862+ < Slider range defaultValue = { [ 20 , 40 ] } pushable = { 20 } onChange = { onChange } /> ,
863+ ) ;
864+
865+ doMouseDown ( container , 30 , 'rc-slider' , true ) ;
866+ fireEvent . mouseUp ( document ) ;
867+
868+ expect ( onChange ) . toHaveBeenLastCalledWith ( [ 10 , 30 ] ) ;
869+ } ) ;
870+
871+ it ( 'keeps pushable when inserting an editable handle' , ( ) => {
872+ const onChange = jest . fn ( ) ;
873+ const { container } = render (
874+ < Slider
875+ range = { { editable : true } }
876+ defaultValue = { [ 20 , 40 ] }
877+ pushable = { 20 }
878+ onChange = { onChange }
879+ /> ,
880+ ) ;
881+
882+ doMouseDown ( container , 30 , 'rc-slider' , true ) ;
883+ fireEvent . mouseUp ( document ) ;
884+
885+ expect ( onChange ) . toHaveBeenLastCalledWith ( [ 10 , 30 , 50 ] ) ;
886+ } ) ;
887+
859888 describe ( 'disabled as array' , ( ) => {
860889 const getHandle = ( container : HTMLElement , index = 0 ) =>
861890 container . getElementsByClassName ( 'rc-slider-handle' ) [ index ] as HTMLElement ;
0 commit comments