diff --git a/components/splitter/__tests__/index.test.tsx b/components/splitter/__tests__/index.test.tsx index 6704133db8..cc11cd6541 100644 --- a/components/splitter/__tests__/index.test.tsx +++ b/components/splitter/__tests__/index.test.tsx @@ -319,6 +319,9 @@ describe('Splitter', () => { await doMove(container, 1, { clientX: 160 }); expect(mockMoving).toHaveBeenNthCalledWith(2, [10, 60, 5, 25], 1); + await doMove(container, 0, { clientX: -120 }); + expect(mockMoving).toHaveBeenNthCalledWith(2, [10, 60, 5, 25], 1); + await doMove(container, 2, { clientX: 60 }); expect(mockMoving).toHaveBeenNthCalledWith(3, [10, 60, 18, 12], 2); @@ -326,8 +329,15 @@ describe('Splitter', () => { await doMove(container, 0, { clientX: -120 }); expect(mockMoving).toHaveBeenNthCalledWith(4, [0, 100], 0); + await doMove(container, 0, { clientX: -120 }); + expect(mockMoving).toHaveBeenNthCalledWith(4, [0, 100], 0); + await doMove(container, 0, { clientX: 120 }); + expect(mockMoving).toHaveBeenNthCalledWith(4, [0, 100], 0); + await doMove(container, 0, { clientX: 440 }); expect(mockMoving).toHaveBeenNthCalledWith(5, [100, 0], 0); + await doMove(container, 0, { clientX: 120 }); + expect(mockMoving).toHaveBeenNthCalledWith(5, [100, 0], 0); }); it('The RTL should work fine.', async () => {