diff --git a/packages/mui-material/src/FormControlLabel/FormControlLabel.test.js b/packages/mui-material/src/FormControlLabel/FormControlLabel.test.js
index 5cdbb1083e6614..b135543e4ce537 100644
--- a/packages/mui-material/src/FormControlLabel/FormControlLabel.test.js
+++ b/packages/mui-material/src/FormControlLabel/FormControlLabel.test.js
@@ -260,7 +260,9 @@ describe('
', () => {
});
it('should not inject extra props', () => {
- const Control = (props) =>
;
+ function Control(props) {
+ return
;
+ }
const { getByTestId } = render(
} />);
expect(getByTestId('control')).to.have.attribute('name', 'Dave');
diff --git a/packages/mui-material/src/Grid/Grid.test.js b/packages/mui-material/src/Grid/Grid.test.js
index ffcf3b349e5b83..c7b031abdb8446 100644
--- a/packages/mui-material/src/Grid/Grid.test.js
+++ b/packages/mui-material/src/Grid/Grid.test.js
@@ -693,7 +693,7 @@ describe('Material UI
', () => {
it('should not throw error for setting zero spacing in theme', () => {
const theme = createTheme({ spacing: 0 });
- const App = () => {
+ function App() {
return (
@@ -702,7 +702,7 @@ describe('Material UI ', () => {
);
- };
+ }
expect(() => {
render(
);
diff --git a/packages/mui-material/src/Hidden/HiddenCss.test.js b/packages/mui-material/src/Hidden/HiddenCss.test.js
index 0202625e1fd2c8..bfd1d95b64fcf1 100644
--- a/packages/mui-material/src/Hidden/HiddenCss.test.js
+++ b/packages/mui-material/src/Hidden/HiddenCss.test.js
@@ -5,7 +5,9 @@ import HiddenCss from './HiddenCss';
import { createTheme, ThemeProvider } from '../styles';
import classes from './hiddenCssClasses';
-const TestChild = () =>
bar
;
+function TestChild() {
+ return
bar
;
+}
describe('
', () => {
const { render } = createRenderer();
diff --git a/packages/mui-material/src/InputBase/InputBase.test.js b/packages/mui-material/src/InputBase/InputBase.test.js
index 65fb1ef3b131f4..eb1da1530c47fe 100644
--- a/packages/mui-material/src/InputBase/InputBase.test.js
+++ b/packages/mui-material/src/InputBase/InputBase.test.js
@@ -535,7 +535,7 @@ describe('
', () => {
it('should not warn when toggling between inputs', () => {
// this will ensure that unregistering was called during unmount
- const ToggleFormInputs = () => {
+ function ToggleFormInputs() {
const [flag, setFlag] = React.useState(true);
return (
@@ -552,7 +552,7 @@ describe('
', () => {
);
- };
+ }
const { getByText } = render(
);
expect(() => {
diff --git a/packages/mui-material/src/ListItemText/ListItemText.spec.tsx b/packages/mui-material/src/ListItemText/ListItemText.spec.tsx
index a48e1ef7da52db..eab98a93e51fe2 100644
--- a/packages/mui-material/src/ListItemText/ListItemText.spec.tsx
+++ b/packages/mui-material/src/ListItemText/ListItemText.spec.tsx
@@ -1,7 +1,9 @@
import * as React from 'react';
import { ListItemText } from '@mui/material';
-const CustomComponent: React.FC<{ prop1: string; prop2: number }> = () =>
;
+const CustomComponent: React.FC<{ prop1: string; prop2: number }> = function CustomComponent() {
+ return
;
+};
function typographyPropsTest() {
// @ts-expect-error
diff --git a/packages/mui-material/src/Modal/Modal.test.js b/packages/mui-material/src/Modal/Modal.test.js
index b5e1f771b93fc4..70ea0e748f230b 100644
--- a/packages/mui-material/src/Modal/Modal.test.js
+++ b/packages/mui-material/src/Modal/Modal.test.js
@@ -571,16 +571,18 @@ describe('
', () => {
clock.withFakeTimers();
it('should open and close', () => {
- const TestCase = (props) => (
-
-
- Hello
-
-
- World
-
-
- );
+ function TestCase(props) {
+ return (
+
+
+ Hello
+
+
+ World
+
+
+ );
+ }
TestCase.propTypes = {
open: PropTypes.bool,
};
@@ -599,18 +601,20 @@ describe('
', () => {
});
it('should open and close with Transitions', () => {
- const TestCase = (props) => (
-
-
-
- Hello
-
-
-
- World
-
-
- );
+ function TestCase(props) {
+ return (
+
+
+
+ Hello
+
+
+
+ World
+
+
+ );
+ }
const handleEntered = spy();
const handleExited = spy();
@@ -663,18 +667,20 @@ describe('
', () => {
clock.withFakeTimers();
it('when true it should close after Transition has finished', () => {
- const TestCase = (props) => (
-
-
- Hello
-
-
- );
+ function TestCase(props) {
+ return (
+
+
+ Hello
+
+
+ );
+ }
const handleEntered = spy();
const handleExiting = spy();
const handleExited = spy();
@@ -719,18 +725,20 @@ describe('
', () => {
});
it('when false it should close before Transition has finished', () => {
- const TestCase = (props) => (
-
-
- Hello
-
-
- );
+ function TestCase(props) {
+ return (
+
+
+ Hello
+
+
+ );
+ }
const handleEntered = spy();
const handleExiting = spy();
const handleExited = spy();
diff --git a/packages/mui-material/src/Paper/Paper.spec.tsx b/packages/mui-material/src/Paper/Paper.spec.tsx
index 85a4b0b390d5e3..d1ac34ce0d91aa 100644
--- a/packages/mui-material/src/Paper/Paper.spec.tsx
+++ b/packages/mui-material/src/Paper/Paper.spec.tsx
@@ -1,15 +1,20 @@
import * as React from 'react';
import Paper from '@mui/material/Paper';
-const CustomComponent: React.FC<{ stringProp: string; numberProp: number }> = () =>
;
+const CustomComponent: React.FC<{ stringProp: string; numberProp: number }> =
+ function CustomComponent() {
+ return
;
+ };
-const PaperTest = () => (
-
-
-
+function PaperTest() {
+ return (
+
+
+
-
- {/* @ts-expect-error */}
-
-
-);
+
+ {/* @ts-expect-error */}
+
+
+ );
+}
diff --git a/packages/mui-material/src/Select/Select.test.js b/packages/mui-material/src/Select/Select.test.js
index bb00594406304f..8d8e7026f0547f 100644
--- a/packages/mui-material/src/Select/Select.test.js
+++ b/packages/mui-material/src/Select/Select.test.js
@@ -1230,17 +1230,19 @@ describe('
', () => {
// avoid karma reload.
event.preventDefault();
});
- const Form = (props) => (
-
- );
+ function Form(props) {
+ return (
+
+ );
+ }
const { container, setProps } = render(
);
fireEvent.click(container.querySelector('button[type=submit]'));
diff --git a/packages/mui-material/src/Slider/Slider.test.js b/packages/mui-material/src/Slider/Slider.test.js
index b79eeabc4d654c..b448740edeaa52 100644
--- a/packages/mui-material/src/Slider/Slider.test.js
+++ b/packages/mui-material/src/Slider/Slider.test.js
@@ -1288,9 +1288,9 @@ describe('
', () => {
// ARRANGE
const dataTestId = 'slider-input-testid';
const name = 'custom-input';
- const CustomInput = ({ ownerState, ...props }) => (
-
- );
+ function CustomInput({ ownerState, ...props }) {
+ return
;
+ }
// ACT
const { getByTestId } = render(
);
diff --git a/packages/mui-material/src/Snackbar/Snackbar.test.js b/packages/mui-material/src/Snackbar/Snackbar.test.js
index f074f3ae274d60..a9472baded997b 100644
--- a/packages/mui-material/src/Snackbar/Snackbar.test.js
+++ b/packages/mui-material/src/Snackbar/Snackbar.test.js
@@ -528,7 +528,9 @@ describe('
', () => {
it('accepts a different component that handles the transition', () => {
const transitionRef = React.createRef();
- const Transition = () =>
;
+ function Transition() {
+ return
;
+ }
const { container } = render(
);
expect(container).to.contain(transitionRef.current);
});
diff --git a/packages/mui-material/src/SpeedDial/SpeedDial.test.js b/packages/mui-material/src/SpeedDial/SpeedDial.test.js
index d6ed61a0bd5efc..ac7ad19fd3b3c7 100644
--- a/packages/mui-material/src/SpeedDial/SpeedDial.test.js
+++ b/packages/mui-material/src/SpeedDial/SpeedDial.test.js
@@ -19,7 +19,9 @@ describe('
', () => {
const { clock, render } = createRenderer({ clock: 'fake' });
const icon =
font_icon;
- const FakeAction = () =>
;
+ function FakeAction() {
+ return
;
+ }
const defaultProps = {
open: true,
icon,
diff --git a/packages/mui-material/src/StepContent/StepContent.test.js b/packages/mui-material/src/StepContent/StepContent.test.js
index 8ca60fd4e961e2..401e523b1fe00b 100644
--- a/packages/mui-material/src/StepContent/StepContent.test.js
+++ b/packages/mui-material/src/StepContent/StepContent.test.js
@@ -77,7 +77,9 @@ describe('
', () => {
});
it('should use custom TransitionComponent', () => {
- const TransitionComponent = () =>
;
+ function TransitionComponent() {
+ return
;
+ }
const { container, getByTestId } = render(
diff --git a/packages/mui-material/src/StepLabel/StepLabel.test.js b/packages/mui-material/src/StepLabel/StepLabel.test.js
index 1d6083af3f3b01..dcc23e5cc290e3 100644
--- a/packages/mui-material/src/StepLabel/StepLabel.test.js
+++ b/packages/mui-material/src/StepLabel/StepLabel.test.js
@@ -48,7 +48,9 @@ describe('', () => {
describe('prop: StepIconComponent', () => {
it('should render', () => {
- const CustomizedIcon = () => ;
+ function CustomizedIcon() {
+ return ;
+ }
const { container, getByTestId } = render(
Step One
@@ -207,7 +209,9 @@ describe('', () => {
describe('renders with the className completed', () => {
it('renders with completed className when completed', () => {
- const CustomizedIcon = () => ;
+ function CustomizedIcon() {
+ return ;
+ }
const { container } = render(
Step One
@@ -221,7 +225,9 @@ describe('', () => {
describe('renders with the className active', () => {
it('renders with active className when active', () => {
- const CustomizedIcon = () => ;
+ function CustomizedIcon() {
+ return ;
+ }
const { container } = render(
Step One
diff --git a/packages/mui-material/src/Stepper/Stepper.test.tsx b/packages/mui-material/src/Stepper/Stepper.test.tsx
index 1f50fc47435ca1..17138c559727b3 100644
--- a/packages/mui-material/src/Stepper/Stepper.test.tsx
+++ b/packages/mui-material/src/Stepper/Stepper.test.tsx
@@ -111,7 +111,9 @@ describe('', () => {
});
it('passes index down correctly when rendering children containing arrays', () => {
- const CustomStep = ({ index }: StepProps) => ;
+ function CustomStep({ index }: StepProps) {
+ return ;
+ }
const { getAllByTestId } = render(
@@ -143,7 +145,9 @@ describe('', () => {
});
it('should allow the developer to specify a custom step connector', () => {
- const CustomConnector = () => ;
+ function CustomConnector() {
+ return ;
+ }
const { container } = render(
}>
diff --git a/packages/mui-material/src/SvgIcon/SvgIcon.test.js b/packages/mui-material/src/SvgIcon/SvgIcon.test.js
index 643091f7c99666..67f7bd26b1609a 100644
--- a/packages/mui-material/src/SvgIcon/SvgIcon.test.js
+++ b/packages/mui-material/src/SvgIcon/SvgIcon.test.js
@@ -98,11 +98,13 @@ describe('', () => {
});
describe('prop: inheritViewBox', () => {
- const CustomSvg = (props) => (
-
- );
+ function CustomSvg(props) {
+ return (
+
+ );
+ }
it('should render with the default viewBox if neither inheritViewBox nor viewBox are provided', () => {
const { container } = render();
diff --git a/packages/mui-material/src/TablePagination/TablePagination.test.js b/packages/mui-material/src/TablePagination/TablePagination.test.js
index fe413f19a3d3fb..53a3f7969ce6b4 100644
--- a/packages/mui-material/src/TablePagination/TablePagination.test.js
+++ b/packages/mui-material/src/TablePagination/TablePagination.test.js
@@ -277,7 +277,7 @@ describe('', () => {
describe('prop: count=-1', () => {
it('should display the "of more than" text and keep the nextButton enabled', () => {
- const Test = () => {
+ function Test() {
const [page, setPage] = React.useState(0);
return (
@@ -295,7 +295,7 @@ describe('', () => {
);
- };
+ }
const { container, getByRole } = render();
diff --git a/packages/mui-material/src/Tabs/Tabs.spec.tsx b/packages/mui-material/src/Tabs/Tabs.spec.tsx
index 29086280ce6505..249ed42187eac9 100644
--- a/packages/mui-material/src/Tabs/Tabs.spec.tsx
+++ b/packages/mui-material/src/Tabs/Tabs.spec.tsx
@@ -12,6 +12,10 @@ function testOnChange() {
/>;
}
-const TabTest = () => ;
+function TabTest() {
+ return ;
+}
-const TabIndicatorSxTest = () => ;
+function TabIndicatorSxTest() {
+ return ;
+}
diff --git a/packages/mui-material/src/Tooltip/Tooltip.test.js b/packages/mui-material/src/Tooltip/Tooltip.test.js
index e660e6ccae99af..9193eeb52c4733 100644
--- a/packages/mui-material/src/Tooltip/Tooltip.test.js
+++ b/packages/mui-material/src/Tooltip/Tooltip.test.js
@@ -472,15 +472,17 @@ describe('', () => {
it('should handle autoFocus + onFocus forwarding', () => {
const handleFocus = spy();
- const AutoFocus = (props) => (
-
- {props.open ? (
-
-
-
- ) : null}
-
- );
+ function AutoFocus(props) {
+ return (
+
+ {props.open ? (
+
+
+
+ ) : null}
+
+ );
+ }
const { setProps } = render(
,
@@ -1014,7 +1016,9 @@ describe('', () => {
describe('prop: PopperComponent', () => {
it('can render a different component', () => {
- const CustomPopper = () => ;
+ function CustomPopper() {
+ return ;
+ }
render(
);
-};
+}
-const SnackbarTest = () => (
-