Skip to content

Commit

Permalink
test: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Jul 18, 2024
1 parent 799d57f commit 2ed4547
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/Range.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@ describe('Range', () => {
const mouseDown = createEvent.mouseDown(ele);
(mouseDown as any).pageX = start;
(mouseDown as any).pageY = start;

const preventDefault = jest.fn();

Object.defineProperties(mouseDown, {
clientX: { get: () => start },
clientY: { get: () => start },
preventDefault: { value: preventDefault },
});

fireEvent.mouseEnter(ele);
fireEvent(ele, mouseDown);

expect(preventDefault).toHaveBeenCalled();
}

function doMouseMove(
Expand Down

0 comments on commit 2ed4547

Please sign in to comment.