diff --git a/packages-internal/test-utils/package.json b/packages-internal/test-utils/package.json index e5e97a96411abc..81b2bbc52d6abd 100644 --- a/packages-internal/test-utils/package.json +++ b/packages-internal/test-utils/package.json @@ -49,7 +49,6 @@ "mocha": "^10.4.0", "playwright": "^1.44.1", "prop-types": "^15.8.1", - "react-test-renderer": "^18.2.0", "sinon": "^16.1.3" }, "devDependencies": { @@ -59,7 +58,6 @@ "@types/prop-types": "^15.7.12", "@types/react": "^18.2.55", "@types/react-dom": "^18.3.0", - "@types/react-test-renderer": "^18.3.0", "@types/sinon": "^17.0.3", "typescript": "^5.4.5" }, diff --git a/packages-internal/test-utils/src/describeConformance.tsx b/packages-internal/test-utils/src/describeConformance.tsx index 6d5ee641d3c37c..b1c2dfc0dbc382 100644 --- a/packages-internal/test-utils/src/describeConformance.tsx +++ b/packages-internal/test-utils/src/describeConformance.tsx @@ -1,7 +1,6 @@ /* eslint-env mocha */ import * as React from 'react'; import { expect } from 'chai'; -import ReactTestRenderer from 'react-test-renderer'; import createDescribe from './createDescribe'; import { MuiRenderResult } from './createRenderer'; @@ -246,22 +245,6 @@ export function testRootClass( }); } -/** - * Tests that the component can be rendered with react-test-renderer. - * This is important for snapshot testing with Jest (even if we don't encourage it). - */ -export function testReactTestRenderer(element: React.ReactElement) { - it('should render without errors in ReactTestRenderer', () => { - ReactTestRenderer.act(() => { - ReactTestRenderer.create(element, { - createNodeMock: (node) => { - return document.createElement(node.type as keyof HTMLElementTagNameMap); - }, - }); - }); - }); -} - function forEachSlot( slots: ConformanceOptions['slots'], callback: (slotName: string, slot: SlotTestingOptions) => void, @@ -1018,7 +1001,6 @@ const fullSuite = { propsSpread: testPropsSpread, refForwarding: describeRef, rootClass: testRootClass, - reactTestRenderer: testReactTestRenderer, slotPropsProp: testSlotPropsProp, slotPropsCallback: testSlotPropsCallback, slotsProp: testSlotsProp, diff --git a/packages/mui-base/src/Menu/Menu.test.tsx b/packages/mui-base/src/Menu/Menu.test.tsx index 5d25dda325e20d..f5dd5b9cd3ba50 100644 --- a/packages/mui-base/src/Menu/Menu.test.tsx +++ b/packages/mui-base/src/Menu/Menu.test.tsx @@ -53,7 +53,7 @@ describe('', () => { expectedClassName: menuClasses.listbox, }, }, - skip: ['reactTestRenderer', 'componentProp', 'slotsProp'], + skip: ['componentProp', 'slotsProp'], })); describe('after initialization', () => { diff --git a/packages/mui-base/src/MenuButton/MenuButton.test.tsx b/packages/mui-base/src/MenuButton/MenuButton.test.tsx index 26658177f8fc9d..ee213658e70dd2 100644 --- a/packages/mui-base/src/MenuButton/MenuButton.test.tsx +++ b/packages/mui-base/src/MenuButton/MenuButton.test.tsx @@ -37,7 +37,7 @@ describe('', () => { testWithElement: null, }, }, - skip: ['componentProp', 'reactTestRenderer'], + skip: ['componentProp'], })); describe('prop: disabled', () => { diff --git a/packages/mui-base/src/MenuItem/MenuItem.test.tsx b/packages/mui-base/src/MenuItem/MenuItem.test.tsx index 3f3efa09059d80..1ee75a22aa7b61 100644 --- a/packages/mui-base/src/MenuItem/MenuItem.test.tsx +++ b/packages/mui-base/src/MenuItem/MenuItem.test.tsx @@ -37,9 +37,6 @@ describe('', () => { expectedClassName: menuItemClasses.root, }, }, - skip: [ - 'componentProp', - 'reactTestRenderer', // Need to be wrapped in MenuContext - ], + skip: ['componentProp'], })); }); diff --git a/packages/mui-base/src/Modal/Modal.test.tsx b/packages/mui-base/src/Modal/Modal.test.tsx index c1f1bff8348230..291a16c734a646 100644 --- a/packages/mui-base/src/Modal/Modal.test.tsx +++ b/packages/mui-base/src/Modal/Modal.test.tsx @@ -29,10 +29,7 @@ describe('', () => { expectedClassName: classes.root, }, }, - skip: [ - 'componentProp', - 'reactTestRenderer', // portal https://github.com/facebook/react/issues/11565 - ], + skip: ['componentProp'], }), ); diff --git a/packages/mui-base/src/Option/Option.test.tsx b/packages/mui-base/src/Option/Option.test.tsx index 36eae126b0cc04..9eb8a58d86d4e0 100644 --- a/packages/mui-base/src/Option/Option.test.tsx +++ b/packages/mui-base/src/Option/Option.test.tsx @@ -38,9 +38,6 @@ describe('