MCPcopy Create free account
hub / github.com/react-component/select / hoverTest

Function hoverTest

tests/shared/hoverTest.tsx:5–21  ·  view source on GitHub ↗
(mode: any)

Source from the content-addressed store, hash-verified

3import { fireEvent, render } from '@testing-library/react';
4
5export default function hoverTest(mode: any) {
6 it('triggers mouseEnter and mouseLeave', () => {
7 const onMouseEnter = jest.fn();
8 const onMouseLeave = jest.fn();
9 const { container } = render(
10 <Select mode={mode} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>
11 <Option value="1">1</Option>
12 <Option value="2">2</Option>
13 </Select>,
14 );
15
16 fireEvent.mouseEnter(container.querySelector('.rc-select'));
17 expect(onMouseEnter).toBeCalled();
18 fireEvent.mouseLeave(container.querySelector('.rc-select'));
19 expect(onMouseLeave).toBeCalled();
20 });
21}

Callers 2

Tags.test.tsxFile · 0.85
Multiple.test.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…