diff --git a/tests/Range.test.tsx b/tests/Range.test.tsx index e90381b14..6f7d5a220 100644 --- a/tests/Range.test.tsx +++ b/tests/Range.test.tsx @@ -751,5 +751,49 @@ describe('Range', () => { // 2 handle expect(container.querySelectorAll('.rc-slider-handle')).toHaveLength(0); }); + + it('not remove when minCount', () => { + const onChange = jest.fn(); + + const { container } = render( + ori} + />, + ); + + const handle = container.querySelector('.rc-slider-handle'); + + // Key + fireEvent.mouseEnter(handle); + fireEvent.keyDown(handle, { + keyCode: keyCode.DELETE, + }); + expect(onChange).not.toHaveBeenCalled(); + + // Mouse + doMouseMove(container, 0, 1000); + expect(onChange).toHaveBeenCalledWith([100]); + }); + + it('maxCount not add', () => { + const onChange = jest.fn(); + const { container } = render( + , + ); + + doMouseDown(container, 50, 'rc-slider', true); + expect(onChange).toHaveBeenCalledWith([0, 50]); + }); }); });