From b9c14fc8e479fae25eaa4ad914918aba6acaaef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aar=C3=B3n=20Garc=C3=ADa=20Herv=C3=A1s?= Date: Tue, 16 Jul 2024 14:04:30 +0200 Subject: [PATCH] Fix errors --- .../test-utils/src/mochaHooks.test.js | 1 + packages/mui-base/src/Button/Button.test.tsx | 32 ++--- .../ClickAwayListener.test.js | 1 + .../mui-base/src/Dropdown/Dropdown.test.tsx | 1 + packages/mui-base/src/Menu/Menu.test.tsx | 1 + .../src/MenuButton/MenuButton.test.tsx | 2 +- packages/mui-base/src/Select/Select.test.tsx | 24 ++-- .../mui-base/src/Snackbar/Snackbar.test.tsx | 1 + .../Unstable_NumberInput/NumberInput.test.tsx | 20 ++- .../src/Unstable_Popup/Popup.test.tsx | 1 + .../useNumberInput.test.tsx | 12 +- .../useAutocomplete/useAutocomplete.test.js | 8 +- .../mui-joy/src/Accordion/Accordion.test.tsx | 4 +- .../src/Autocomplete/Autocomplete.test.tsx | 8 +- .../mui-joy/src/Checkbox/Checkbox.test.tsx | 6 +- .../ListItemButton/ListItemButton.test.tsx | 3 +- packages/mui-joy/src/Radio/Radio.test.tsx | 2 +- packages/mui-joy/src/Select/Select.test.tsx | 10 +- .../mui-joy/src/Snackbar/Snackbar.test.tsx | 1 + packages/mui-joy/src/Switch/Switch.test.tsx | 6 +- .../mui-lab/src/TabContext/TabContext.test.js | 1 + .../src/Accordion/Accordion.test.js | 4 +- .../AccordionSummary/AccordionSummary.test.js | 6 +- .../src/Autocomplete/Autocomplete.test.js | 128 +++++++++++------- .../src/ButtonBase/ButtonBase.test.js | 1 + .../src/CardHeader/CardHeader.test.js | 15 +- packages/mui-material/src/Chip/Chip.test.js | 4 +- .../ClickAwayListener.test.js | 1 + .../src/Collapse/Collapse.test.js | 31 +++-- .../mui-material/src/Dialog/Dialog.test.js | 11 +- .../src/ListItem/ListItem.test.js | 3 +- .../src/MenuItem/MenuItem.test.js | 8 +- .../mui-material/src/Slider/Slider.test.js | 3 +- .../src/Snackbar/Snackbar.test.js | 4 +- .../src/StepButton/StepButton.test.js | 3 +- .../SwipeableDrawer/SwipeableDrawer.test.js | 4 +- .../mui-material/src/Switch/Switch.test.js | 3 +- packages/mui-material/src/Tabs/Tabs.test.js | 8 ++ .../useAutocomplete/useAutocomplete.test.js | 3 +- .../src/StylesProvider/StylesProvider.test.js | 3 + packages/mui-styles/src/styled/styled.test.js | 22 +-- packages/mui-system/src/Box/Box.test.js | 38 +++--- 42 files changed, 251 insertions(+), 197 deletions(-) diff --git a/packages-internal/test-utils/src/mochaHooks.test.js b/packages-internal/test-utils/src/mochaHooks.test.js index 2628a7a0543d68..eb99a562d19d46 100644 --- a/packages-internal/test-utils/src/mochaHooks.test.js +++ b/packages-internal/test-utils/src/mochaHooks.test.js @@ -83,6 +83,7 @@ describe('mochaHooks', () => { // not wrapped in act() unsafeSetState(1); // make sure effects are flushed + // eslint-disable-next-line testing-library/no-unnecessary-act act(() => {}); }); diff --git a/packages/mui-base/src/Button/Button.test.tsx b/packages/mui-base/src/Button/Button.test.tsx index 95a89a1d7d7d08..33e70679df54a6 100644 --- a/packages/mui-base/src/Button/Button.test.tsx +++ b/packages/mui-base/src/Button/Button.test.tsx @@ -63,46 +63,44 @@ describe('