Skip to content

Commit

Permalink
test: add test case (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ authored Jul 17, 2024
1 parent 3664b9e commit 1f19dbc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/demo/editable.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Multiple
title: Editable
nav:
title: Demo
path: /demo
Expand Down
5 changes: 4 additions & 1 deletion docs/examples/editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default () => {
range={{
editable: true,
}}
track={false}
// track={false}
min={0}
max={100}
value={value}
Expand All @@ -35,6 +35,9 @@ export default () => {
rail: {
background: `linear-gradient(to right, blue, red)`,
},
track: {
background: 'orange',
},
}}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ const Slider = React.forwardRef<SliderRef, SliderProps<number | number[]>>((prop
<Tracks
prefixCls={prefixCls}
style={trackStyle}
values={sortedCacheValues}
values={rawValues}
startPoint={startPoint}
onStartMove={mergedDraggableTrack ? onStartMove : undefined}
/>
Expand Down
2 changes: 2 additions & 0 deletions tests/Range.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,8 @@ describe('Range', () => {
doMouseMove(container, 0, 1000);
expect(onChange).toHaveBeenCalledWith([50, 100]);

expect(container.querySelectorAll('.rc-slider-track')).toHaveLength(1);

// Fire mouse up
fireEvent.mouseUp(container.querySelector('.rc-slider-handle'));
expect(onChangeComplete).toHaveBeenCalledWith([50, 100]);
Expand Down

0 comments on commit 1f19dbc

Please sign in to comment.