From f68102ba37f77d53034d75bfcde210ea7a76b1a4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 15:05:25 +0300 Subject: [PATCH 1/2] Bump MUI Internal (#14485) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas --- docs/package.json | 4 +- package.json | 6 +- packages/x-charts/package.json | 2 +- packages/x-data-grid-premium/package.json | 2 +- .../exportExcel.DataGridPremium.test.tsx | 10 +- packages/x-data-grid-pro/package.json | 2 +- .../tests/cellEditing.DataGridPro.test.tsx | 4 +- .../tests/columnPinning.DataGridPro.test.tsx | 93 +++++----- .../tests/editComponents.DataGridPro.test.tsx | 163 +++++++++--------- packages/x-data-grid/package.json | 2 +- packages/x-date-pickers-pro/package.json | 2 +- packages/x-date-pickers/package.json | 2 +- packages/x-internals/package.json | 2 +- packages/x-license/package.json | 2 +- packages/x-tree-view-pro/package.json | 2 +- packages/x-tree-view/package.json | 2 +- pnpm-lock.yaml | 111 ++++++------ 17 files changed, 206 insertions(+), 205 deletions(-) diff --git a/docs/package.json b/docs/package.json index cecbb3be2310c..79341f12f4527 100644 --- a/docs/package.json +++ b/docs/package.json @@ -27,7 +27,7 @@ "@emotion/react": "^11.13.3", "@emotion/server": "^11.11.0", "@emotion/styled": "^11.13.0", - "@mui/docs": "6.0.1", + "@mui/docs": "6.0.2", "@mui/icons-material": "^5.16.7", "@mui/joy": "^5.0.0-beta.48", "@mui/lab": "^5.0.0-alpha.173", @@ -102,7 +102,7 @@ "@babel/plugin-transform-react-constant-elements": "^7.25.1", "@babel/preset-typescript": "^7.24.7", "@mui/internal-docs-utils": "^1.0.12", - "@mui/internal-scripts": "^1.0.18", + "@mui/internal-scripts": "^1.0.19", "@types/chance": "^1.1.6", "@types/d3-scale": "^4.0.8", "@types/d3-scale-chromatic": "^3.0.3", diff --git a/package.json b/package.json index 785d9395916ae..00146fb546dbb 100644 --- a/package.json +++ b/package.json @@ -91,8 +91,8 @@ "@emotion/styled": "^11.13.0", "@mui/icons-material": "^5.16.7", "@mui/internal-babel-plugin-resolve-imports": "1.0.17", - "@mui/internal-markdown": "^1.0.11", - "@mui/internal-test-utils": "^1.0.11", + "@mui/internal-markdown": "^1.0.12", + "@mui/internal-test-utils": "^1.0.12", "@mui/material": "^5.16.7", "@mui/monorepo": "github:mui/material-ui#f8b2251c5bdfe4d81f56017e0423d265b242617d", "@mui/utils": "^5.16.6", @@ -183,7 +183,7 @@ "remark": "^13.0.0", "rimraf": "^5.0.10", "serve": "^14.2.3", - "sinon": "^16.1.3", + "sinon": "^18.0.0", "stream-browserify": "^3.0.0", "string-replace-loader": "^3.1.0", "terser-webpack-plugin": "^5.3.10", diff --git a/packages/x-charts/package.json b/packages/x-charts/package.json index bf10d935f48c2..a6600e79f27f2 100644 --- a/packages/x-charts/package.json +++ b/packages/x-charts/package.json @@ -65,7 +65,7 @@ } }, "devDependencies": { - "@mui/internal-test-utils": "^1.0.11", + "@mui/internal-test-utils": "^1.0.12", "@mui/material": "^5.16.7", "@mui/system": "^5.16.7", "@react-spring/core": "^9.7.4", diff --git a/packages/x-data-grid-premium/package.json b/packages/x-data-grid-premium/package.json index e1ca45ae61c6d..20658901315af 100644 --- a/packages/x-data-grid-premium/package.json +++ b/packages/x-data-grid-premium/package.json @@ -72,7 +72,7 @@ } }, "devDependencies": { - "@mui/internal-test-utils": "^1.0.11", + "@mui/internal-test-utils": "^1.0.12", "@mui/material": "^5.16.7", "@mui/system": "^5.16.7", "@types/prop-types": "^15.7.12", diff --git a/packages/x-data-grid-premium/src/tests/exportExcel.DataGridPremium.test.tsx b/packages/x-data-grid-premium/src/tests/exportExcel.DataGridPremium.test.tsx index 08d9483f1edad..b7e6c72fe40f0 100644 --- a/packages/x-data-grid-premium/src/tests/exportExcel.DataGridPremium.test.tsx +++ b/packages/x-data-grid-premium/src/tests/exportExcel.DataGridPremium.test.tsx @@ -8,7 +8,7 @@ import { DataGridPremiumProps, GridActionsCellItem, } from '@mui/x-data-grid-premium'; -import { createRenderer, screen, fireEvent, act } from '@mui/internal-test-utils'; +import { createRenderer, screen, act } from '@mui/internal-test-utils'; import { spy, SinonSpy } from 'sinon'; import { expect } from 'chai'; import Excel from 'exceljs'; @@ -17,7 +17,7 @@ import { spyApi } from 'test/utils/helperFn'; const isJSDOM = /jsdom/.test(window.navigator.userAgent); describe(' - Export Excel', () => { - const { render } = createRenderer({ clock: 'fake' }); + const { render } = createRenderer(); let apiRef: React.MutableRefObject; @@ -57,10 +57,10 @@ describe(' - Export Excel', () => { expect(await act(() => apiRef.current.getDataAsExcel())).not.to.equal(null); }); - it('should display export option', () => { - render(); + it('should display export option', async () => { + const { user } = render(); - fireEvent.click(screen.getByRole('button', { name: 'Export' })); + await user.click(screen.getByRole('button', { name: 'Export' })); expect(screen.queryByRole('menu')).not.to.equal(null); expect(screen.queryByRole('menuitem', { name: 'Download as Excel' })).not.to.equal(null); }); diff --git a/packages/x-data-grid-pro/package.json b/packages/x-data-grid-pro/package.json index c6fb3c9a6fcba..2f247fca02d18 100644 --- a/packages/x-data-grid-pro/package.json +++ b/packages/x-data-grid-pro/package.json @@ -70,7 +70,7 @@ } }, "devDependencies": { - "@mui/internal-test-utils": "^1.0.11", + "@mui/internal-test-utils": "^1.0.12", "@mui/material": "^5.16.7", "@mui/system": "^5.16.7", "@types/prop-types": "^15.7.12", diff --git a/packages/x-data-grid-pro/src/tests/cellEditing.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/cellEditing.DataGridPro.test.tsx index e28fd45873d79..61eb25906561a 100644 --- a/packages/x-data-grid-pro/src/tests/cellEditing.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/cellEditing.DataGridPro.test.tsx @@ -18,7 +18,7 @@ import { getCell, spyApi } from 'test/utils/helperFn'; import { fireUserEvent } from 'test/utils/fireUserEvent'; describe(' - Cell editing', () => { - const { render, clock } = createRenderer({ clock: 'fake' }); + const { render, clock } = createRenderer(); let apiRef: React.MutableRefObject; @@ -315,6 +315,8 @@ describe(' - Cell editing', () => { }); describe('with debounceMs > 0', () => { + clock.withFakeTimers(); + it('should debounce multiple changes if debounceMs > 0', () => { render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); diff --git a/packages/x-data-grid-pro/src/tests/columnPinning.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/columnPinning.DataGridPro.test.tsx index 340fefa5515c8..448aa1d0c63ca 100644 --- a/packages/x-data-grid-pro/src/tests/columnPinning.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/columnPinning.DataGridPro.test.tsx @@ -39,7 +39,7 @@ function createDragOverEvent(target: ChildNode) { const isJSDOM = /jsdom/.test(window.navigator.userAgent); describe(' - Column pinning', () => { - const { render, clock } = createRenderer({ clock: 'fake' }); + const { render, clock } = createRenderer(); let apiRef: React.MutableRefObject; @@ -328,11 +328,12 @@ describe(' - Column pinning', () => { }); describe('prop: disableColumnPinning', () => { - it('should not add any button to the column menu', () => { - render(); + it('should not add any button to the column menu', async () => { + const { user } = render(); const columnCell = document.querySelector('[role="columnheader"][data-field="id"]')!; const menuIconButton = columnCell.querySelector('button[aria-label="Menu"]')!; - fireEvent.click(menuIconButton); + + await user.click(menuIconButton); expect(screen.queryByRole('menuitem', { name: 'Pin to left' })).to.equal(null); expect(screen.queryByRole('menuitem', { name: 'Pin to right' })).to.equal(null); }); @@ -460,76 +461,80 @@ describe(' - Column pinning', () => { }); describe('column menu', () => { - it('should pin the column to the left when clicking the "Pin to left" pinning button', () => { - render(); + it('should pin the column to the left when clicking the "Pin to left" pinning button', async () => { + const { user } = render(); const columnCell = $('[role="columnheader"][data-field="id"]')!; const menuIconButton = columnCell.querySelector('button[aria-label="Menu"]')!; - fireEvent.click(menuIconButton); - fireEvent.click(screen.getByRole('menuitem', { name: 'Pin to left' })); + await user.click(menuIconButton); + await user.click(screen.getByRole('menuitem', { name: 'Pin to left' })); expect($(`.${gridClasses['cell--pinnedLeft']}[data-field="id"]`)).not.to.equal(null); }); - it('should pin the column to the right when clicking the "Pin to right" pinning button', () => { - render(); + it('should pin the column to the right when clicking the "Pin to right" pinning button', async () => { + const { user } = render(); const columnCell = $('[role="columnheader"][data-field="id"]')!; const menuIconButton = columnCell.querySelector('button[aria-label="Menu"]')!; - fireEvent.click(menuIconButton); - fireEvent.click(screen.getByRole('menuitem', { name: 'Pin to right' })); + await user.click(menuIconButton); + await user.click(screen.getByRole('menuitem', { name: 'Pin to right' })); expect($(`.${gridClasses['cell--pinnedRight']}[data-field="id"]`)).not.to.equal(null); }); - it('should allow to invert the side when clicking on "Pin to right" pinning button on a left pinned column', () => { - render(); + it('should allow to invert the side when clicking on "Pin to right" pinning button on a left pinned column', async () => { + const { user } = render(); const columnCell = $('[role="columnheader"][data-field="id"]')!; const menuIconButton = columnCell.querySelector('button[aria-label="Menu"]')!; - fireEvent.click(menuIconButton); - fireEvent.click(screen.getByRole('menuitem', { name: 'Pin to right' })); + await user.click(menuIconButton); + await user.click(screen.getByRole('menuitem', { name: 'Pin to right' })); expect($(`.${gridClasses['cell--pinnedLeft']}[data-field="id"]`)).to.equal(null); expect($(`.${gridClasses['cell--pinnedRight']}[data-field="id"]`)).not.to.equal(null); }); - it('should allow to invert the side when clicking on "Pin to left" pinning button on a right pinned column', () => { - render(); + it('should allow to invert the side when clicking on "Pin to left" pinning button on a right pinned column', async () => { + const { user } = render(); const columnCell = $('[role="columnheader"][data-field="id"]')!; const menuIconButton = columnCell.querySelector('button[aria-label="Menu"]')!; - fireEvent.click(menuIconButton); - fireEvent.click(screen.getByRole('menuitem', { name: 'Pin to left' })); + await user.click(menuIconButton); + await user.click(screen.getByRole('menuitem', { name: 'Pin to left' })); expect($(`.${gridClasses['cell--pinnedRight']}[data-field="id"]`)).to.equal(null); expect($(`.${gridClasses['cell--pinnedLeft']}[data-field="id"]`)).not.to.equal(null); }); - it('should allow to unpin a pinned left column when clicking "Unpin" pinning button', () => { - render(); + it('should allow to unpin a pinned left column when clicking "Unpin" pinning button', async () => { + const { user } = render(); const columnCell = $('[role="columnheader"][data-field="id"]')!; const menuIconButton = columnCell.querySelector('button[aria-label="Menu"]')!; - fireEvent.click(menuIconButton); - fireEvent.click(screen.getByRole('menuitem', { name: 'Unpin' })); + await user.click(menuIconButton); + await user.click(screen.getByRole('menuitem', { name: 'Unpin' })); expect($(`.${gridClasses['cell--pinnedLeft']}[data-field="id"]`)).to.equal(null); }); - it('should not render menu items if the column has `pinnable` equals to false', () => { - render( - , - ); + describe('with fake timers', () => { + clock.withFakeTimers(); - const brandHeader = document.querySelector('[role="columnheader"][data-field="brand"]')!; - fireEvent.click(brandHeader.querySelector('button[aria-label="Menu"]')!); - expect(screen.queryByRole('menuitem', { name: 'Pin to left' })).not.to.equal(null); - fireEvent.keyDown(screen.getByRole('menu'), { key: 'Escape' }); + it('should not render menu items if the column has `pinnable` equals to false', () => { + render( + , + ); - clock.runToLast(); - // Ensure that the first menu was closed - expect(screen.queryByRole('menuitem', { name: 'Pin to left' })).to.equal(null); + const brandHeader = document.querySelector('[role="columnheader"][data-field="brand"]')!; + fireEvent.click(brandHeader.querySelector('button[aria-label="Menu"]')!); + expect(screen.queryByRole('menuitem', { name: 'Pin to left' })).not.to.equal(null); + fireEvent.keyDown(screen.getByRole('menu'), { key: 'Escape' }); - const yearHeader = document.querySelector('[role="columnheader"][data-field="year"]')!; - fireEvent.click(yearHeader.querySelector('button[aria-label="Menu"]')!); - expect(screen.queryByRole('menuitem', { name: 'Pin to left' })).to.equal(null); + clock.runToLast(); + // Ensure that the first menu was closed + expect(screen.queryByRole('menuitem', { name: 'Pin to left' })).to.equal(null); + + const yearHeader = document.querySelector('[role="columnheader"][data-field="year"]')!; + fireEvent.click(yearHeader.querySelector('button[aria-label="Menu"]')!); + expect(screen.queryByRole('menuitem', { name: 'Pin to left' })).to.equal(null); + }); }); }); diff --git a/packages/x-data-grid-pro/src/tests/editComponents.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/editComponents.DataGridPro.test.tsx index 4982b8f559b46..9ae74b6bd1c01 100644 --- a/packages/x-data-grid-pro/src/tests/editComponents.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/editComponents.DataGridPro.test.tsx @@ -10,7 +10,7 @@ import { renderEditInputCell, renderEditSingleSelectCell, } from '@mui/x-data-grid-pro'; -import { act, createRenderer, fireEvent, screen } from '@mui/internal-test-utils'; +import { act, createRenderer, fireEvent, screen, waitFor, within } from '@mui/internal-test-utils'; import { expect } from 'chai'; import { getCell, spyApi } from 'test/utils/helperFn'; import { fireUserEvent } from 'test/utils/fireUserEvent'; @@ -39,7 +39,7 @@ const generateDate = ( }; describe(' - Edit components', () => { - const { render, clock } = createRenderer({ clock: 'fake' }); + const { render, clock } = createRenderer(); let apiRef: React.MutableRefObject; @@ -67,7 +67,7 @@ describe(' - Edit components', () => { const cell = getCell(0, 0); fireEvent.doubleClick(cell); - const input = cell.querySelector('input')!; + const input = within(cell).getByRole('textbox'); expect(input.value).to.equal('Nike'); fireEvent.change(input, { target: { value: 'Puma' } }); @@ -80,44 +80,46 @@ describe(' - Edit components', () => { }); }); - it('should pass the value prop to the input', () => { + it('should pass the value prop to the input', async () => { defaultData.columns[0].valueParser = (value) => (value as string).toUpperCase(); - render(); + const { user } = render(); const cell = getCell(0, 0); - fireEvent.doubleClick(cell); + await user.dblClick(cell); - const input = cell.querySelector('input')!; + const input = within(cell).getByRole('textbox'); expect(input.value).to.equal('Nike'); fireEvent.change(input, { target: { value: 'Puma' } }); expect(input.value).to.equal('PUMA'); - - clock.tick(200); - expect(input.value).to.equal('PUMA'); }); - it('should display a indicator while processing the props', async () => { - defaultData.columns[0].preProcessEditCellProps = () => - new Promise((resolve) => { - setTimeout(resolve, 500); - }); - render(); + describe('with fake timers', () => { + clock.withFakeTimers(); - const cell = getCell(0, 0); - fireEvent.doubleClick(cell); + it('should display a indicator while processing the props', async () => { + defaultData.columns[0].preProcessEditCellProps = ({ props }) => + new Promise((resolve) => { + setTimeout(() => resolve(props), 500); + }); + render(); - const input = cell.querySelector('input')!; - expect(input.value).to.equal('Nike'); + const cell = getCell(0, 0); + fireEvent.doubleClick(cell); - expect(screen.queryByTestId('LoadIcon')).to.equal(null); - fireEvent.change(input, { target: { value: 'Puma' } }); - act(() => clock.tick(200)); - expect(screen.queryByTestId('LoadIcon')).not.to.equal(null); + const input = within(cell).getByRole('textbox'); + expect(input.value).to.equal('Nike'); - clock.tick(500); - await act(() => Promise.resolve()); - expect(screen.queryByTestId('LoadIcon')).to.equal(null); + expect(screen.queryByTestId('LoadIcon')).to.equal(null); + fireEvent.change(input, { target: { value: 'Puma' } }); + + clock.tick(200); + expect(screen.queryByTestId('LoadIcon')).not.to.equal(null); + + clock.tick(500); + await act(() => Promise.resolve()); + expect(screen.queryByTestId('LoadIcon')).to.equal(null); + }); }); it('should call onValueChange if defined', async () => { @@ -129,9 +131,9 @@ describe(' - Edit components', () => { render(); const cell = getCell(0, 0); - fireEvent.doubleClick(cell); + fireEvent.dblClick(cell); - const input = cell.querySelector('input')!; + const input = within(cell).getByRole('textbox'); fireEvent.change(input, { target: { value: 'Puma' } }); await act(() => Promise.resolve()); @@ -153,7 +155,7 @@ describe(' - Edit components', () => { const cell = getCell(0, 0); fireEvent.doubleClick(cell); - const input = cell.querySelector('input')!; + const input = within(cell).getByRole('spinbutton'); expect(input.value).to.equal('100'); fireEvent.change(input, { target: { value: '110' } }); @@ -166,60 +168,61 @@ describe(' - Edit components', () => { }); }); - it('should the value prop to the input', () => { - render(); + it('should the value prop to the input', async () => { + const { user } = render(); const cell = getCell(0, 0); - fireEvent.doubleClick(cell); + await user.dblClick(cell); - const input = cell.querySelector('input')!; + const input = within(cell).getByRole('spinbutton'); expect(input.value).to.equal('100'); fireEvent.change(input, { target: { value: '110' } }); expect(input.value).to.equal('110'); - - clock.tick(200); - expect(input.value).to.equal('110'); }); it('should keep values as numbers', async () => { const preProcessEditCellPropsSpy = spy(({ props }) => props); defaultData.columns[0].preProcessEditCellProps = preProcessEditCellPropsSpy; - render(); + const { user } = render(); const cell = getCell(0, 0); - fireEvent.doubleClick(cell); + await user.dblClick(cell); - const input = cell.querySelector('input')!; + const input = within(cell).getByRole('spinbutton'); expect(input.value).to.equal('100'); fireEvent.change(input, { target: { value: '110' } }); - act(() => clock.tick(200)); - expect(preProcessEditCellPropsSpy.lastCall.args[0].props.value).to.equal(110); - await act(() => Promise.resolve()); // To avoid mutating the state after unmount + await waitFor(() => + expect(preProcessEditCellPropsSpy.lastCall.args[0].props.value).to.equal(110), + ); }); - it('should display a indicator while processing the props', async () => { - defaultData.columns[0].preProcessEditCellProps = ({ props }) => - new Promise((resolve) => { - setTimeout(() => resolve(props), 500); - }); - render(); + describe('with fake timers', () => { + clock.withFakeTimers(); - const cell = getCell(0, 0); - fireEvent.doubleClick(cell); + it('should display a indicator while processing the props', async () => { + defaultData.columns[0].preProcessEditCellProps = ({ props }) => + new Promise((resolve) => { + setTimeout(() => resolve(props), 500); + }); + render(); - const input = cell.querySelector('input')!; - expect(input.value).to.equal('100'); + const cell = getCell(0, 0); + fireEvent.doubleClick(cell); - expect(screen.queryByTestId('LoadIcon')).to.equal(null); - fireEvent.change(input, { target: { value: 110 } }); - clock.tick(200); - expect(screen.queryByTestId('LoadIcon')).not.to.equal(null); + const input = within(cell).getByRole('spinbutton'); + expect(input.value).to.equal('100'); - clock.tick(500); - await act(() => Promise.resolve()); - expect(screen.queryByTestId('LoadIcon')).to.equal(null); + expect(screen.queryByTestId('LoadIcon')).to.equal(null); + fireEvent.change(input, { target: { value: 110 } }); + clock.tick(200); + expect(screen.queryByTestId('LoadIcon')).not.to.equal(null); + + clock.tick(500); + await act(() => Promise.resolve()); + expect(screen.queryByTestId('LoadIcon')).to.equal(null); + }); }); }); @@ -467,13 +470,13 @@ describe(' - Edit components', () => { ]; }); - it('should call setEditCellValue with the correct value when valueOptions is an array of strings', () => { - render(); + it('should call setEditCellValue with the correct value when valueOptions is an array of strings', async () => { + const { user } = render(); const spiedSetEditCellValue = spyApi(apiRef.current, 'setEditCellValue'); const cell = getCell(0, 0); - fireEvent.doubleClick(cell); - fireEvent.click(screen.queryAllByRole('option')[1]); + await user.dblClick(cell); + await user.click(screen.queryAllByRole('option')[1]); expect(spiedSetEditCellValue.lastCall.args[0]).to.deep.equal({ id: 0, @@ -482,7 +485,7 @@ describe(' - Edit components', () => { }); }); - it('should call setEditCellValue with the correct value when valueOptions is an array of objects', () => { + it('should call setEditCellValue with the correct value when valueOptions is an array of objects', async () => { defaultData.rows = [{ id: 0, brand: 0 }]; defaultData.columns = [ { @@ -495,12 +498,12 @@ describe(' - Edit components', () => { editable: true, }, ]; - render(); + const { user } = render(); const spiedSetEditCellValue = spyApi(apiRef.current, 'setEditCellValue'); const cell = getCell(0, 0); - fireEvent.doubleClick(cell); - fireEvent.click(screen.queryAllByRole('option')[1]); + await user.dblClick(cell); + await user.click(screen.queryAllByRole('option')[1]); expect(spiedSetEditCellValue.lastCall.args[0]).to.deep.equal({ id: 0, @@ -509,7 +512,7 @@ describe(' - Edit components', () => { }); }); - it('should call setEditCellValue with the correct value when valueOptions is a function', () => { + it('should call setEditCellValue with the correct value when valueOptions is a function', async () => { defaultData.columns = [ { field: 'brand', @@ -518,12 +521,12 @@ describe(' - Edit components', () => { editable: true, }, ]; - render(); + const { user } = render(); const spiedSetEditCellValue = spyApi(apiRef.current, 'setEditCellValue'); const cell = getCell(0, 0); - fireEvent.doubleClick(cell); - fireEvent.click(screen.queryAllByRole('option')[1]); + await user.dblClick(cell); + await user.click(screen.queryAllByRole('option')[1]); expect(spiedSetEditCellValue.lastCall.args[0]).to.deep.equal({ id: 0, @@ -592,8 +595,7 @@ describe(' - Edit components', () => { const cell = getCell(0, 0); fireEvent.doubleClick(cell); fireUserEvent.mousePress(screen.queryAllByRole('option')[1]); - clock.runToLast(); - expect(screen.queryByRole('listbox')).to.equal(null); + await waitFor(() => expect(screen.queryByRole('listbox')).to.equal(null)); fireEvent.keyDown(screen.getByRole('combobox'), { key: 'Enter' }); expect(screen.queryByRole('listbox')).to.equal(null); @@ -615,7 +617,7 @@ describe(' - Edit components', () => { const cell = getCell(0, 0); fireEvent.doubleClick(cell); - const input = cell.querySelector('input')!; + const input = within(cell).getByRole('checkbox'); expect(input.checked).to.equal(false); fireEvent.click(input); @@ -632,16 +634,15 @@ describe(' - Edit components', () => { defaultData.columns[0].renderEditCell = (params) => renderEditBooleanCell({ ...params, onValueChange }); - render(); + const { user } = render(); const cell = getCell(0, 0); - fireEvent.doubleClick(cell); + await user.dblClick(cell); - const input = cell.querySelector('input')!; - fireEvent.click(input); - await act(() => Promise.resolve()); + const input = within(cell).getByRole('checkbox'); + await user.click(input); - expect(onValueChange.callCount).to.equal(1); + await waitFor(() => expect(onValueChange.callCount).to.equal(1)); expect(onValueChange.lastCall.args[1]).to.equal(true); }); }); diff --git a/packages/x-data-grid/package.json b/packages/x-data-grid/package.json index e6b2f7e04ace2..9af9934e8531f 100644 --- a/packages/x-data-grid/package.json +++ b/packages/x-data-grid/package.json @@ -71,7 +71,7 @@ } }, "devDependencies": { - "@mui/internal-test-utils": "^1.0.11", + "@mui/internal-test-utils": "^1.0.12", "@mui/joy": "^5.0.0-beta.48", "@mui/material": "^5.16.7", "@mui/system": "^5.16.7", diff --git a/packages/x-date-pickers-pro/package.json b/packages/x-date-pickers-pro/package.json index 6035608cf2ec1..594bd42a3bcfa 100644 --- a/packages/x-date-pickers-pro/package.json +++ b/packages/x-date-pickers-pro/package.json @@ -96,7 +96,7 @@ } }, "devDependencies": { - "@mui/internal-test-utils": "^1.0.11", + "@mui/internal-test-utils": "^1.0.12", "@mui/material": "^5.16.7", "@mui/system": "^5.16.7", "@types/luxon": "^3.4.2", diff --git a/packages/x-date-pickers/package.json b/packages/x-date-pickers/package.json index 7d125dfb18409..065254e217354 100644 --- a/packages/x-date-pickers/package.json +++ b/packages/x-date-pickers/package.json @@ -98,7 +98,7 @@ } }, "devDependencies": { - "@mui/internal-test-utils": "^1.0.11", + "@mui/internal-test-utils": "^1.0.12", "@mui/material": "^5.16.7", "@mui/system": "^5.16.7", "@types/luxon": "^3.4.2", diff --git a/packages/x-internals/package.json b/packages/x-internals/package.json index 01698392beb33..c25efbc16a3a7 100644 --- a/packages/x-internals/package.json +++ b/packages/x-internals/package.json @@ -48,7 +48,7 @@ "react": "^17.0.0 || ^18.0.0" }, "devDependencies": { - "@mui/internal-test-utils": "^1.0.11", + "@mui/internal-test-utils": "^1.0.12", "rimraf": "^5.0.10" }, "engines": { diff --git a/packages/x-license/package.json b/packages/x-license/package.json index 06a95c06bd225..20bbae4c3afb4 100644 --- a/packages/x-license/package.json +++ b/packages/x-license/package.json @@ -41,7 +41,7 @@ "react": "^17.0.0 || ^18.0.0" }, "devDependencies": { - "@mui/internal-test-utils": "^1.0.11", + "@mui/internal-test-utils": "^1.0.12", "rimraf": "^5.0.10" }, "engines": { diff --git a/packages/x-tree-view-pro/package.json b/packages/x-tree-view-pro/package.json index c5cb8e6d646fc..4206477354586 100644 --- a/packages/x-tree-view-pro/package.json +++ b/packages/x-tree-view-pro/package.json @@ -70,7 +70,7 @@ } }, "devDependencies": { - "@mui/internal-test-utils": "^1.0.11", + "@mui/internal-test-utils": "^1.0.12", "@mui/material": "^5.16.7", "@mui/system": "^5.16.7", "@types/prop-types": "^15.7.12", diff --git a/packages/x-tree-view/package.json b/packages/x-tree-view/package.json index 523fa9657609c..fb3ec5d1ed108 100644 --- a/packages/x-tree-view/package.json +++ b/packages/x-tree-view/package.json @@ -68,7 +68,7 @@ } }, "devDependencies": { - "@mui/internal-test-utils": "^1.0.11", + "@mui/internal-test-utils": "^1.0.12", "@mui/material": "^5.16.7", "@mui/system": "^5.16.7", "@types/prop-types": "^15.7.12", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 63472d3a81be2..ef60d92810d14 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -90,11 +90,11 @@ importers: specifier: 1.0.17 version: 1.0.17(@babel/core@7.25.2) '@mui/internal-markdown': - specifier: ^1.0.11 - version: 1.0.11 + specifier: ^1.0.12 + version: 1.0.12 '@mui/internal-test-utils': - specifier: ^1.0.11 - version: 1.0.11(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.0.12 + version: 1.0.12(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/material': specifier: ^5.16.7 version: 5.16.7(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -366,8 +366,8 @@ importers: specifier: ^14.2.3 version: 14.2.3 sinon: - specifier: ^16.1.3 - version: 16.1.3 + specifier: ^18.0.0 + version: 18.0.0 stream-browserify: specifier: ^3.0.0 version: 3.0.0 @@ -429,8 +429,8 @@ importers: specifier: ^11.13.0 version: 11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1) '@mui/docs': - specifier: 6.0.1 - version: 6.0.1(bm6kywyrtzseqscuvn3yfzmlbi) + specifier: 6.0.2 + version: 6.0.2(bm6kywyrtzseqscuvn3yfzmlbi) '@mui/icons-material': specifier: ^5.16.7 version: 5.16.7(@mui/material@5.16.7(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.4)(react@18.3.1) @@ -649,8 +649,8 @@ importers: specifier: ^1.0.12 version: 1.0.12 '@mui/internal-scripts': - specifier: ^1.0.18 - version: 1.0.18 + specifier: ^1.0.19 + version: 1.0.19 '@types/chance': specifier: ^1.1.6 version: 1.1.6 @@ -749,8 +749,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: ^1.0.11 - version: 1.0.11(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.0.12 + version: 1.0.12(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/material': specifier: ^5.16.7 version: 5.16.7(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -993,8 +993,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: ^1.0.11 - version: 1.0.11(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.0.12 + version: 1.0.12(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/joy': specifier: ^5.0.0-beta.48 version: 5.0.0-beta.48(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1105,8 +1105,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: ^1.0.11 - version: 1.0.11(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.0.12 + version: 1.0.12(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/material': specifier: ^5.16.7 version: 5.16.7(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1167,8 +1167,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: ^1.0.11 - version: 1.0.11(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.0.12 + version: 1.0.12(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/material': specifier: ^5.16.7 version: 5.16.7(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1220,8 +1220,8 @@ importers: version: 4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: ^1.0.11 - version: 1.0.11(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.0.12 + version: 1.0.12(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/material': specifier: ^5.16.7 version: 5.16.7(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1315,8 +1315,8 @@ importers: version: 4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: ^1.0.11 - version: 1.0.11(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.0.12 + version: 1.0.12(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/material': specifier: ^5.16.7 version: 5.16.7(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1362,8 +1362,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: ^1.0.11 - version: 1.0.11(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.0.12 + version: 1.0.12(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rimraf: specifier: ^5.0.10 version: 5.0.10 @@ -1382,8 +1382,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: ^1.0.11 - version: 1.0.11(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.0.12 + version: 1.0.12(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rimraf: specifier: ^5.0.10 version: 5.0.10 @@ -1426,8 +1426,8 @@ importers: version: 4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: ^1.0.11 - version: 1.0.11(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.0.12 + version: 1.0.12(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/material': specifier: ^5.16.7 version: 5.16.7(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1485,8 +1485,8 @@ importers: version: 4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: ^1.0.11 - version: 1.0.11(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.0.12 + version: 1.0.12(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/material': specifier: ^5.16.7 version: 5.16.7(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -3076,8 +3076,8 @@ packages: '@mui/core-downloads-tracker@5.16.7': resolution: {integrity: sha512-RtsCt4Geed2/v74sbihWzzRs+HsIQCfclHeORh5Ynu2fS4icIKozcSubwuG7vtzq2uW3fOR1zITSP84TNt2GoQ==} - '@mui/docs@6.0.1': - resolution: {integrity: sha512-L/qfb+BGauBpEZBHyZPy961vLRUjVgcVqoOvzbtq56nsI05FEFkNgJuQvG1W3PRoR7pZNVgSW6NMFzTj1C4y+w==} + '@mui/docs@6.0.2': + resolution: {integrity: sha512-2iEOJbelGf+44CeRT1u7GuCui925Ot6nFIEDJEzcrvJFqw9+AMvzexjWe/emGQAGFAcjU1/4wZVUNKnW8SY8PQ==} engines: {node: '>=14.0.0'} peerDependencies: '@mui/base': '*' @@ -3112,14 +3112,14 @@ packages: '@mui/internal-docs-utils@1.0.12': resolution: {integrity: sha512-U5nkY88gi+a2MR6S2wXULPr7wscXFlLAatX2kn4S2bGGi/tLndSgmmzsvUKWMG/2bSnJ50F1frHnhgPkFM4znA==} - '@mui/internal-markdown@1.0.11': - resolution: {integrity: sha512-eKinbHo+/qlNkpuvnG0w7eBZApWM10DcNSK909aPv2AaWgAJ6ObCjcbpNCf8OfLb92xQrNcHFBVhEWcsddwflg==} + '@mui/internal-markdown@1.0.12': + resolution: {integrity: sha512-nr7j8PR+Gi0IL/ygf6/Qczb+/96drEVTOKPSRE7xTQaAWVefsCUDagN5UXaiW89iVAMLCGqup8Pzvxe5mE9Erw==} - '@mui/internal-scripts@1.0.18': - resolution: {integrity: sha512-4qgDg1u0beQnR1KySBcexfh/JDOobpdsHYLkKicb4tZxVzvDlW/cZ2zYS2gQVYqkpJfhiKhRbeafns5LYSQgXg==} + '@mui/internal-scripts@1.0.19': + resolution: {integrity: sha512-NFyNxOIfrUtn3744rqk4UmkgGfbG7rntHxSFEXGAEy4yQRoEIIbOfHQURKJSupDKyCc48vSFMk+eGbiMBEYpKg==} - '@mui/internal-test-utils@1.0.11': - resolution: {integrity: sha512-zTb0PFLOk2McR6ONojtI77ReJyz8vm+mzpYcgUpCAICyZsfTcsv+OTOrduyhP4OIvoBRUOAH0FSBD6VXz5d4Ew==} + '@mui/internal-test-utils@1.0.12': + resolution: {integrity: sha512-D6qc9h2sK2owOMQ68j9yaChr0iNW5mqSrfVGbRJ7NHMeyovkqIMQLHCwvs05d+5cccAeqalvKVsNvK3BkMilEw==} peerDependencies: react: ^18.2.0 react-dom: ^18.2.0 @@ -3858,9 +3858,6 @@ packages: '@sinonjs/commons@3.0.1': resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} - '@sinonjs/fake-timers@10.3.0': - resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} - '@sinonjs/fake-timers@11.2.2': resolution: {integrity: sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==} @@ -7902,8 +7899,8 @@ packages: sass: optional: true - nise@5.1.7: - resolution: {integrity: sha512-wWtNUhkT7k58uvWTB/Gy26eA/EJKtPZFVAhEilN5UYVmmGRYOURbejRUyKm0Uu9XVEW7K5nBOZfR8VMB4QR2RQ==} + nise@6.0.0: + resolution: {integrity: sha512-K8ePqo9BFvN31HXwEtTNGzgrPpmvgciDsFz8aztFjt4LqKO/JeFD8tBOeuDiCMXrIl/m1YvfH8auSpxfaD09wg==} no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} @@ -9111,8 +9108,8 @@ packages: simple-swizzle@0.2.2: resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} - sinon@16.1.3: - resolution: {integrity: sha512-mjnWWeyxcAf9nC0bXcPmiDut+oE8HYridTNzBbF98AYVLmWwGRp2ISEpyhYflG1ifILT+eNn3BmKUJPxjXUPlA==} + sinon@18.0.0: + resolution: {integrity: sha512-+dXDXzD1sBO6HlmZDd7mXZCR/y5ECiEiGCBSGuFD/kZ0bDTofPYc6JaeGmPSF+1j1MejGUWkORbYOLDyvqCWpA==} sirv@2.0.4: resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} @@ -11868,12 +11865,12 @@ snapshots: '@mui/core-downloads-tracker@5.16.7': {} - '@mui/docs@6.0.1(bm6kywyrtzseqscuvn3yfzmlbi)': + '@mui/docs@6.0.2(bm6kywyrtzseqscuvn3yfzmlbi)': dependencies: '@babel/runtime': 7.25.6 '@mui/base': 5.0.0-beta.40(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/icons-material': 5.16.7(@mui/material@5.16.7(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.4)(react@18.3.1) - '@mui/internal-markdown': 1.0.11 + '@mui/internal-markdown': 1.0.12 '@mui/material': 5.16.7(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/system': 5.16.7(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1))(@types/react@18.3.4)(react@18.3.1) chai: 5.1.1 @@ -11905,14 +11902,14 @@ snapshots: rimraf: 5.0.10 typescript: 5.5.4 - '@mui/internal-markdown@1.0.11': + '@mui/internal-markdown@1.0.12': dependencies: '@babel/runtime': 7.25.6 lodash: 4.17.21 marked: 13.0.3 prismjs: 1.29.0 - '@mui/internal-scripts@1.0.18': + '@mui/internal-scripts@1.0.19': dependencies: '@babel/core': 7.25.2 '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.25.2) @@ -11927,7 +11924,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@mui/internal-test-utils@1.0.11(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@mui/internal-test-utils@1.0.12(@babel/core@7.25.2)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.25.2) '@babel/preset-typescript': 7.24.7(@babel/core@7.25.2) @@ -11950,7 +11947,7 @@ snapshots: prop-types: 15.8.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - sinon: 16.1.3 + sinon: 18.0.0 transitivePeerDependencies: - '@babel/core' - '@types/react' @@ -12784,10 +12781,6 @@ snapshots: dependencies: type-detect: 4.0.8 - '@sinonjs/fake-timers@10.3.0': - dependencies: - '@sinonjs/commons': 3.0.1 - '@sinonjs/fake-timers@11.2.2': dependencies: '@sinonjs/commons': 3.0.1 @@ -17684,7 +17677,7 @@ snapshots: - '@babel/core' - babel-plugin-macros - nise@5.1.7: + nise@6.0.0: dependencies: '@sinonjs/commons': 3.0.1 '@sinonjs/fake-timers': 11.2.2 @@ -19099,13 +19092,13 @@ snapshots: dependencies: is-arrayish: 0.3.2 - sinon@16.1.3: + sinon@18.0.0: dependencies: '@sinonjs/commons': 3.0.1 - '@sinonjs/fake-timers': 10.3.0 + '@sinonjs/fake-timers': 11.2.2 '@sinonjs/samsam': 8.0.0 diff: 5.2.0 - nise: 5.1.7 + nise: 6.0.0 supports-color: 7.2.0 sirv@2.0.4: From 2ccdaa3aaa6a73be736275b6f321a92849316a2b Mon Sep 17 00:00:00 2001 From: Flavien DELANGLE Date: Thu, 5 Sep 2024 14:53:22 +0200 Subject: [PATCH 2/2] [pickers] Move multi input range field validation tests to the describe test file (#14501) --- ...ltiInputDateRangeField.validation.test.tsx | 21 ------------------- ...escribes.MultiInputDateRangeField.test.tsx | 19 +++++++++++++++-- ...nputDateTimeRangeField.validation.test.tsx | 21 ------------------- ...ibes.MultiInputDateTimeRangeField.test.tsx | 19 +++++++++++++++-- ...ltiInputTimeRangeField.validation.test.tsx | 21 ------------------- ...escribes.MultiInputTimeRangeField.test.tsx | 19 +++++++++++++++-- 6 files changed, 51 insertions(+), 69 deletions(-) delete mode 100644 packages/x-date-pickers-pro/src/MultiInputDateRangeField/tests/MultiInputDateRangeField.validation.test.tsx delete mode 100644 packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/tests/MultiInputDateTimeRangeField.validation.test.tsx delete mode 100644 packages/x-date-pickers-pro/src/MultiInputTimeRangeField/tests/MultiInputTimeRangeField.validation.test.tsx diff --git a/packages/x-date-pickers-pro/src/MultiInputDateRangeField/tests/MultiInputDateRangeField.validation.test.tsx b/packages/x-date-pickers-pro/src/MultiInputDateRangeField/tests/MultiInputDateRangeField.validation.test.tsx deleted file mode 100644 index 8552a54ddb71d..0000000000000 --- a/packages/x-date-pickers-pro/src/MultiInputDateRangeField/tests/MultiInputDateRangeField.validation.test.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { MultiInputDateRangeField } from '@mui/x-date-pickers-pro/MultiInputDateRangeField'; -import { - createPickerRenderer, - adapterToUse, - describeRangeValidation, - setValueOnFieldInput, -} from 'test/utils/pickers'; - -describe('', () => { - const { render, clock } = createPickerRenderer({ clock: 'fake' }); - - describeRangeValidation(MultiInputDateRangeField, () => ({ - render, - clock, - componentFamily: 'field', - views: ['year', 'month', 'day'], - setValue: (value, { setEndDate } = {}) => { - setValueOnFieldInput(adapterToUse.format(value, 'keyboardDate'), setEndDate ? 1 : 0); - }, - })); -}); diff --git a/packages/x-date-pickers-pro/src/MultiInputDateRangeField/tests/describes.MultiInputDateRangeField.test.tsx b/packages/x-date-pickers-pro/src/MultiInputDateRangeField/tests/describes.MultiInputDateRangeField.test.tsx index 6ba21a354f09c..f9bc34a2c12b8 100644 --- a/packages/x-date-pickers-pro/src/MultiInputDateRangeField/tests/describes.MultiInputDateRangeField.test.tsx +++ b/packages/x-date-pickers-pro/src/MultiInputDateRangeField/tests/describes.MultiInputDateRangeField.test.tsx @@ -1,10 +1,15 @@ import * as React from 'react'; import { MultiInputDateRangeField } from '@mui/x-date-pickers-pro/MultiInputDateRangeField'; -import { createPickerRenderer } from 'test/utils/pickers'; +import { + adapterToUse, + createPickerRenderer, + describeRangeValidation, + setValueOnFieldInput, +} from 'test/utils/pickers'; import { describeConformance } from 'test/utils/describeConformance'; describe('', () => { - const { render } = createPickerRenderer(); + const { render, clock } = createPickerRenderer({ clock: 'fake' }); describeConformance(, () => ({ classes: {} as any, @@ -14,4 +19,14 @@ describe('', () => { refInstanceof: window.HTMLDivElement, skip: ['themeVariants', 'componentProp', 'componentsProp'], })); + + describeRangeValidation(MultiInputDateRangeField, () => ({ + render, + clock, + componentFamily: 'field', + views: ['year', 'month', 'day'], + setValue: (value, { setEndDate } = {}) => { + setValueOnFieldInput(adapterToUse.format(value, 'keyboardDate'), setEndDate ? 1 : 0); + }, + })); }); diff --git a/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/tests/MultiInputDateTimeRangeField.validation.test.tsx b/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/tests/MultiInputDateTimeRangeField.validation.test.tsx deleted file mode 100644 index 4fd962807ba7f..0000000000000 --- a/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/tests/MultiInputDateTimeRangeField.validation.test.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { MultiInputDateTimeRangeField } from '@mui/x-date-pickers-pro/MultiInputDateTimeRangeField'; -import { - createPickerRenderer, - adapterToUse, - describeRangeValidation, - setValueOnFieldInput, -} from 'test/utils/pickers'; - -describe('', () => { - const { render, clock } = createPickerRenderer({ clock: 'fake' }); - - describeRangeValidation(MultiInputDateTimeRangeField, () => ({ - render, - clock, - componentFamily: 'field', - views: ['year', 'month', 'day', 'hours', 'minutes'], - setValue: (value, { setEndDate } = {}) => { - setValueOnFieldInput(adapterToUse.format(value, 'keyboardDateTime'), setEndDate ? 1 : 0); - }, - })); -}); diff --git a/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/tests/describes.MultiInputDateTimeRangeField.test.tsx b/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/tests/describes.MultiInputDateTimeRangeField.test.tsx index 7bb1d6cc437b2..1ece3e03f1085 100644 --- a/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/tests/describes.MultiInputDateTimeRangeField.test.tsx +++ b/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/tests/describes.MultiInputDateTimeRangeField.test.tsx @@ -1,10 +1,15 @@ import * as React from 'react'; import { MultiInputDateTimeRangeField } from '@mui/x-date-pickers-pro/MultiInputDateTimeRangeField'; -import { createPickerRenderer } from 'test/utils/pickers'; +import { + adapterToUse, + createPickerRenderer, + describeRangeValidation, + setValueOnFieldInput, +} from 'test/utils/pickers'; import { describeConformance } from 'test/utils/describeConformance'; describe('', () => { - const { render } = createPickerRenderer(); + const { render, clock } = createPickerRenderer({ clock: 'fake' }); describeConformance(, () => ({ classes: {} as any, @@ -14,4 +19,14 @@ describe('', () => { refInstanceof: window.HTMLDivElement, skip: ['componentProp', 'componentsProp', 'themeVariants'], })); + + describeRangeValidation(MultiInputDateTimeRangeField, () => ({ + render, + clock, + componentFamily: 'field', + views: ['year', 'month', 'day', 'hours', 'minutes'], + setValue: (value, { setEndDate } = {}) => { + setValueOnFieldInput(adapterToUse.format(value, 'keyboardDateTime'), setEndDate ? 1 : 0); + }, + })); }); diff --git a/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/tests/MultiInputTimeRangeField.validation.test.tsx b/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/tests/MultiInputTimeRangeField.validation.test.tsx deleted file mode 100644 index a84da9d27b0a9..0000000000000 --- a/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/tests/MultiInputTimeRangeField.validation.test.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { MultiInputTimeRangeField } from '@mui/x-date-pickers-pro/MultiInputTimeRangeField'; -import { - createPickerRenderer, - adapterToUse, - describeRangeValidation, - setValueOnFieldInput, -} from 'test/utils/pickers'; - -describe('', () => { - const { render, clock } = createPickerRenderer({ clock: 'fake' }); - - describeRangeValidation(MultiInputTimeRangeField, () => ({ - render, - clock, - componentFamily: 'field', - views: ['hours', 'minutes'], - setValue: (value, { setEndDate } = {}) => { - setValueOnFieldInput(adapterToUse.format(value, 'fullTime'), setEndDate ? 1 : 0); - }, - })); -}); diff --git a/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/tests/describes.MultiInputTimeRangeField.test.tsx b/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/tests/describes.MultiInputTimeRangeField.test.tsx index 47047c3007d4c..16dff90eca731 100644 --- a/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/tests/describes.MultiInputTimeRangeField.test.tsx +++ b/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/tests/describes.MultiInputTimeRangeField.test.tsx @@ -1,10 +1,15 @@ import * as React from 'react'; import { MultiInputTimeRangeField } from '@mui/x-date-pickers-pro/MultiInputTimeRangeField'; -import { createPickerRenderer } from 'test/utils/pickers'; +import { + adapterToUse, + createPickerRenderer, + describeRangeValidation, + setValueOnFieldInput, +} from 'test/utils/pickers'; import { describeConformance } from 'test/utils/describeConformance'; describe('', () => { - const { render } = createPickerRenderer(); + const { render, clock } = createPickerRenderer({ clock: 'fake' }); describeConformance(, () => ({ classes: {} as any, @@ -14,4 +19,14 @@ describe('', () => { refInstanceof: window.HTMLDivElement, skip: ['themeVariants', 'componentProp', 'componentsProp'], })); + + describeRangeValidation(MultiInputTimeRangeField, () => ({ + render, + clock, + componentFamily: 'field', + views: ['hours', 'minutes'], + setValue: (value, { setEndDate } = {}) => { + setValueOnFieldInput(adapterToUse.format(value, 'fullTime'), setEndDate ? 1 : 0); + }, + })); });