Skip to content

Commit a468d7d

Browse files
committed
test: keep react testing event behavior
1 parent fa49007 commit a468d7d

11 files changed

Lines changed: 11 additions & 22 deletions

tests/align.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { fireEvent } from '@testing-library/dom';
2-
import { act, cleanup, render } from '@testing-library/react';
1+
import { act, cleanup, fireEvent, render } from '@testing-library/react';
32
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
43
import React from 'react';
54
import type { TriggerProps, TriggerRef } from '../src';

tests/basic.test.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { fireEvent } from '@testing-library/dom';
21
/* eslint-disable max-classes-per-file */
3-
import { act, cleanup, render } from '@testing-library/react';
2+
import { act, cleanup, fireEvent, render } from '@testing-library/react';
43
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
54
import React, { StrictMode, createRef } from 'react';
65
import ReactDOM, { createPortal } from 'react-dom';

tests/mask.test.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { fireEvent } from '@testing-library/dom';
21
import React from 'react';
3-
import { render } from '@testing-library/react';
2+
import { fireEvent, render } from '@testing-library/react';
43
import Trigger from '../src';
54
import CSSMotion from '@rc-component/motion';
65
import { placementAlignMap } from './util';

tests/mobile.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { fireEvent } from '@testing-library/dom';
2-
import { act, render } from '@testing-library/react';
1+
import { act, fireEvent, render } from '@testing-library/react';
32
import isMobile from '@rc-component/util/lib/isMobile';
43
import React from 'react';
54
import Trigger, { type TriggerProps } from '../src';

tests/motion.test.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { fireEvent } from '@testing-library/dom';
2-
import { act, cleanup, render } from '@testing-library/react';
1+
import { act, cleanup, fireEvent, render } from '@testing-library/react';
32
import Trigger from '../src';
43
import { placementAlignMap } from './util';
54

tests/open-change.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { fireEvent } from '@testing-library/dom';
2-
import { act, cleanup, render } from '@testing-library/react';
1+
import { act, cleanup, fireEvent, render } from '@testing-library/react';
32
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
43
import * as React from 'react';
54
import Trigger from '../src';

tests/perf.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { fireEvent } from '@testing-library/dom';
2-
import { cleanup, render } from '@testing-library/react';
1+
import { cleanup, fireEvent, render } from '@testing-library/react';
32
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
43
import React from 'react';
54
import Trigger, { type TriggerProps } from '../src';

tests/point.test.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { fireEvent } from '@testing-library/dom';
2-
import { act, cleanup, render } from '@testing-library/react';
1+
import { act, cleanup, fireEvent, render } from '@testing-library/react';
32
import React from 'react';
43
import Trigger from '../src';
54
import { getMouseEvent } from './util';

tests/portal.test.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { fireEvent } from '@testing-library/dom';
21
/* eslint-disable max-classes-per-file */
32

4-
import { act, cleanup, render } from '@testing-library/react';
3+
import { act, cleanup, fireEvent, render } from '@testing-library/react';
54
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
65
import React from 'react';
76
import ReactDOM from 'react-dom';

tests/shadow.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { fireEvent } from '@testing-library/dom';
2-
import { act } from '@testing-library/react';
1+
import { act, fireEvent } from '@testing-library/react';
32
import { resetWarned } from '@rc-component/util/lib/warning';
43
import React from 'react';
54
import { createRoot } from 'react-dom/client';

0 commit comments

Comments
 (0)