How to use the react-testing-library.fireEvent.mouseEnter 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 dericgw / react-tiny-fab / src / __tests__ / fab.jsx View on Github external
it('should open the menu when hovered and close when exited', async () => {
      const { getByTestId } = render(
        +}>
          +
        
      );

      const fab = getByTestId('fab');

      // Sanity check to make sure that it is in fact closed
      expect(fab).not.toHaveClass('rtf open');
      fireEvent.mouseEnter(getByTestId('fab'));
      expect(fab).toHaveClass('rtf open');
      fireEvent.mouseLeave(getByTestId('fab'));
      expect(fab).not.toHaveClass('rtf open');
    });
github guardian / facia-tool / client-v2 / src / shared / components / input / __tests__ / HoverActions.spec.tsx View on Github external
it('should display correct tool tip on mouseEnter', async () => {
    const { getByTitle, getByText } = render(HoverWrapper);
    const button = getByTitle('ophan').parentNode as HTMLButtonElement;
    fireEvent.mouseEnter(button);
    const ToolTip = await waitForElement(() => getByText('ophan'));
    expect(ToolTip).toBeTruthy();
  });
github dericgw / react-tiny-fab / src / __tests__ / fab.jsx View on Github external
it('should NOT open the menu when hovered if the event type is "click"', () => {
      const { getByTestId } = render(
        +} event="click">
          +
        
      );

      const fab = getByTestId('fab');

      fireEvent.mouseEnter(fab);
      expect(fab).not.toHaveClass('rtf open');
      expect(fab).toHaveClass('rtf closed');
    });
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.invalid(htmlEl);
    fireEvent.submit(htmlEl);
    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);