How to use the react-testing-library.fireEvent.mouseMove function in react-testing-library

To help you get started, we’ve selected a few react-testing-library examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github atlassian / react-beautiful-dnd / test / unit / integration / drag-handle / mouse-sensor / force-abort.spec.js View on Github external
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();
github bmcmahen / react-gesture-responder / src / __tests__ / responder.tsx View on Github external
);

  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);
});
github atlassian / react-beautiful-dnd / test / unit / integration / drag-handle / mouse-sensor / force-abort.spec.js View on Github external
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();
github flow-typed / flow-typed / definitions / npm / react-testing-library_v5.x.x / flow_v0.67.1- / test_react-testing-library_v5.x.x.js View on Github external
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);
github ticketmaster / aurora / src / components / Input / __tests__ / DropDownGroup.spec.js View on Github external
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();
  });
github bmcmahen / react-gesture-responder / src / __tests__ / responder.tsx View on Github external
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);
});