Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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');
});
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);
fireEvent.emptied(htmlEl);
it('should hide tool tip on mouseLeave', () => {
const { getByTitle, queryByText } = render(HoverWrapper);
const button = getByTitle('view').parentNode as HTMLButtonElement;
fireEvent.mouseLeave(button);
wait(() => expect(queryByText('view')).toBeFalsy());
});
});