Skip to content

Commit d451e90

Browse files
Chore update array snapshot test to use @testing-library/react (#4846)
In order to prep for React 19, began conversion from `react-test-renderer` to `@testing-library/react` for the `arrayTests.tsx` - Updated `snapshot-tests` to convert the `arrayTests.tsx` to use `@testing-library/react` - Updated all snapshots accordingly
1 parent c0cb135 commit d451e90

File tree

14 files changed

+54059
-81870
lines changed

14 files changed

+54059
-81870
lines changed

packages/antd/test/Array.test.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1-
import { arrayTests, CHECKBOXES_CUSTOMIZE } from '@rjsf/snapshot-tests';
1+
import { arrayTests } from '@rjsf/snapshot-tests';
22

33
import '../__mocks__/matchMedia.mock';
44
import Form from '../src';
55

6-
arrayTests(Form, {
7-
[CHECKBOXES_CUSTOMIZE]: {
8-
createNodeMock: (element) => {
9-
if (element.type === 'span' && element.props['aria-hidden']) {
10-
// the `rc-select` MultipleSelector code expects a ref for this span to exist, so use the feature of
11-
// react-test-renderer to create one
12-
// See: https://reactjs.org/docs/test-renderer.html#ideas
13-
return { scrollWidth: 100 };
14-
}
15-
return null;
16-
},
17-
},
18-
});
6+
arrayTests(Form);

packages/antd/test/__snapshots__/Array.test.tsx.snap

Lines changed: 6787 additions & 10386 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)