Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
expect(() => {
// trying to move the mounted and unmounted handles
fireEvent.mouseMove(handle, { clientX: 100, clientY: 100 });
fireEvent.mouseMove(newHandle, { clientX: 100, clientY: 100 });
// flush frames which would cause movement
requestAnimationFrame.flush();
}).not.toThrow();
);
const child = getByTestId("example");
// mouse events
fireEvent.mouseDown(child);
expect(onGrant).toBeCalled();
fireEvent.mouseMove(child);
expect(onMove).toBeCalled();
fireEvent.mouseUp(child);
expect(onRelease).toBeCalled();
// touch events
fireEvent.touchStart(child);
fireEvent.touchMove(child);
fireEvent.touchEnd(child);
expect(onGrant).toBeCalledTimes(2);
expect(onMove).toBeCalledTimes(4);
expect(onRelease).toBeCalledTimes(2);
});
expect(() => {
// trying to move the mounted and unmounted handles
fireEvent.mouseMove(handle, { clientX: 100, clientY: 100 });
fireEvent.mouseMove(newHandle, { clientX: 100, clientY: 100 });
// flush frames which would cause movement
requestAnimationFrame.flush();
}).not.toThrow();
fireEvent.click(htmlEl);
fireEvent.contextMenu(htmlEl);
fireEvent.dblClick(htmlEl);
fireEvent.doubleClick(htmlEl);
fireEvent.drag(htmlEl);
fireEvent.dragEnd(htmlEl);
fireEvent.dragEnter(htmlEl);
fireEvent.dragExit(htmlEl);
fireEvent.dragLeave(htmlEl);
fireEvent.dragOver(htmlEl);
fireEvent.dragStart(htmlEl);
fireEvent.drop(htmlEl);
fireEvent.mouseDown(htmlEl);
fireEvent.mouseEnter(htmlEl);
fireEvent.mouseLeave(htmlEl);
fireEvent.mouseMove(htmlEl);
fireEvent.mouseOut(htmlEl);
fireEvent.mouseOver(htmlEl);
fireEvent.mouseUp(htmlEl);
fireEvent.select(htmlEl);
fireEvent.touchCancel(htmlEl);
fireEvent.touchEnd(htmlEl);
fireEvent.touchMove(htmlEl);
fireEvent.touchStart(htmlEl);
fireEvent.scroll(htmlEl);
fireEvent.wheel(htmlEl);
fireEvent.abort(htmlEl);
fireEvent.canPlay(htmlEl);
fireEvent.canPlayThrough(htmlEl);
fireEvent.durationChange(htmlEl);
fireEvent.emptied(htmlEl);
fireEvent.encrypted(htmlEl);
it("Effect when move moves over dropdown option when focused is same as index", () => {
const { container, getByTestId } = renderTestComponentOne({ isOpen: true });
fireEvent.mouseMove(getByTestId("test-dropDownOptionOne"));
expect(container.firstChild).toMatchSnapshot();
});
onMoveShouldSet: () => {
return true;
},
onGrant,
onTerminate: otherTerminate
}}
/>
);
const child = getByTestId("release");
fireEvent.mouseDown(child);
const other = getByTestId("other");
fireEvent.mouseDown(other);
fireEvent.mouseMove(other);
expect(onGrant).toBeCalled();
expect(otherTerminate).toBeCalledTimes(0);
});