diff --git a/package.json b/package.json index 247b85eef8..6f1c509db4 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-material-ui": "workspace:^", - "eslint-plugin-mocha": "^10.2.0", + "eslint-plugin-mocha": "^10.3.0", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", "fast-glob": "^3.3.2", diff --git a/packages/mui-base/src/useAutocomplete/useAutocomplete.test.js b/packages/mui-base/src/useAutocomplete/useAutocomplete.test.js index c6bba16775..39e9917836 100644 --- a/packages/mui-base/src/useAutocomplete/useAutocomplete.test.js +++ b/packages/mui-base/src/useAutocomplete/useAutocomplete.test.js @@ -118,6 +118,7 @@ describe('useAutocomplete', () => { let filterOptions; let getOptionLabel; let options; + beforeEach(() => { filterOptions = createFilterOptions({ matchFrom: 'any' }); getOptionLabel = (option) => option.name; diff --git a/packages/mui-base/src/useInput/useInput.test.tsx b/packages/mui-base/src/useInput/useInput.test.tsx index 38e529c5b7..1e59e4dd6e 100644 --- a/packages/mui-base/src/useInput/useInput.test.tsx +++ b/packages/mui-base/src/useInput/useInput.test.tsx @@ -7,6 +7,7 @@ import { UseInputParameters } from './useInput.types'; describe('useInput', () => { const { render } = createRenderer(); + describe('params: inputRef', () => { it('should be able to attach input ref passed through params', () => { const inputRef = React.createRef(); diff --git a/packages/mui-base/src/useList/listReducer.test.ts b/packages/mui-base/src/useList/listReducer.test.ts index 873be0f0f7..1a60ac1f74 100644 --- a/packages/mui-base/src/useList/listReducer.test.ts +++ b/packages/mui-base/src/useList/listReducer.test.ts @@ -948,6 +948,7 @@ describe('listReducer', () => { describe('using custom item comparer', () => { type ItemType = { v: string }; + it('keeps the highlighted value if it is present among the new items', () => { const state: ListState = { highlightedValue: { v: '1' }, diff --git a/packages/mui-base/src/useList/useList.test.tsx b/packages/mui-base/src/useList/useList.test.tsx index 9c340d302f..ca25e9101b 100644 --- a/packages/mui-base/src/useList/useList.test.tsx +++ b/packages/mui-base/src/useList/useList.test.tsx @@ -6,6 +6,7 @@ import { useList } from './useList'; describe('useList', () => { const { render } = createRenderer(); + describe('preventing default behavior on keyDown', () => { ['ArrowUp', 'ArrowDown', 'Home', 'End', 'PageUp', 'PageDown', 'Enter', ' '].forEach((key) => it(`prevents default behavior when ${key} is pressed in activeDescendant focus management mode`, () => { diff --git a/packages/mui-base/src/useMenu/useMenu.test.js b/packages/mui-base/src/useMenu/useMenu.test.js index f182ae0896..6a07680a6e 100644 --- a/packages/mui-base/src/useMenu/useMenu.test.js +++ b/packages/mui-base/src/useMenu/useMenu.test.js @@ -7,6 +7,7 @@ import { useMenu } from './useMenu'; describe('useMenu', () => { const { render } = createRenderer(); + describe('getListboxProps', () => { it('returns props for root slot', () => { function TestMenu() { diff --git a/packages/mui-base/src/useMenuButton/useMenuButton.test.tsx b/packages/mui-base/src/useMenuButton/useMenuButton.test.tsx index 3d3b9f681b..96a7e446c7 100644 --- a/packages/mui-base/src/useMenuButton/useMenuButton.test.tsx +++ b/packages/mui-base/src/useMenuButton/useMenuButton.test.tsx @@ -16,6 +16,7 @@ const testContext: DropdownContextValue = { describe('useMenuButton', () => { const { render } = createRenderer(); + describe('getRootProps', () => { it('returns props for root slot', () => { function TestMenuButton() { diff --git a/packages/mui-base/src/useMenuItem/useMenuItem.test.tsx b/packages/mui-base/src/useMenuItem/useMenuItem.test.tsx index c074ead470..0da80599a0 100644 --- a/packages/mui-base/src/useMenuItem/useMenuItem.test.tsx +++ b/packages/mui-base/src/useMenuItem/useMenuItem.test.tsx @@ -7,6 +7,7 @@ import { useMenuItem } from './useMenuItem'; describe('useMenuItem', () => { const { render } = createRenderer(); + describe('getRootProps', () => { it('returns props for root slot', () => { function TestMenuItem() { diff --git a/packages/mui-base/src/useSlider/useSlider.test.js b/packages/mui-base/src/useSlider/useSlider.test.js index 9b4129a882..e4ee0313bd 100644 --- a/packages/mui-base/src/useSlider/useSlider.test.js +++ b/packages/mui-base/src/useSlider/useSlider.test.js @@ -6,6 +6,7 @@ import { useSlider } from './useSlider'; describe('useSlider', () => { const { render } = createRenderer(); + describe('getRootProps', () => { it('forwards external props including event handlers', () => { const rootRef = React.createRef(); diff --git a/packages/mui-base/src/useTab/useTab.test.tsx b/packages/mui-base/src/useTab/useTab.test.tsx index 60cc70b603..bcb42f3a59 100644 --- a/packages/mui-base/src/useTab/useTab.test.tsx +++ b/packages/mui-base/src/useTab/useTab.test.tsx @@ -8,6 +8,7 @@ import { useTab } from './useTab'; describe('useTab', () => { const { render } = createRenderer(); + describe('getRootProps', () => { it('returns props for root slot', () => { function TestTab() { diff --git a/packages/mui-base/src/useTabPanel/useTabPanel.test.js b/packages/mui-base/src/useTabPanel/useTabPanel.test.js index 4783238e42..5fe7336562 100644 --- a/packages/mui-base/src/useTabPanel/useTabPanel.test.js +++ b/packages/mui-base/src/useTabPanel/useTabPanel.test.js @@ -9,6 +9,7 @@ import { useTabPanel } from './useTabPanel'; describe('useTabPanel', () => { const { render } = createRenderer(); + describe('getRootProps', () => { it('returns props for root slot', () => { const rootRef = React.createRef(); diff --git a/packages/mui-base/src/useTabsList/useTabsList.test.tsx b/packages/mui-base/src/useTabsList/useTabsList.test.tsx index 31bae7561d..ea25334ff1 100644 --- a/packages/mui-base/src/useTabsList/useTabsList.test.tsx +++ b/packages/mui-base/src/useTabsList/useTabsList.test.tsx @@ -7,6 +7,7 @@ import { useTabsList } from './useTabsList'; describe('useTabsList', () => { const { render } = createRenderer(); + describe('getRootProps', () => { it('returns props for root slot', () => { function TestTabsList() { diff --git a/packages/mui-base/src/utils/prepareForSlot.test.tsx b/packages/mui-base/src/utils/prepareForSlot.test.tsx index 79da55b20a..ff40d34f16 100644 --- a/packages/mui-base/src/utils/prepareForSlot.test.tsx +++ b/packages/mui-base/src/utils/prepareForSlot.test.tsx @@ -6,6 +6,7 @@ import { prepareForSlot } from './prepareForSlot'; describe('prepareForSlot', () => { const { render } = createRenderer(); + it('should not warn about ownerState', () => { const ThirdPartyComponent = React.forwardRef((props, ref) => { // @ts-ignore just double checking that it is not defined diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 69f3f802cc..0c3b220501 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -235,8 +235,8 @@ importers: specifier: workspace:^ version: link:packages/eslint-plugin-material-ui eslint-plugin-mocha: - specifier: ^10.2.0 - version: 10.2.0(eslint@8.57.0) + specifier: ^10.3.0 + version: 10.3.0(eslint@8.57.0) eslint-plugin-react: specifier: ^7.33.2 version: 7.33.2(eslint@8.57.0) @@ -8896,8 +8896,8 @@ packages: semver: 6.3.1 dev: true - /eslint-plugin-mocha@10.2.0(eslint@8.57.0): - resolution: {integrity: sha512-ZhdxzSZnd1P9LqDPF0DBcFLpRIGdh1zkF2JHnQklKQOvrQtT73kdP5K9V2mzvbLR+cCAO9OI48NXK/Ax9/ciCQ==} + /eslint-plugin-mocha@10.3.0(eslint@8.57.0): + resolution: {integrity: sha512-IWzbg2K6B1Q7h37Ih4zMyW+nhmw1JvUlHlbCUUUu6PfOOAUGCB0gxmvv7/U+TQQ6e8yHUv+q7KMdIIum4bx+PA==} engines: {node: '>=14.0.0'} peerDependencies: eslint: '>=7.0.0'