From eff3bcad2c1624748f55b476336de62b4f1201f2 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Thu, 5 Sep 2024 20:17:59 +0200 Subject: [PATCH 001/119] vitest browser mode working charts --- package.json | 10 +- packages/x-charts/package.json | 2 +- .../src/BarChart/checkClickEvent.test.tsx | 2 - .../ChartsTooltip/contentDisplayed.test.tsx | 4 - .../src/LineChart/checkClickEvent.test.tsx | 4 - .../src/ScatterChart/checkClickEvent.test.tsx | 4 - .../useHighlighted.test.tsx | 4 +- .../x-charts/src/hooks/useSeries.test.tsx | 4 +- .../x-charts/src/hooks/useSvgRef.test.tsx | 4 +- pnpm-lock.yaml | 326 +++++++++++++++++- test/setup.ts | 4 + test/utils/checkMaterialVersion.ts | 37 +- vitest.config.ts | 30 ++ 13 files changed, 385 insertions(+), 50 deletions(-) create mode 100644 test/setup.ts create mode 100644 vitest.config.ts diff --git a/package.json b/package.json index 785d9395916a..a0edcd4946a1 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,8 @@ "release:publish:dry-run": "pnpm publish --recursive --tag latest --registry=\"http://localhost:4873/\"", "release:tag": "node scripts/releaseTag.mjs", "validate": "concurrently \"pnpm prettier && pnpm eslint\" \"pnpm proptypes\" \"pnpm docs:typescript:formatted\" \"pnpm docs:api\"", - "clean:node_modules": "rimraf --glob \"**/node_modules\"" + "clean:node_modules": "rimraf --glob \"**/node_modules\"", + "test:browser": "vitest" }, "devDependencies": { "@actions/core": "^1.10.1", @@ -92,7 +93,7 @@ "@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-test-utils": "file:../material-ui/packages-internal/test-utils", "@mui/material": "^5.16.7", "@mui/monorepo": "github:mui/material-ui#f8b2251c5bdfe4d81f56017e0423d265b242617d", "@mui/utils": "^5.16.6", @@ -100,6 +101,7 @@ "@octokit/plugin-retry": "^7.1.1", "@octokit/rest": "^21.0.2", "@playwright/test": "^1.44.1", + "@testing-library/react": "^16.0.1", "@types/babel__core": "^7.20.5", "@types/babel__traverse": "^7.20.6", "@types/chai": "^4.3.19", @@ -117,6 +119,8 @@ "@types/yargs": "^17.0.33", "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", + "@vitejs/plugin-react": "^4.3.1", + "@vitest/browser": "^2.0.5", "autoprefixer": "^10.4.20", "axe-core": "4.10.0", "babel-loader": "^9.1.3", @@ -175,6 +179,7 @@ "moment": "^2.30.1", "moment-timezone": "^0.5.45", "nyc": "^17.0.0", + "playwright": "^1.46.1", "prettier": "^3.3.3", "pretty-quick": "^4.0.0", "process": "^0.11.10", @@ -191,6 +196,7 @@ "typescript": "^5.5.4", "unist-util-visit": "^5.0.0", "util": "^0.12.5", + "vitest": "2.0.5", "webpack": "^5.94.0", "webpack-bundle-analyzer": "^4.10.2", "webpack-cli": "^5.1.4", diff --git a/packages/x-charts/package.json b/packages/x-charts/package.json index bf10d935f48c..4820fece785d 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": "file:../../../material-ui/packages-internal/test-utils", "@mui/material": "^5.16.7", "@mui/system": "^5.16.7", "@react-spring/core": "^9.7.4", diff --git a/packages/x-charts/src/BarChart/checkClickEvent.test.tsx b/packages/x-charts/src/BarChart/checkClickEvent.test.tsx index 7804217e7402..37105390e8c8 100644 --- a/packages/x-charts/src/BarChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/BarChart/checkClickEvent.test.tsx @@ -38,7 +38,6 @@ describe('BarChart - click event', () => { render(
{ render(
{ render(
{ render(
{ render(
{ render(
{ render(
{ render(
{ render(
{ render(
{ render(
{ render(
{ render(
{ render(
{ const { render } = createRenderer(); - it('should throw an error when parent context not present', function test() { + it('should throw an error when parent context not present', function test(t) { if (!/jsdom/.test(window.navigator.userAgent)) { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault - this.skip(); + t.skip(); } const errorRef = React.createRef(); diff --git a/packages/x-charts/src/hooks/useSeries.test.tsx b/packages/x-charts/src/hooks/useSeries.test.tsx index 4bbe16ff5cb6..470593407dd3 100644 --- a/packages/x-charts/src/hooks/useSeries.test.tsx +++ b/packages/x-charts/src/hooks/useSeries.test.tsx @@ -13,11 +13,11 @@ function UseSeries() { describe('useSeries', () => { const { render } = createRenderer(); - it('should throw an error when parent context not present', function test() { + it('should throw an error when parent context not present', function test(t) { if (!/jsdom/.test(window.navigator.userAgent)) { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault - this.skip(); + t.skip(); } const errorRef = React.createRef(); diff --git a/packages/x-charts/src/hooks/useSvgRef.test.tsx b/packages/x-charts/src/hooks/useSvgRef.test.tsx index ed345538cc14..bb8f02a41638 100644 --- a/packages/x-charts/src/hooks/useSvgRef.test.tsx +++ b/packages/x-charts/src/hooks/useSvgRef.test.tsx @@ -12,11 +12,11 @@ function UseSvgRef() { describe('useSvgRef', () => { const { render } = createRenderer(); - it('should throw an error when parent context not present', function test() { + it('should throw an error when parent context not present', function test(t) { if (!/jsdom/.test(window.navigator.userAgent)) { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault - this.skip(); + t.skip(); } const errorRef = React.createRef(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 63472d3a81be..51e3d3640501 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -93,8 +93,8 @@ importers: specifier: ^1.0.11 version: 1.0.11 '@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: file:../material-ui/packages-internal/test-utils + version: file:../material-ui/packages-internal/test-utils(@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) @@ -116,6 +116,9 @@ importers: '@playwright/test': specifier: ^1.44.1 version: 1.44.1 + '@testing-library/react': + specifier: ^16.0.1 + version: 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@types/babel__core': specifier: ^7.20.5 version: 7.20.5 @@ -167,6 +170,12 @@ importers: '@typescript-eslint/parser': specifier: ^7.18.0 version: 7.18.0(eslint@8.57.0)(typescript@5.5.4) + '@vitejs/plugin-react': + specifier: ^4.3.1 + version: 4.3.1(vite@5.3.4(@types/node@20.16.3)(terser@5.27.0)) + '@vitest/browser': + specifier: ^2.0.5 + version: 2.0.5(playwright@1.46.1)(typescript@5.5.4)(vitest@2.0.5) autoprefixer: specifier: ^10.4.20 version: 10.4.20(postcss@8.4.44) @@ -341,6 +350,9 @@ importers: nyc: specifier: ^17.0.0 version: 17.0.0 + playwright: + specifier: ^1.46.1 + version: 1.46.1 prettier: specifier: ^3.3.3 version: 3.3.3 @@ -389,6 +401,9 @@ importers: util: specifier: ^0.12.5 version: 0.12.5 + vitest: + specifier: 2.0.5 + version: 2.0.5(@types/node@20.16.3)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) webpack: specifier: ^5.94.0 version: 5.94.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) @@ -749,8 +764,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: file:../../../material-ui/packages-internal/test-utils + version: file:../material-ui/packages-internal/test-utils(@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) @@ -1601,7 +1616,7 @@ importers: devDependencies: '@codspeed/vitest-plugin': specifier: ^3.1.1 - version: 3.1.1(vite@5.3.4(@types/node@20.16.3)(terser@5.27.0))(vitest@2.0.5(@types/node@20.16.3)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0)) + version: 3.1.1(vite@5.3.4(@types/node@20.16.3)(terser@5.27.0))(vitest@2.0.5(@types/node@20.16.3)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0)) '@emotion/react': specifier: ^11.13.3 version: 11.13.3(@types/react@18.3.4)(react@18.3.1) @@ -1640,7 +1655,7 @@ importers: version: 18.3.1(react@18.3.1) vitest: specifier: 2.0.5 - version: 2.0.5(@types/node@20.16.3)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) + version: 2.0.5(@types/node@20.16.3)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) packages: @@ -2440,6 +2455,15 @@ packages: '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + '@bundled-es-modules/cookie@2.0.0': + resolution: {integrity: sha512-Or6YHg/kamKHpxULAdSqhGqnWFneIXu1NKvvfBBzKGwpVsYuFIQ5aBPHDnnoR3ghW1nvSkALd+EF9iMtY7Vjxw==} + + '@bundled-es-modules/statuses@1.0.1': + resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==} + + '@bundled-es-modules/tough-cookie@0.1.6': + resolution: {integrity: sha512-dvMHbL464C0zI+Yqxbz6kZ5TOEp7GLW+pry/RWndAR8MJQAXZ2rPmIs8tziTZjeIyhSNZgZbCePtfSbdWqStJw==} + '@codspeed/core@3.1.1': resolution: {integrity: sha512-ONhERVDAtkm0nc+FYPivDozoMOlNUP2BWRBFDJYATGA18Iap5Kd2mZ1/Lwz54RB5+g+3YDOpsvotHa4hd3Q+7Q==} @@ -3018,6 +3042,22 @@ packages: cpu: [x64] os: [win32] + '@inquirer/confirm@3.2.0': + resolution: {integrity: sha512-oOIwPs0Dvq5220Z8lGL/6LHRTEr9TgLHmiI99Rj1PJ1p1czTys+olrgBqZk4E2qC0YTzeHprxSQmoHioVdJ7Lw==} + engines: {node: '>=18'} + + '@inquirer/core@9.1.0': + resolution: {integrity: sha512-RZVfH//2ytTjmaBIzeKT1zefcQZzuruwkpTwwbe/i2jTl4o9M+iML5ChULzz6iw1Ok8iUBBsRCjY2IEbD8Ft4w==} + engines: {node: '>=18'} + + '@inquirer/figures@1.0.5': + resolution: {integrity: sha512-79hP/VWdZ2UVc9bFGJnoQ/lQMpL74mGgzSYX1xUqCVk7/v73vJCMw1VuyWN1jGkZ9B3z7THAbySqGbCNefcjfA==} + engines: {node: '>=18'} + + '@inquirer/type@1.5.3': + resolution: {integrity: sha512-xUQ14WQGR/HK5ei+2CvgcwoH9fQ4PgPGmVFSN0pc1+fVyDL3MREhyAY7nxEErSu6CkllBM3D7e3e+kOvtu+eIg==} + engines: {node: '>=18'} + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -3062,6 +3102,10 @@ packages: resolution: {integrity: sha512-wi72R01tgjBjzG2kjRyTHl4yCTKDfDMIXRyKz9E/FBa9SkFvUOAE4bdyY9MhEsRZmSWL7+CYE8Flv/HScRpBbA==} engines: {node: '>=18.0.0'} + '@mswjs/interceptors@0.29.1': + resolution: {integrity: sha512-3rDakgJZ77+RiQUuSK69t1F0m8BQKA8Vh5DCS5V0DWvNY67zob2JhhQrhCO0AKLGINTRSFd1tBaHcJTkhefoSw==} + engines: {node: '>=18'} + '@mui/base@5.0.0-beta.40': resolution: {integrity: sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==} engines: {node: '>=12.0.0'} @@ -3124,6 +3168,12 @@ packages: react: ^18.2.0 react-dom: ^18.2.0 + '@mui/internal-test-utils@file:../material-ui/packages-internal/test-utils': + resolution: {directory: ../material-ui/packages-internal/test-utils, type: directory} + peerDependencies: + react: ^18.2.0 + react-dom: ^18.2.0 + '@mui/joy@5.0.0-beta.48': resolution: {integrity: sha512-OhTvjuGl9I5IvpBr0BQyDehIW/xb2yteW6YglHJMdOb/279nItn76X1NBtPV9ImldNlBjReGwvpOXmBTTGER9w==} engines: {node: '>=12.0.0'} @@ -3680,6 +3730,15 @@ packages: '@octokit/types@9.3.2': resolution: {integrity: sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==} + '@open-draft/deferred-promise@2.2.0': + resolution: {integrity: sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==} + + '@open-draft/logger@0.3.0': + resolution: {integrity: sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==} + + '@open-draft/until@2.1.0': + resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} + '@opentelemetry/api@1.8.0': resolution: {integrity: sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w==} engines: {node: '>=8.0.0'} @@ -4056,6 +4115,9 @@ packages: '@types/cookie@0.4.1': resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} + '@types/cookie@0.6.0': + resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} + '@types/cors@2.8.17': resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} @@ -4179,6 +4241,9 @@ packages: '@types/moment-jalaali@0.7.9': resolution: {integrity: sha512-gsDOoAzRnCfQTbfdlUrCvX6R0wIto6CvwfvV2C3j4qJLK+DEiTK8Rl/xlOCBO9C6qeUfX8oyZ2UfjnXJTOvHSA==} + '@types/mute-stream@0.0.4': + resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} + '@types/node@20.16.3': resolution: {integrity: sha512-/wdGiWRkMOm53gAsSyFMXFZHbVg7C6CbkrzHNpaHoYfsUWPg7m6ZRKtvQjgvQ9i8WT540a3ydRlRQbxjY30XxQ==} @@ -4239,12 +4304,18 @@ packages: '@types/sinonjs__fake-timers@8.1.5': resolution: {integrity: sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==} + '@types/statuses@2.0.5': + resolution: {integrity: sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==} + '@types/stylis@4.2.5': resolution: {integrity: sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw==} '@types/stylis@4.2.6': resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} + '@types/tough-cookie@4.0.5': + resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} + '@types/tsscmp@1.0.2': resolution: {integrity: sha512-cy7BRSU8GYYgxjcx0Py+8lo5MthuDhlyu076KUcYzVNXL23luYgRHkMG2fIFEc6neckeh/ntP82mw+U4QjZq+g==} @@ -4257,6 +4328,9 @@ packages: '@types/webpack-bundle-analyzer@4.7.0': resolution: {integrity: sha512-c5i2ThslSNSG8W891BRvOd/RoCjI2zwph8maD22b1adtSns20j+0azDDMCK06DiVrzTgnwiDl5Ntmu1YRJw8Sg==} + '@types/wrap-ansi@3.0.0': + resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} + '@types/ws@7.4.7': resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} @@ -4365,6 +4439,21 @@ packages: peerDependencies: vite: ^4.2.0 || ^5.0.0 + '@vitest/browser@2.0.5': + resolution: {integrity: sha512-VbOYtu/6R3d7ASZREcrJmRY/sQuRFO9wMVsEDqfYbWiJRh2fDNi8CL1Csn7Ux31pOcPmmM5QvzFCMpiojvVh8g==} + peerDependencies: + playwright: '*' + safaridriver: '*' + vitest: 2.0.5 + webdriverio: '*' + peerDependenciesMeta: + playwright: + optional: true + safaridriver: + optional: true + webdriverio: + optional: true + '@vitest/expect@2.0.5': resolution: {integrity: sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==} @@ -5119,6 +5208,10 @@ packages: resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} engines: {node: '>= 10'} + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} @@ -6624,6 +6717,9 @@ packages: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true + headers-polyfill@4.0.3: + resolution: {integrity: sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==} + hermes-estree@0.20.1: resolution: {integrity: sha512-SQpZK4BzR48kuOg0v4pb3EAGNclzIlqMj3Opu/mu7bbAoFw6oig6cEt/RAi0zTFW/iW6Iz9X9ggGuZTAZ/yZHg==} @@ -6921,6 +7017,9 @@ packages: resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} engines: {node: '>= 0.4'} + is-node-process@1.2.0: + resolution: {integrity: sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==} + is-number-object@1.0.7: resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} engines: {node: '>= 0.4'} @@ -7849,6 +7948,19 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + msw@2.4.2: + resolution: {integrity: sha512-GImSQGhn19czhVpxPdiUDK8CMZ6jbBcvOhzfJd8KFErjEER2wDKWs1UYaetJs2GSNlAqt6heZYm7g3eLatTcog==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + graphql: '>= 16.8.x' + typescript: '>= 4.8.x' + peerDependenciesMeta: + graphql: + optional: true + typescript: + optional: true + multimatch@5.0.0: resolution: {integrity: sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==} engines: {node: '>=10'} @@ -7905,6 +8017,9 @@ packages: 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==} @@ -8147,6 +8262,9 @@ packages: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} + outvariant@1.4.3: + resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} + override-require@1.1.1: resolution: {integrity: sha512-eoJ9YWxFcXbrn2U8FKT6RV+/Kj7fiGAB1VvHzbYKt8xM5ZuKZgCGvnHzDxmreEjcBH28ejg5MiOH4iyY1mQnkg==} @@ -9114,6 +9232,9 @@ packages: 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==} engines: {node: '>= 10'} @@ -9247,6 +9368,9 @@ packages: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} + strict-event-emitter@0.5.1: + resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} + string-replace-loader@3.1.0: resolution: {integrity: sha512-5AOMUZeX5HE/ylKDnEa/KKBqvlnFmRZudSOjVJHxhoJg9QYTwl1rECx7SLR8BBH7tfxb4Rp7EM2XVfQFxIhsbQ==} peerDependencies: @@ -9640,6 +9764,10 @@ packages: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} + type-fest@4.26.0: + resolution: {integrity: sha512-OduNjVJsFbifKb57UqZ2EMP1i4u64Xwow3NYXUtBbD4vIwJdQd4+xl8YDou1dlm4DVrtwT/7Ky8z8WyCULVfxw==} + engines: {node: '>=16'} + type-is@1.6.18: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} engines: {node: '>= 0.6'} @@ -10179,6 +10307,10 @@ packages: resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} engines: {node: '>=12.20'} + yoctocolors-cjs@2.1.2: + resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} + engines: {node: '>=18'} + yoctocolors@2.0.2: resolution: {integrity: sha512-Ct97huExsu7cWeEjmrXlofevF8CvzUglJ4iGUet5B8xn1oumtAZBpHU4GzYuoE6PVqcZ5hghtBrSlhwHuR1Jmw==} engines: {node: '>=18'} @@ -11262,6 +11394,19 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} + '@bundled-es-modules/cookie@2.0.0': + dependencies: + cookie: 0.5.0 + + '@bundled-es-modules/statuses@1.0.1': + dependencies: + statuses: 2.0.1 + + '@bundled-es-modules/tough-cookie@0.1.6': + dependencies: + '@types/tough-cookie': 4.0.5 + tough-cookie: 4.1.4 + '@codspeed/core@3.1.1': dependencies: axios: 1.7.5(debug@4.3.6) @@ -11271,11 +11416,11 @@ snapshots: transitivePeerDependencies: - debug - '@codspeed/vitest-plugin@3.1.1(vite@5.3.4(@types/node@20.16.3)(terser@5.27.0))(vitest@2.0.5(@types/node@20.16.3)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0))': + '@codspeed/vitest-plugin@3.1.1(vite@5.3.4(@types/node@20.16.3)(terser@5.27.0))(vitest@2.0.5(@types/node@20.16.3)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0))': dependencies: '@codspeed/core': 3.1.1 vite: 5.3.4(@types/node@20.16.3)(terser@5.27.0) - vitest: 2.0.5(@types/node@20.16.3)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) + vitest: 2.0.5(@types/node@20.16.3)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) transitivePeerDependencies: - debug @@ -11722,6 +11867,33 @@ snapshots: '@img/sharp-win32-x64@0.33.5': optional: true + '@inquirer/confirm@3.2.0': + dependencies: + '@inquirer/core': 9.1.0 + '@inquirer/type': 1.5.3 + + '@inquirer/core@9.1.0': + dependencies: + '@inquirer/figures': 1.0.5 + '@inquirer/type': 1.5.3 + '@types/mute-stream': 0.0.4 + '@types/node': 20.16.3 + '@types/wrap-ansi': 3.0.0 + ansi-escapes: 4.3.2 + cli-spinners: 2.9.2 + cli-width: 4.1.0 + mute-stream: 1.0.0 + signal-exit: 4.1.0 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + yoctocolors-cjs: 2.1.2 + + '@inquirer/figures@1.0.5': {} + + '@inquirer/type@1.5.3': + dependencies: + mute-stream: 1.0.0 + '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -11852,6 +12024,15 @@ snapshots: - supports-color - typescript + '@mswjs/interceptors@0.29.1': + dependencies: + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/logger': 0.3.0 + '@open-draft/until': 2.1.0 + is-node-process: 1.2.0 + outvariant: 1.4.3 + strict-event-emitter: 0.5.1 + '@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)': dependencies: '@babel/runtime': 7.25.6 @@ -11960,6 +12141,39 @@ snapshots: - supports-color - utf-8-validate + '@mui/internal-test-utils@file:../material-ui/packages-internal/test-utils(@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) + '@babel/register': 7.24.6(@babel/core@7.25.2) + '@babel/runtime': 7.25.6 + '@emotion/cache': 11.13.1 + '@emotion/react': 11.13.3(@types/react@18.3.4)(react@18.3.1) + '@testing-library/dom': 10.4.0 + '@testing-library/react': 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) + chai: 4.5.0 + chai-dom: 1.12.0(chai@4.5.0) + dom-accessibility-api: 0.7.0 + format-util: 1.0.5 + fs-extra: 11.2.0 + jsdom: 24.1.3 + lodash: 4.17.21 + mocha: 10.7.3 + playwright: 1.46.1 + prop-types: 15.8.1 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + sinon: 18.0.0 + transitivePeerDependencies: + - '@babel/core' + - '@types/react' + - '@types/react-dom' + - bufferutil + - canvas + - supports-color + - utf-8-validate + '@mui/joy@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)': dependencies: '@babel/runtime': 7.25.6 @@ -12640,6 +12854,15 @@ snapshots: dependencies: '@octokit/openapi-types': 18.1.1 + '@open-draft/deferred-promise@2.2.0': {} + + '@open-draft/logger@0.3.0': + dependencies: + is-node-process: 1.2.0 + outvariant: 1.4.3 + + '@open-draft/until@2.1.0': {} + '@opentelemetry/api@1.8.0': optional: true @@ -13022,6 +13245,8 @@ snapshots: '@types/cookie@0.4.1': {} + '@types/cookie@0.6.0': {} + '@types/cors@2.8.17': dependencies: '@types/node': 20.16.3 @@ -13148,6 +13373,10 @@ snapshots: dependencies: moment: 2.30.1 + '@types/mute-stream@0.0.4': + dependencies: + '@types/node': 20.16.3 + '@types/node@20.16.3': dependencies: undici-types: 6.19.8 @@ -13215,10 +13444,14 @@ snapshots: '@types/sinonjs__fake-timers@8.1.5': {} + '@types/statuses@2.0.5': {} + '@types/stylis@4.2.5': {} '@types/stylis@4.2.6': {} + '@types/tough-cookie@4.0.5': {} + '@types/tsscmp@1.0.2': {} '@types/unist@2.0.10': {} @@ -13236,6 +13469,8 @@ snapshots: - uglify-js - webpack-cli + '@types/wrap-ansi@3.0.0': {} + '@types/ws@7.4.7': dependencies: '@types/node': 20.16.3 @@ -13388,6 +13623,24 @@ snapshots: transitivePeerDependencies: - supports-color + '@vitest/browser@2.0.5(playwright@1.46.1)(typescript@5.5.4)(vitest@2.0.5)': + dependencies: + '@testing-library/dom': 10.4.0 + '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) + '@vitest/utils': 2.0.5 + magic-string: 0.30.10 + msw: 2.4.2(typescript@5.5.4) + sirv: 2.0.4 + vitest: 2.0.5(@types/node@20.16.3)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) + ws: 8.18.0 + optionalDependencies: + playwright: 1.46.1 + transitivePeerDependencies: + - bufferutil + - graphql + - typescript + - utf-8-validate + '@vitest/expect@2.0.5': dependencies: '@vitest/spy': 2.0.5 @@ -13423,7 +13676,7 @@ snapshots: pathe: 1.1.2 sirv: 2.0.4 tinyrainbow: 1.2.0 - vitest: 2.0.5(@types/node@20.16.3)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) + vitest: 2.0.5(@types/node@20.16.3)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) '@vitest/utils@2.0.5': dependencies: @@ -14299,6 +14552,8 @@ snapshots: cli-width@3.0.0: {} + cli-width@4.1.0: {} + client-only@0.0.1: {} clipboard-copy@4.0.1: {} @@ -16203,6 +16458,8 @@ snapshots: he@1.2.0: {} + headers-polyfill@4.0.3: {} + hermes-estree@0.20.1: {} hermes-parser@0.20.1: @@ -16508,6 +16765,8 @@ snapshots: is-negative-zero@2.0.3: {} + is-node-process@1.2.0: {} + is-number-object@1.0.7: dependencies: has-tostringtag: 1.0.2 @@ -17624,6 +17883,27 @@ snapshots: ms@2.1.3: {} + msw@2.4.2(typescript@5.5.4): + dependencies: + '@bundled-es-modules/cookie': 2.0.0 + '@bundled-es-modules/statuses': 1.0.1 + '@bundled-es-modules/tough-cookie': 0.1.6 + '@inquirer/confirm': 3.2.0 + '@mswjs/interceptors': 0.29.1 + '@open-draft/until': 2.1.0 + '@types/cookie': 0.6.0 + '@types/statuses': 2.0.5 + chalk: 4.1.2 + headers-polyfill: 4.0.3 + is-node-process: 1.2.0 + outvariant: 1.4.3 + path-to-regexp: 6.2.1 + strict-event-emitter: 0.5.1 + type-fest: 4.26.0 + yargs: 17.7.2 + optionalDependencies: + typescript: 5.5.4 + multimatch@5.0.0: dependencies: '@types/minimatch': 3.0.5 @@ -17692,6 +17972,14 @@ snapshots: just-extend: 6.2.0 path-to-regexp: 6.2.1 + nise@6.0.0: + dependencies: + '@sinonjs/commons': 3.0.1 + '@sinonjs/fake-timers': 11.2.2 + '@sinonjs/text-encoding': 0.7.2 + just-extend: 6.2.0 + path-to-regexp: 6.2.1 + no-case@3.0.4: dependencies: lower-case: 2.0.2 @@ -18052,6 +18340,8 @@ snapshots: os-tmpdir@1.0.2: {} + outvariant@1.4.3: {} + override-require@1.1.1: {} p-event@5.0.1: @@ -19108,6 +19398,15 @@ snapshots: nise: 5.1.7 supports-color: 7.2.0 + sinon@18.0.0: + dependencies: + '@sinonjs/commons': 3.0.1 + '@sinonjs/fake-timers': 11.2.2 + '@sinonjs/samsam': 8.0.0 + diff: 5.2.0 + nise: 6.0.0 + supports-color: 7.2.0 + sirv@2.0.4: dependencies: '@polka/url': 1.0.0-next.24 @@ -19258,6 +19557,8 @@ snapshots: streamsearch@1.1.0: {} + strict-event-emitter@0.5.1: {} + string-replace-loader@3.1.0(webpack@5.94.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4)): dependencies: loader-utils: 2.0.4 @@ -19635,6 +19936,8 @@ snapshots: type-fest@2.19.0: {} + type-fest@4.26.0: {} + type-is@1.6.18: dependencies: media-typer: 0.3.0 @@ -19881,7 +20184,7 @@ snapshots: fsevents: 2.3.3 terser: 5.27.0 - vitest@2.0.5(@types/node@20.16.3)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0): + vitest@2.0.5(@types/node@20.16.3)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0): dependencies: '@ampproject/remapping': 2.3.0 '@vitest/expect': 2.0.5 @@ -19904,6 +20207,7 @@ snapshots: why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.16.3 + '@vitest/browser': 2.0.5(playwright@1.46.1)(typescript@5.5.4)(vitest@2.0.5) '@vitest/ui': 2.0.5(vitest@2.0.5) jsdom: 24.1.3 transitivePeerDependencies: @@ -20243,6 +20547,8 @@ snapshots: yocto-queue@1.0.0: {} + yoctocolors-cjs@2.1.2: {} + yoctocolors@2.0.2: {} zip-stream@4.1.1: diff --git a/test/setup.ts b/test/setup.ts new file mode 100644 index 000000000000..8a44b4080aa5 --- /dev/null +++ b/test/setup.ts @@ -0,0 +1,4 @@ +import { beforeAll, afterAll } from 'vitest'; + +globalThis.before = beforeAll; +globalThis.after = afterAll; diff --git a/test/utils/checkMaterialVersion.ts b/test/utils/checkMaterialVersion.ts index 9ebaa81b7d6c..ab98432ffc6e 100644 --- a/test/utils/checkMaterialVersion.ts +++ b/test/utils/checkMaterialVersion.ts @@ -7,8 +7,6 @@ type PackageJson = { version: string; }; -const isJSDOM = /jsdom/.test(window.navigator.userAgent); - export function checkMaterialVersion({ packageJson, materialPackageJson, @@ -16,25 +14,30 @@ export function checkMaterialVersion({ packageJson: PackageJson & { devDependencies: { '@mui/material': string } }; materialPackageJson: PackageJson; }) { - if (!isJSDOM) { - return undefined; - } + return it(`${packageJson.name} should resolve proper @mui/material version`, (t) => { + const isJSDOM = /jsdom/.test(window.navigator.userAgent); - const expectedVersion = packageJson.devDependencies['@mui/material']; + if (!isJSDOM) { + return t.skip(); + } - const versions = childProcess.execSync(`npm dist-tag ls ${'@mui/material'} ${expectedVersion}`, { - encoding: 'utf8', - }); - const tagMapping = versions - .split('\n') - .find((mapping) => { - return mapping.startsWith(`${expectedVersion}: `); - }) - ?.split(': ')[1]; + const expectedVersion = packageJson.devDependencies['@mui/material']; + + const versions = childProcess.execSync( + `npm dist-tag ls ${'@mui/material'} ${expectedVersion}`, + { + encoding: 'utf8', + }, + ); + const tagMapping = versions + .split('\n') + .find((mapping) => { + return mapping.startsWith(`${expectedVersion}: `); + }) + ?.split(': ')[1]; - const version = tagMapping ?? expectedVersion; + const version = tagMapping ?? expectedVersion; - return it(`${packageJson.name} should resolve proper @mui/material version`, () => { expect(semver.satisfies(materialPackageJson.version, version)).to.equal( true, `Expected @mui/material ${version}, but found ${materialPackageJson.version}`, diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 000000000000..74c986ca6bd8 --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,30 @@ +import { defineConfig } from 'vitest/config'; +import react from '@vitejs/plugin-react'; + +export default defineConfig({ + plugins: [react()], + test: { + include: ['packages/x-charts/**/*.test.tsx'], + alias: [ + { + find: '@mui/x-charts', + replacement: new URL('./packages/x-charts/src', import.meta.url).pathname, + }, + { + find: 'test/utils', + replacement: new URL('./test/utils', import.meta.url).pathname, + }, + ], + globals: true, + setupFiles: ['test/setup.ts'], + browser: { + enabled: true, + name: 'chromium', + provider: 'playwright', + headless: true, + // https://playwright.dev + providerOptions: {}, + screenshotFailures: false, + }, + }, +}); From 9a6cbf812c4a20a28084f02dc49d05eaa42e4efa Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 6 Sep 2024 01:34:07 +0200 Subject: [PATCH 002/119] Fix mocha + vitest --- .../src/context/HighlightedProvider/useHighlighted.test.tsx | 3 ++- packages/x-charts/src/hooks/useSeries.test.tsx | 3 ++- packages/x-charts/src/hooks/useSvgRef.test.tsx | 3 ++- test/utils/checkMaterialVersion.ts | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/x-charts/src/context/HighlightedProvider/useHighlighted.test.tsx b/packages/x-charts/src/context/HighlightedProvider/useHighlighted.test.tsx index 69884f062018..a388a169c416 100644 --- a/packages/x-charts/src/context/HighlightedProvider/useHighlighted.test.tsx +++ b/packages/x-charts/src/context/HighlightedProvider/useHighlighted.test.tsx @@ -14,10 +14,11 @@ function UseHighlighted() { describe('useHighlighted', () => { const { render } = createRenderer(); - it('should throw an error when parent context not present', function test(t) { + it('should throw an error when parent context not present', function test(t = {}) { if (!/jsdom/.test(window.navigator.userAgent)) { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault + // @ts-expect-error to support mocha and vitest t.skip(); } diff --git a/packages/x-charts/src/hooks/useSeries.test.tsx b/packages/x-charts/src/hooks/useSeries.test.tsx index 470593407dd3..a7ad7656be5a 100644 --- a/packages/x-charts/src/hooks/useSeries.test.tsx +++ b/packages/x-charts/src/hooks/useSeries.test.tsx @@ -13,10 +13,11 @@ function UseSeries() { describe('useSeries', () => { const { render } = createRenderer(); - it('should throw an error when parent context not present', function test(t) { + it('should throw an error when parent context not present', function test(t = {}) { if (!/jsdom/.test(window.navigator.userAgent)) { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault + // @ts-expect-error to support mocha and vitest t.skip(); } diff --git a/packages/x-charts/src/hooks/useSvgRef.test.tsx b/packages/x-charts/src/hooks/useSvgRef.test.tsx index bb8f02a41638..567e3f27ecfe 100644 --- a/packages/x-charts/src/hooks/useSvgRef.test.tsx +++ b/packages/x-charts/src/hooks/useSvgRef.test.tsx @@ -12,10 +12,11 @@ function UseSvgRef() { describe('useSvgRef', () => { const { render } = createRenderer(); - it('should throw an error when parent context not present', function test(t) { + it('should throw an error when parent context not present', function test(t = {}) { if (!/jsdom/.test(window.navigator.userAgent)) { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault + // @ts-expect-error to support mocha and vitest t.skip(); } diff --git a/test/utils/checkMaterialVersion.ts b/test/utils/checkMaterialVersion.ts index ab98432ffc6e..8a0464571b7f 100644 --- a/test/utils/checkMaterialVersion.ts +++ b/test/utils/checkMaterialVersion.ts @@ -14,11 +14,12 @@ export function checkMaterialVersion({ packageJson: PackageJson & { devDependencies: { '@mui/material': string } }; materialPackageJson: PackageJson; }) { - return it(`${packageJson.name} should resolve proper @mui/material version`, (t) => { + return it(`${packageJson.name} should resolve proper @mui/material version`, (t = {}) => { const isJSDOM = /jsdom/.test(window.navigator.userAgent); if (!isJSDOM) { - return t.skip(); + // @ts-expect-error to support mocha and vitest + t.skip(); } const expectedVersion = packageJson.devDependencies['@mui/material']; From 4a27d05e52b9d7753696697f47c99f8b9cfba206 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 6 Sep 2024 01:45:47 +0200 Subject: [PATCH 003/119] push runnable change --- package.json | 2 +- packages/x-charts/package.json | 2 +- pnpm-lock.yaml | 15 ++++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index cc9b1a967147..1dab20a7cd44 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@mui/icons-material": "^5.16.7", "@mui/internal-babel-plugin-resolve-imports": "1.0.17", "@mui/internal-markdown": "^1.0.12", - "@mui/internal-test-utils": "file:../material-ui/packages-internal/test-utils", + "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils", "@mui/material": "^5.16.7", "@mui/monorepo": "github:mui/material-ui#f8b2251c5bdfe4d81f56017e0423d265b242617d", "@mui/utils": "^5.16.6", diff --git a/packages/x-charts/package.json b/packages/x-charts/package.json index 9233d11d2abb..c4b51656cf5a 100644 --- a/packages/x-charts/package.json +++ b/packages/x-charts/package.json @@ -65,7 +65,7 @@ } }, "devDependencies": { - "@mui/internal-test-utils": "file:../../../material-ui/packages-internal/test-utils", + "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils", "@mui/material": "^5.16.7", "@mui/system": "^5.16.7", "@react-spring/core": "^9.7.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index be8220183536..3b3d98204880 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -93,8 +93,8 @@ importers: specifier: ^1.0.12 version: 1.0.12 '@mui/internal-test-utils': - specifier: file:../material-ui/packages-internal/test-utils - version: file:../material-ui/packages-internal/test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils(@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) @@ -764,8 +764,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: file:../../../material-ui/packages-internal/test-utils - version: file:../material-ui/packages-internal/test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils(@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) @@ -3168,8 +3168,9 @@ packages: react: ^18.2.0 react-dom: ^18.2.0 - '@mui/internal-test-utils@file:../material-ui/packages-internal/test-utils': - resolution: {directory: ../material-ui/packages-internal/test-utils, type: directory} + '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils': + resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils} + version: 1.0.12 peerDependencies: react: ^18.2.0 react-dom: ^18.2.0 @@ -12132,7 +12133,7 @@ snapshots: - supports-color - utf-8-validate - '@mui/internal-test-utils@file:../material-ui/packages-internal/test-utils(@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@https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils(@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) From fb7c2dee6abd92302369b4868006579b6f5a5acf Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 6 Sep 2024 10:41:12 +0200 Subject: [PATCH 004/119] mocha vs vitest --- .../src/context/HighlightedProvider/useHighlighted.test.tsx | 3 ++- packages/x-charts/src/hooks/useSeries.test.tsx | 3 ++- packages/x-charts/src/hooks/useSvgRef.test.tsx | 3 ++- test/utils/checkMaterialVersion.ts | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/x-charts/src/context/HighlightedProvider/useHighlighted.test.tsx b/packages/x-charts/src/context/HighlightedProvider/useHighlighted.test.tsx index a388a169c416..635a8978279f 100644 --- a/packages/x-charts/src/context/HighlightedProvider/useHighlighted.test.tsx +++ b/packages/x-charts/src/context/HighlightedProvider/useHighlighted.test.tsx @@ -19,7 +19,8 @@ describe('useHighlighted', () => { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault // @ts-expect-error to support mocha and vitest - t.skip(); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const errorRef = React.createRef(); diff --git a/packages/x-charts/src/hooks/useSeries.test.tsx b/packages/x-charts/src/hooks/useSeries.test.tsx index a7ad7656be5a..31e183f16652 100644 --- a/packages/x-charts/src/hooks/useSeries.test.tsx +++ b/packages/x-charts/src/hooks/useSeries.test.tsx @@ -18,7 +18,8 @@ describe('useSeries', () => { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault // @ts-expect-error to support mocha and vitest - t.skip(); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const errorRef = React.createRef(); diff --git a/packages/x-charts/src/hooks/useSvgRef.test.tsx b/packages/x-charts/src/hooks/useSvgRef.test.tsx index 567e3f27ecfe..57a78cba8485 100644 --- a/packages/x-charts/src/hooks/useSvgRef.test.tsx +++ b/packages/x-charts/src/hooks/useSvgRef.test.tsx @@ -17,7 +17,8 @@ describe('useSvgRef', () => { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault // @ts-expect-error to support mocha and vitest - t.skip(); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const errorRef = React.createRef(); diff --git a/test/utils/checkMaterialVersion.ts b/test/utils/checkMaterialVersion.ts index 8a0464571b7f..48e7138577c2 100644 --- a/test/utils/checkMaterialVersion.ts +++ b/test/utils/checkMaterialVersion.ts @@ -19,7 +19,8 @@ export function checkMaterialVersion({ if (!isJSDOM) { // @ts-expect-error to support mocha and vitest - t.skip(); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const expectedVersion = packageJson.devDependencies['@mui/material']; From 118a5322c7de7ca15ae11060ccfa74c80c72bb32 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 6 Sep 2024 10:57:11 +0200 Subject: [PATCH 005/119] Remove playwright direct dep --- package.json | 1 - pnpm-lock.yaml | 3 --- 2 files changed, 4 deletions(-) diff --git a/package.json b/package.json index 1dab20a7cd44..f3b3d3fb020e 100644 --- a/package.json +++ b/package.json @@ -179,7 +179,6 @@ "moment": "^2.30.1", "moment-timezone": "^0.5.45", "nyc": "^17.0.0", - "playwright": "^1.46.1", "prettier": "^3.3.3", "pretty-quick": "^4.0.0", "process": "^0.11.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3b3d98204880..3982ae4c2daa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -350,9 +350,6 @@ importers: nyc: specifier: ^17.0.0 version: 17.0.0 - playwright: - specifier: ^1.46.1 - version: 1.46.1 prettier: specifier: ^3.3.3 version: 3.3.3 From 33293ca261aef69fc0f700f45f24a4d624554ed5 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 6 Sep 2024 11:17:09 +0200 Subject: [PATCH 006/119] try normalizing container --- packages/x-charts/src/BarChart/checkClickEvent.test.tsx | 6 ++++++ packages/x-charts/src/LineChart/checkClickEvent.test.tsx | 6 ++++++ packages/x-charts/src/PieChart/checkClickEvent.test.tsx | 6 ++++++ packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx | 6 ++++++ test/utils/checkMaterialVersion.ts | 2 +- 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/x-charts/src/BarChart/checkClickEvent.test.tsx b/packages/x-charts/src/BarChart/checkClickEvent.test.tsx index 37105390e8c8..d652c3fda3f7 100644 --- a/packages/x-charts/src/BarChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/BarChart/checkClickEvent.test.tsx @@ -28,6 +28,12 @@ const isJSDOM = /jsdom/.test(window.navigator.userAgent); describe('BarChart - click event', () => { const { render } = createRenderer(); + beforeEach(() => { + if (window?.document?.body?.style?.margin) { + window.document.body.style.margin = '0'; + } + }); + describe('onAxisClick', () => { it('should provide the right context as second argument', function test() { if (isJSDOM) { diff --git a/packages/x-charts/src/LineChart/checkClickEvent.test.tsx b/packages/x-charts/src/LineChart/checkClickEvent.test.tsx index 9741c11a4b3e..bf863fcce9d7 100644 --- a/packages/x-charts/src/LineChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/LineChart/checkClickEvent.test.tsx @@ -22,6 +22,12 @@ const isJSDOM = /jsdom/.test(window.navigator.userAgent); describe('LineChart - click event', () => { const { render } = createRenderer(); + beforeEach(() => { + if (window?.document?.body?.style?.margin) { + window.document.body.style.margin = '0'; + } + }); + describe('onAxisClick', () => { it('should provide the right context as second argument', function test() { if (isJSDOM) { diff --git a/packages/x-charts/src/PieChart/checkClickEvent.test.tsx b/packages/x-charts/src/PieChart/checkClickEvent.test.tsx index bc5f72d36874..da0c8fec56ad 100644 --- a/packages/x-charts/src/PieChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/PieChart/checkClickEvent.test.tsx @@ -12,6 +12,12 @@ const config = { describe('PieChart - click event', () => { const { render } = createRenderer(); + beforeEach(() => { + if (window?.document?.body?.style?.margin) { + window.document.body.style.margin = '0'; + } + }); + describe('onItemClick', () => { it('should add cursor="pointer" to bar elements', function test() { render( diff --git a/packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx b/packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx index 39d0d4f29f8e..6ab685e130e5 100644 --- a/packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx @@ -30,6 +30,12 @@ const isJSDOM = /jsdom/.test(window.navigator.userAgent); describe('ScatterChart - click event', () => { const { render } = createRenderer(); + beforeEach(() => { + if (window?.document?.body?.style?.margin) { + window.document.body.style.margin = '0'; + } + }); + describe('onItemClick - using vornoid', () => { it('should provide the right context as second argument when clicking svg', function test() { if (isJSDOM) { diff --git a/test/utils/checkMaterialVersion.ts b/test/utils/checkMaterialVersion.ts index 48e7138577c2..24eff46507cc 100644 --- a/test/utils/checkMaterialVersion.ts +++ b/test/utils/checkMaterialVersion.ts @@ -14,7 +14,7 @@ export function checkMaterialVersion({ packageJson: PackageJson & { devDependencies: { '@mui/material': string } }; materialPackageJson: PackageJson; }) { - return it(`${packageJson.name} should resolve proper @mui/material version`, (t = {}) => { + return it(`${packageJson.name} should resolve proper @mui/material version`, function test(t = {}) { const isJSDOM = /jsdom/.test(window.navigator.userAgent); if (!isJSDOM) { From d14ad465218a8462c6d2c3acf97f1af881b1f7dd Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 6 Sep 2024 12:02:44 +0200 Subject: [PATCH 007/119] try clearing the body margin --- .../x-charts/src/BarChart/checkClickEvent.test.tsx | 8 +++++++- .../src/ChartsTooltip/contentDisplayed.test.tsx | 12 ++++++++++++ .../x-charts/src/LineChart/checkClickEvent.test.tsx | 8 +++++++- .../x-charts/src/PieChart/checkClickEvent.test.tsx | 8 +++++++- .../src/ScatterChart/checkClickEvent.test.tsx | 8 +++++++- 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/packages/x-charts/src/BarChart/checkClickEvent.test.tsx b/packages/x-charts/src/BarChart/checkClickEvent.test.tsx index d652c3fda3f7..53ee5512bdc9 100644 --- a/packages/x-charts/src/BarChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/BarChart/checkClickEvent.test.tsx @@ -29,11 +29,17 @@ describe('BarChart - click event', () => { const { render } = createRenderer(); beforeEach(() => { - if (window?.document?.body?.style?.margin) { + if (window?.document?.body?.style) { window.document.body.style.margin = '0'; } }); + afterEach(() => { + if (window?.document?.body?.style) { + window.document.body.style.margin = '8px'; + } + }); + describe('onAxisClick', () => { it('should provide the right context as second argument', function test() { if (isJSDOM) { diff --git a/packages/x-charts/src/ChartsTooltip/contentDisplayed.test.tsx b/packages/x-charts/src/ChartsTooltip/contentDisplayed.test.tsx index 38a3b02a53ce..eba159d66fe7 100644 --- a/packages/x-charts/src/ChartsTooltip/contentDisplayed.test.tsx +++ b/packages/x-charts/src/ChartsTooltip/contentDisplayed.test.tsx @@ -27,6 +27,18 @@ const isJSDOM = /jsdom/.test(window.navigator.userAgent); describe('ChartsTooltip', () => { const { render } = createRenderer(); + beforeEach(() => { + if (window?.document?.body?.style) { + window.document.body.style.margin = '0'; + } + }); + + afterEach(() => { + if (window?.document?.body?.style) { + window.document.body.style.margin = '8px'; + } + }); + describe('axis trigger', () => { it('should show right values with vertical layout', function test() { if (isJSDOM) { diff --git a/packages/x-charts/src/LineChart/checkClickEvent.test.tsx b/packages/x-charts/src/LineChart/checkClickEvent.test.tsx index bf863fcce9d7..9386ec1553b5 100644 --- a/packages/x-charts/src/LineChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/LineChart/checkClickEvent.test.tsx @@ -23,11 +23,17 @@ describe('LineChart - click event', () => { const { render } = createRenderer(); beforeEach(() => { - if (window?.document?.body?.style?.margin) { + if (window?.document?.body?.style) { window.document.body.style.margin = '0'; } }); + afterEach(() => { + if (window?.document?.body?.style) { + window.document.body.style.margin = '8px'; + } + }); + describe('onAxisClick', () => { it('should provide the right context as second argument', function test() { if (isJSDOM) { diff --git a/packages/x-charts/src/PieChart/checkClickEvent.test.tsx b/packages/x-charts/src/PieChart/checkClickEvent.test.tsx index da0c8fec56ad..e44fe4aa27dc 100644 --- a/packages/x-charts/src/PieChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/PieChart/checkClickEvent.test.tsx @@ -13,11 +13,17 @@ describe('PieChart - click event', () => { const { render } = createRenderer(); beforeEach(() => { - if (window?.document?.body?.style?.margin) { + if (window?.document?.body?.style) { window.document.body.style.margin = '0'; } }); + afterEach(() => { + if (window?.document?.body?.style) { + window.document.body.style.margin = '8px'; + } + }); + describe('onItemClick', () => { it('should add cursor="pointer" to bar elements', function test() { render( diff --git a/packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx b/packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx index 6ab685e130e5..0aba715490d8 100644 --- a/packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx @@ -31,11 +31,17 @@ describe('ScatterChart - click event', () => { const { render } = createRenderer(); beforeEach(() => { - if (window?.document?.body?.style?.margin) { + if (window?.document?.body?.style) { window.document.body.style.margin = '0'; } }); + afterEach(() => { + if (window?.document?.body?.style) { + window.document.body.style.margin = '8px'; + } + }); + describe('onItemClick - using vornoid', () => { it('should provide the right context as second argument when clicking svg', function test() { if (isJSDOM) { From d39f9e4f2dc95de37fe84661b055e01274b27a1e Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 13:18:42 +0200 Subject: [PATCH 008/119] Fix new tests --- .../src/BarChart/checkClickEvent.test.tsx | 18 +++++++++----- .../ChartsTooltip/contentDisplayed.test.tsx | 24 ++++++++++++------- .../src/LineChart/checkClickEvent.test.tsx | 24 ++++++++++++------- .../src/ScatterChart/checkClickEvent.test.tsx | 24 ++++++++++++------- 4 files changed, 60 insertions(+), 30 deletions(-) diff --git a/packages/x-charts/src/BarChart/checkClickEvent.test.tsx b/packages/x-charts/src/BarChart/checkClickEvent.test.tsx index 0a4c1fd3a769..fb69c8da3ad5 100644 --- a/packages/x-charts/src/BarChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/BarChart/checkClickEvent.test.tsx @@ -41,10 +41,12 @@ describe('BarChart - click event', () => { }); describe('onAxisClick', () => { - it('should provide the right context as second argument', function test() { + it('should provide the right context as second argument', function test(t = {}) { if (isJSDOM) { // can't do Pointer event with JSDom https://github.com/jsdom/jsdom/issues/2527 - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onAxisClick = spy(); render( @@ -92,10 +94,12 @@ describe('BarChart - click event', () => { }); }); - it('should provide the right context as second argument with layout="horizontal"', function test() { + it('should provide the right context as second argument with layout="horizontal"', function test(t = {}) { if (isJSDOM) { // can't do Pointer event with JSDom https://github.com/jsdom/jsdom/issues/2527 - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onAxisClick = spy(); render( @@ -166,10 +170,12 @@ describe('BarChart - click event', () => { ).to.deep.equal(['pointer', 'pointer', 'pointer', 'pointer']); }); - it('should provide the right context as second argument', function test() { + it('should provide the right context as second argument', function test(t = {}) { if (isJSDOM) { // can't do Pointer event with JSDom https://github.com/jsdom/jsdom/issues/2527 - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onItemClick = spy(); render( diff --git a/packages/x-charts/src/ChartsTooltip/contentDisplayed.test.tsx b/packages/x-charts/src/ChartsTooltip/contentDisplayed.test.tsx index eba159d66fe7..61d668a20366 100644 --- a/packages/x-charts/src/ChartsTooltip/contentDisplayed.test.tsx +++ b/packages/x-charts/src/ChartsTooltip/contentDisplayed.test.tsx @@ -40,10 +40,12 @@ describe('ChartsTooltip', () => { }); describe('axis trigger', () => { - it('should show right values with vertical layout', function test() { + it('should show right values with vertical layout', function test(t = {}) { if (isJSDOM) { // can't do Pointer event with JSDom https://github.com/jsdom/jsdom/issues/2527 - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -104,10 +106,12 @@ describe('ChartsTooltip', () => { ]); }); - it('should show right values with horizontal layout', function test() { + it('should show right values with horizontal layout', function test(t = {}) { if (isJSDOM) { // can't do Pointer event with JSDom https://github.com/jsdom/jsdom/issues/2527 - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -171,10 +175,12 @@ describe('ChartsTooltip', () => { }); describe('item trigger', () => { - it('should show right values with vertical layout', function test() { + it('should show right values with vertical layout', function test(t = {}) { if (isJSDOM) { // can't do Pointer event with JSDom https://github.com/jsdom/jsdom/issues/2527 - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -213,10 +219,12 @@ describe('ChartsTooltip', () => { expect([...cells].map((cell) => cell.textContent)).to.deep.equal(['', 'S2', '1']); }); - it('should show right values with horizontal layout', function test() { + it('should show right values with horizontal layout', function test(t = {}) { if (isJSDOM) { // can't do Pointer event with JSDom https://github.com/jsdom/jsdom/issues/2527 - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( diff --git a/packages/x-charts/src/LineChart/checkClickEvent.test.tsx b/packages/x-charts/src/LineChart/checkClickEvent.test.tsx index 9386ec1553b5..1709e3647064 100644 --- a/packages/x-charts/src/LineChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/LineChart/checkClickEvent.test.tsx @@ -35,10 +35,12 @@ describe('LineChart - click event', () => { }); describe('onAxisClick', () => { - it('should provide the right context as second argument', function test() { + it('should provide the right context as second argument', function test(t = {}) { if (isJSDOM) { // can't do Pointer event with JSDom https://github.com/jsdom/jsdom/issues/2527 - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onAxisClick = spy(); render( @@ -114,10 +116,12 @@ describe('LineChart - click event', () => { ]); }); - it('should provide the right context as second argument', function test() { + it('should provide the right context as second argument', function test(t = {}) { if (isJSDOM) { // can't do Pointer event with JSDom https://github.com/jsdom/jsdom/issues/2527 - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onMarkClick = spy(); render( @@ -185,10 +189,12 @@ describe('LineChart - click event', () => { ]); }); - it('should provide the right context as second argument', function test() { + it('should provide the right context as second argument', function test(t = {}) { if (isJSDOM) { // can't do Pointer event with JSDom https://github.com/jsdom/jsdom/issues/2527 - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onAreaClick = spy(); render( @@ -247,10 +253,12 @@ describe('LineChart - click event', () => { ]); }); - it('should provide the right context as second argument', function test() { + it('should provide the right context as second argument', function test(t = {}) { if (isJSDOM) { // can't do Pointer event with JSDom https://github.com/jsdom/jsdom/issues/2527 - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onLineClick = spy(); render( diff --git a/packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx b/packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx index 0aba715490d8..91ab83bc281b 100644 --- a/packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/ScatterChart/checkClickEvent.test.tsx @@ -43,10 +43,12 @@ describe('ScatterChart - click event', () => { }); describe('onItemClick - using vornoid', () => { - it('should provide the right context as second argument when clicking svg', function test() { + it('should provide the right context as second argument when clicking svg', function test(t = {}) { if (isJSDOM) { // svg.createSVGPoint not supported by JSDom https://github.com/jsdom/jsdom/issues/300 - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onItemClick = spy(); render( @@ -88,9 +90,11 @@ describe('ScatterChart - click event', () => { expect(onItemClick.callCount).to.equal(2); }); - it('should provide the right context as second argument when clicking mark', function test() { + it('should provide the right context as second argument when clicking mark', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onItemClick = spy(); render( @@ -124,9 +128,11 @@ describe('ScatterChart - click event', () => { }); describe('onItemClick - disabling vornoid', () => { - it('should not call onItemClick when clicking the SVG', function test() { + it('should not call onItemClick when clicking the SVG', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onItemClick = spy(); render( @@ -153,9 +159,11 @@ describe('ScatterChart - click event', () => { expect(onItemClick.callCount).to.equal(0); }); - it('should provide the right context as second argument when clicking mark', function test() { + it('should provide the right context as second argument when clicking mark', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onItemClick = spy(); render( From aa6b60deba936ca37d1f812da8f12476a125254d Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 15:06:48 +0200 Subject: [PATCH 009/119] fix jsdom --- packages/x-charts/src/BarChart/checkClickEvent.test.tsx | 1 - test/setup.ts | 8 ++++++++ vitest.config.ts => vitest.config.mts | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) rename vitest.config.ts => vitest.config.mts (96%) diff --git a/packages/x-charts/src/BarChart/checkClickEvent.test.tsx b/packages/x-charts/src/BarChart/checkClickEvent.test.tsx index fb69c8da3ad5..4cc5cd0644c7 100644 --- a/packages/x-charts/src/BarChart/checkClickEvent.test.tsx +++ b/packages/x-charts/src/BarChart/checkClickEvent.test.tsx @@ -105,7 +105,6 @@ describe('BarChart - click event', () => { render(
Date: Tue, 10 Sep 2024 15:18:01 +0200 Subject: [PATCH 010/119] browser and dom together --- vitest.config.mts | 17 +++-------------- vitest.workspace.ts | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 vitest.workspace.ts diff --git a/vitest.config.mts b/vitest.config.mts index 040b237e4223..863a4c246048 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -1,10 +1,7 @@ import { defineConfig } from 'vitest/config'; -import react from '@vitejs/plugin-react'; export default defineConfig({ - plugins: [react()], - test: { - include: ['packages/x-charts/**/*.test.tsx'], + resolve: { alias: [ { find: '@mui/x-charts', @@ -15,17 +12,9 @@ export default defineConfig({ replacement: new URL('./test/utils', import.meta.url).pathname, }, ], + }, + test: { globals: true, setupFiles: ['test/setup.ts'], - // environment: 'jsdom', - browser: { - enabled: true, - name: 'chromium', - provider: 'playwright', - headless: true, - // https://playwright.dev - providerOptions: {}, - screenshotFailures: false, - }, }, }); diff --git a/vitest.workspace.ts b/vitest.workspace.ts new file mode 100644 index 000000000000..0ab9f52689f3 --- /dev/null +++ b/vitest.workspace.ts @@ -0,0 +1,31 @@ +import { defineWorkspace } from 'vitest/config'; +import react from '@vitejs/plugin-react'; + +export default defineWorkspace([ + { + extends: './vitest.config.mts', + plugins: [react()], + test: { + include: ['packages/x-charts/**/*.test.tsx'], + name: 'charts/browser', + browser: { + enabled: true, + name: 'chromium', + provider: 'playwright', + headless: true, + // https://playwright.dev + providerOptions: {}, + screenshotFailures: false, + }, + }, + }, + { + extends: './vitest.config.mts', + plugins: [react()], + test: { + include: ['packages/x-charts/**/*.test.tsx'], + name: 'charts/jsdom', + environment: 'jsdom', + }, + }, +]); From 3e5caf5efb041a9e4032092f2d7e65079a790f78 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 15:19:01 +0200 Subject: [PATCH 011/119] packages --- package.json | 2 +- packages/x-charts/package.json | 2 +- pnpm-lock.yaml | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 136df3b6ecbd..8e501615c085 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@mui/icons-material": "^5.16.7", "@mui/internal-babel-plugin-resolve-imports": "1.0.17", "@mui/internal-markdown": "^1.0.12", - "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils", + "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils", "@mui/material": "^5.16.7", "@mui/monorepo": "github:mui/material-ui#64aaf564c82cd8bd709116ad38123dbcab8d3bfb", "@mui/utils": "^5.16.6", diff --git a/packages/x-charts/package.json b/packages/x-charts/package.json index c4b51656cf5a..7966165f2806 100644 --- a/packages/x-charts/package.json +++ b/packages/x-charts/package.json @@ -65,7 +65,7 @@ } }, "devDependencies": { - "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils", + "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils", "@mui/material": "^5.16.7", "@mui/system": "^5.16.7", "@react-spring/core": "^9.7.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 54ffc05cfe83..e01c56576416 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -93,8 +93,8 @@ importers: specifier: ^1.0.12 version: 1.0.12 '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils(@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) @@ -761,8 +761,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils(@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) @@ -3165,8 +3165,8 @@ packages: react: ^18.2.0 react-dom: ^18.2.0 - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils': - resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils} + '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils': + resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils} version: 1.0.12 peerDependencies: react: ^18.2.0 @@ -12167,7 +12167,7 @@ snapshots: - supports-color - utf-8-validate - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/e7e755b2/@mui/internal-test-utils(@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@https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils(@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) From a1234b67d2c321f6b50095657ed5c0ad54ff8d92 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 15:23:05 +0200 Subject: [PATCH 012/119] add workflow --- .github/workflows/vitest.yml | 33 +++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/vitest.yml diff --git a/.github/workflows/vitest.yml b/.github/workflows/vitest.yml new file mode 100644 index 000000000000..8703a458f5ce --- /dev/null +++ b/.github/workflows/vitest.yml @@ -0,0 +1,33 @@ +name: Vitest + +on: + push: + branches: + - 'master' + - 'next' + pull_request: + branches: + - 'master' + - 'next' + +permissions: {} + +jobs: + benchmarks: + name: Vitest Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 + with: + run_install: false + - name: Use Node.js 20.x + uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 + with: + node-version: 20 + cache: 'pnpm' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies + - run: pnpm install --frozen-lockfile + - name: Install Playwright Browsers + run: npx playwright install --with-deps + - name: Run Tests + run: pnpm vitest diff --git a/package.json b/package.json index 8e501615c085..5f951ff63784 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "release:tag": "node scripts/releaseTag.mjs", "validate": "concurrently \"pnpm prettier && pnpm eslint\" \"pnpm proptypes\" \"pnpm docs:typescript:formatted\" \"pnpm docs:api\"", "clean:node_modules": "rimraf --glob \"**/node_modules\"", - "test:browser": "vitest" + "vitest": "vitest" }, "devDependencies": { "@actions/core": "^1.10.1", From 9a6eb21c3c4dd5d4a860b47af0d59623037015fa Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 15:26:53 +0200 Subject: [PATCH 013/119] fix playwright install --- .github/workflows/vitest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vitest.yml b/.github/workflows/vitest.yml index 8703a458f5ce..705163e3dfa4 100644 --- a/.github/workflows/vitest.yml +++ b/.github/workflows/vitest.yml @@ -28,6 +28,6 @@ jobs: cache: 'pnpm' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies - run: pnpm install --frozen-lockfile - name: Install Playwright Browsers - run: npx playwright install --with-deps + run: pnpm exec playwright install --with-deps - name: Run Tests run: pnpm vitest From 09de9d7fa78f92ad0e347c6dc1174b77cf583dec Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 15:43:15 +0200 Subject: [PATCH 014/119] check permission --- .github/workflows/vitest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vitest.yml b/.github/workflows/vitest.yml index 705163e3dfa4..2aef79ea8014 100644 --- a/.github/workflows/vitest.yml +++ b/.github/workflows/vitest.yml @@ -10,7 +10,7 @@ on: - 'master' - 'next' -permissions: {} +# permissions: {} jobs: benchmarks: From 91c67c05f93d0f9bc5d2143ca300988726899d62 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 15:48:45 +0200 Subject: [PATCH 015/119] try removing duplicate dep --- .github/workflows/vitest.yml | 2 +- pnpm-lock.yaml | 3 --- test/package.json | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/vitest.yml b/.github/workflows/vitest.yml index 2aef79ea8014..705163e3dfa4 100644 --- a/.github/workflows/vitest.yml +++ b/.github/workflows/vitest.yml @@ -10,7 +10,7 @@ on: - 'master' - 'next' -# permissions: {} +permissions: {} jobs: benchmarks: diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e01c56576416..f188d632099b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1551,9 +1551,6 @@ importers: '@mui/x-license': specifier: workspace:* version: link:../packages/x-license/build - '@playwright/test': - specifier: ^1.44.1 - version: 1.44.1 '@react-spring/web': specifier: ^9.7.4 version: 9.7.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) diff --git a/test/package.json b/test/package.json index b46acbb59d2d..1544d72be679 100644 --- a/test/package.json +++ b/test/package.json @@ -18,7 +18,6 @@ "@mui/x-date-pickers": "workspace:*", "@mui/x-date-pickers-pro": "workspace:*", "@mui/x-license": "workspace:*", - "@playwright/test": "^1.44.1", "@react-spring/web": "^9.7.4", "@types/chai": "^4.3.19", "@types/karma": "^6.3.8", From 94bbb95d9066a6e460b064d96559df5aa1f71454 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 15:54:18 +0200 Subject: [PATCH 016/119] upgrade playwright --- .github/workflows/vitest.yml | 2 +- package.json | 2 +- pnpm-lock.yaml | 68 ++++++++++++++++++------------------ 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/vitest.yml b/.github/workflows/vitest.yml index 705163e3dfa4..8343e89d261a 100644 --- a/.github/workflows/vitest.yml +++ b/.github/workflows/vitest.yml @@ -28,6 +28,6 @@ jobs: cache: 'pnpm' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies - run: pnpm install --frozen-lockfile - name: Install Playwright Browsers - run: pnpm exec playwright install --with-deps + run: pnpm playwright install --with-deps - name: Run Tests run: pnpm vitest diff --git a/package.json b/package.json index 5f951ff63784..277f96d10f56 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "@next/eslint-plugin-next": "14.2.7", "@octokit/plugin-retry": "^7.1.1", "@octokit/rest": "^21.0.2", - "@playwright/test": "^1.44.1", + "@playwright/test": "^1.47.0", "@testing-library/react": "^16.0.1", "@types/babel__core": "^7.20.5", "@types/babel__traverse": "^7.20.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f188d632099b..6cf3a5faf9d2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -114,8 +114,8 @@ importers: specifier: ^21.0.2 version: 21.0.2 '@playwright/test': - specifier: ^1.44.1 - version: 1.44.1 + specifier: ^1.47.0 + version: 1.47.0 '@testing-library/react': specifier: ^16.0.1 version: 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -175,7 +175,7 @@ importers: version: 4.3.1(vite@5.3.4(@types/node@20.16.3)(terser@5.27.0)) '@vitest/browser': specifier: ^2.0.5 - version: 2.0.5(playwright@1.46.1)(typescript@5.5.4)(vitest@2.0.5) + version: 2.0.5(playwright@1.47.0)(typescript@5.5.4)(vitest@2.0.5) autoprefixer: specifier: ^10.4.20 version: 10.4.20(postcss@8.4.44) @@ -442,7 +442,7 @@ importers: 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.2 - version: 6.0.2(bm6kywyrtzseqscuvn3yfzmlbi) + version: 6.0.2(rwfzlnjuk4hzzgjkzvpdfrnhqi) '@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) @@ -457,7 +457,7 @@ importers: 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) '@mui/material-nextjs': specifier: ^5.16.6 - version: 5.16.6(@emotion/cache@11.13.1)(@emotion/server@11.11.0)(@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)(next@14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.44.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) + version: 5.16.6(@emotion/cache@11.13.1)(@emotion/server@11.11.0)(@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)(next@14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.47.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) '@mui/styles': specifier: ^5.16.7 version: 5.16.7(@types/react@18.3.4)(react@18.3.1) @@ -589,7 +589,7 @@ importers: version: 0.5.45 next: specifier: ^14.2.7 - version: 14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.44.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.47.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -3746,9 +3746,9 @@ packages: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@playwright/test@1.44.1': - resolution: {integrity: sha512-1hZ4TNvD5z9VuhNJ/walIjvMVvYkZKf71axoF/uiAqpntQJXpG64dlXhoDXE3OczPuTuvjf/M5KWFg5VAVUS3Q==} - engines: {node: '>=16'} + '@playwright/test@1.47.0': + resolution: {integrity: sha512-SgAdlSwYVpToI4e/IH19IHHWvoijAYH5hu2MWSXptRypLSnzj51PcGD+rsOXFayde4P9ZLi+loXVwArg6IUkCA==} + engines: {node: '>=18'} hasBin: true '@polka/url@1.0.0-next.24': @@ -8600,19 +8600,14 @@ packages: resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} engines: {node: '>=8'} - playwright-core@1.44.1: - resolution: {integrity: sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA==} - engines: {node: '>=16'} - hasBin: true - playwright-core@1.46.1: resolution: {integrity: sha512-h9LqIQaAv+CYvWzsZ+h3RsrqCStkBHlgo6/TJlFst3cOTlLghBQlJwPOZKQJTKNaD3QIB7aAVQ+gfWbN3NXB7A==} engines: {node: '>=18'} hasBin: true - playwright@1.44.1: - resolution: {integrity: sha512-qr/0UJ5CFAtloI3avF95Y0L1xQo6r3LQArLIg/z/PoGJ6xa+EwzrwO5lpNr/09STxdHuUoP2mvuELJS+hLdtgg==} - engines: {node: '>=16'} + playwright-core@1.47.0: + resolution: {integrity: sha512-1DyHT8OqkcfCkYUD9zzUTfg7EfTd+6a8MkD/NWOvjo0u/SCNd5YmY/lJwFvUZOxJbWNds+ei7ic2+R/cRz/PDg==} + engines: {node: '>=18'} hasBin: true playwright@1.46.1: @@ -8620,6 +8615,11 @@ packages: engines: {node: '>=18'} hasBin: true + playwright@1.47.0: + resolution: {integrity: sha512-jOWiRq2pdNAX/mwLiwFYnPHpEZ4rM+fRSQpRHwEwZlP2PUANvL3+aJOF/bvISMhFD30rqMxUB4RJx9aQbfh4Ww==} + engines: {node: '>=18'} + hasBin: true + possible-typed-array-names@1.0.0: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} @@ -12072,7 +12072,7 @@ snapshots: '@mui/core-downloads-tracker@5.16.7': {} - '@mui/docs@6.0.2(bm6kywyrtzseqscuvn3yfzmlbi)': + '@mui/docs@6.0.2(rwfzlnjuk4hzzgjkzvpdfrnhqi)': 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) @@ -12084,7 +12084,7 @@ snapshots: clipboard-copy: 4.0.1 clsx: 2.1.1 csstype: 3.1.3 - next: 14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.44.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + next: 14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.47.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) nprogress: 0.2.0 prop-types: 15.8.1 react: 18.3.1 @@ -12231,11 +12231,11 @@ snapshots: '@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 - '@mui/material-nextjs@5.16.6(@emotion/cache@11.13.1)(@emotion/server@11.11.0)(@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)(next@14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.44.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)': + '@mui/material-nextjs@5.16.6(@emotion/cache@11.13.1)(@emotion/server@11.11.0)(@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)(next@14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.47.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.25.6 '@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) - next: 14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.44.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + next: 14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.47.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 optionalDependencies: '@emotion/cache': 11.13.1 @@ -12894,9 +12894,9 @@ snapshots: '@pkgr/core@0.1.1': {} - '@playwright/test@1.44.1': + '@playwright/test@1.47.0': dependencies: - playwright: 1.44.1 + playwright: 1.47.0 '@polka/url@1.0.0-next.24': {} @@ -13645,7 +13645,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/browser@2.0.5(playwright@1.46.1)(typescript@5.5.4)(vitest@2.0.5)': + '@vitest/browser@2.0.5(playwright@1.47.0)(typescript@5.5.4)(vitest@2.0.5)': dependencies: '@testing-library/dom': 10.4.0 '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) @@ -13656,7 +13656,7 @@ snapshots: vitest: 2.0.5(@types/node@20.16.3)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) ws: 8.18.0 optionalDependencies: - playwright: 1.46.1 + playwright: 1.47.0 transitivePeerDependencies: - bufferutil - graphql @@ -18092,7 +18092,7 @@ snapshots: nested-error-stacks@2.1.1: {} - next@14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.44.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + next@14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.47.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@next/env': 14.2.7 '@swc/helpers': 0.5.5 @@ -18114,7 +18114,7 @@ snapshots: '@next/swc-win32-ia32-msvc': 14.2.7 '@next/swc-win32-x64-msvc': 14.2.7 '@opentelemetry/api': 1.8.0 - '@playwright/test': 1.44.1 + '@playwright/test': 1.47.0 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros @@ -18757,19 +18757,19 @@ snapshots: dependencies: find-up: 3.0.0 - playwright-core@1.44.1: {} - playwright-core@1.46.1: {} - playwright@1.44.1: + playwright-core@1.47.0: {} + + playwright@1.46.1: dependencies: - playwright-core: 1.44.1 + playwright-core: 1.46.1 optionalDependencies: fsevents: 2.3.2 - playwright@1.46.1: + playwright@1.47.0: dependencies: - playwright-core: 1.46.1 + playwright-core: 1.47.0 optionalDependencies: fsevents: 2.3.2 @@ -20332,7 +20332,7 @@ snapshots: why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.16.3 - '@vitest/browser': 2.0.5(playwright@1.46.1)(typescript@5.5.4)(vitest@2.0.5) + '@vitest/browser': 2.0.5(playwright@1.47.0)(typescript@5.5.4)(vitest@2.0.5) '@vitest/ui': 2.0.5(vitest@2.0.5) jsdom: 24.1.3 transitivePeerDependencies: From 8d37f265e3b4c8df5db645568c5c546ba46e140d Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 15:58:10 +0200 Subject: [PATCH 017/119] dedupe --- pnpm-lock.yaml | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6cf3a5faf9d2..e61f799f6a92 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3104,7 +3104,7 @@ packages: resolution: {integrity: sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==} engines: {node: '>=12.0.0'} peerDependencies: - '@types/react': ^17.0.0 || ^18.0.0 + '@types/react': ^18.3.4 react: ^17.0.0 || ^18.0.0 react-dom: ^17.0.0 || ^18.0.0 peerDependenciesMeta: @@ -8600,21 +8600,11 @@ packages: resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} engines: {node: '>=8'} - playwright-core@1.46.1: - resolution: {integrity: sha512-h9LqIQaAv+CYvWzsZ+h3RsrqCStkBHlgo6/TJlFst3cOTlLghBQlJwPOZKQJTKNaD3QIB7aAVQ+gfWbN3NXB7A==} - engines: {node: '>=18'} - hasBin: true - playwright-core@1.47.0: resolution: {integrity: sha512-1DyHT8OqkcfCkYUD9zzUTfg7EfTd+6a8MkD/NWOvjo0u/SCNd5YmY/lJwFvUZOxJbWNds+ei7ic2+R/cRz/PDg==} engines: {node: '>=18'} hasBin: true - playwright@1.46.1: - resolution: {integrity: sha512-oPcr1yqoXLCkgKtD5eNUPLiN40rYEM39odNpIb6VE6S7/15gJmA1NzVv6zJYusV0e7tzvkU/utBFNa/Kpxmwng==} - engines: {node: '>=18'} - hasBin: true - playwright@1.47.0: resolution: {integrity: sha512-jOWiRq2pdNAX/mwLiwFYnPHpEZ4rM+fRSQpRHwEwZlP2PUANvL3+aJOF/bvISMhFD30rqMxUB4RJx9aQbfh4Ww==} engines: {node: '>=18'} @@ -12150,7 +12140,7 @@ snapshots: jsdom: 24.1.3 lodash: 4.17.21 mocha: 10.7.3 - playwright: 1.46.1 + playwright: 1.47.0 prop-types: 15.8.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -12183,7 +12173,7 @@ snapshots: jsdom: 24.1.3 lodash: 4.17.21 mocha: 10.7.3 - playwright: 1.46.1 + playwright: 1.47.0 prop-types: 15.8.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -18757,16 +18747,8 @@ snapshots: dependencies: find-up: 3.0.0 - playwright-core@1.46.1: {} - playwright-core@1.47.0: {} - playwright@1.46.1: - dependencies: - playwright-core: 1.46.1 - optionalDependencies: - fsevents: 2.3.2 - playwright@1.47.0: dependencies: playwright-core: 1.47.0 From e47aa213e9fb8fd9cc7d12adb1d18a17de783371 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 16:33:00 +0200 Subject: [PATCH 018/119] Fix chai assertions --- test/utils/addChaiAssertions.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/utils/addChaiAssertions.ts b/test/utils/addChaiAssertions.ts index 2392de41f5a3..9ec27b2d7132 100644 --- a/test/utils/addChaiAssertions.ts +++ b/test/utils/addChaiAssertions.ts @@ -1,5 +1,11 @@ import chai from 'chai'; +import chaiDom from 'chai-dom'; +import chaiPlugin from '@mui/internal-test-utils/chaiPlugin'; + +chai.use(chaiDom); +chai.use(chaiPlugin); + // https://stackoverflow.com/a/46755166/3406963 declare global { namespace Chai { @@ -13,7 +19,7 @@ declare global { } chai.use((chaiAPI, utils) => { - chai.Assertion.addMethod('toEqualDateTime', function toEqualDateTime(expectedDate, message) { + chaiAPI.Assertion.addMethod('toEqualDateTime', function toEqualDateTime(expectedDate, message) { // eslint-disable-next-line no-underscore-dangle const actualDate = this._obj; @@ -30,7 +36,7 @@ chai.use((chaiAPI, utils) => { cleanExpectedDate = expectedDate; } - const assertion = new chai.Assertion(cleanActualDate.toISOString(), message); + const assertion = new chaiAPI.Assertion(cleanActualDate.toISOString(), message); // TODO: Investigate if `as any` can be removed after https://github.com/DefinitelyTyped/DefinitelyTyped/issues/48634 is resolved. utils.transferFlags(this as any, assertion, false); assertion.to.equal(cleanExpectedDate.toISOString()); From 7f19f37c6318d61313d673219bcdba69d428d83d Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 17:04:25 +0200 Subject: [PATCH 019/119] revert playwright --- package.json | 2 +- pnpm-lock.yaml | 113 +++++++++++++++++++++++++++++-------------------- 2 files changed, 68 insertions(+), 47 deletions(-) diff --git a/package.json b/package.json index 277f96d10f56..5f951ff63784 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "@next/eslint-plugin-next": "14.2.7", "@octokit/plugin-retry": "^7.1.1", "@octokit/rest": "^21.0.2", - "@playwright/test": "^1.47.0", + "@playwright/test": "^1.44.1", "@testing-library/react": "^16.0.1", "@types/babel__core": "^7.20.5", "@types/babel__traverse": "^7.20.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e61f799f6a92..ebb349680c91 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -114,8 +114,8 @@ importers: specifier: ^21.0.2 version: 21.0.2 '@playwright/test': - specifier: ^1.47.0 - version: 1.47.0 + specifier: ^1.44.1 + version: 1.44.1 '@testing-library/react': specifier: ^16.0.1 version: 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -175,7 +175,7 @@ importers: version: 4.3.1(vite@5.3.4(@types/node@20.16.3)(terser@5.27.0)) '@vitest/browser': specifier: ^2.0.5 - version: 2.0.5(playwright@1.47.0)(typescript@5.5.4)(vitest@2.0.5) + version: 2.0.5(playwright@1.46.1)(typescript@5.5.4)(vitest@2.0.5) autoprefixer: specifier: ^10.4.20 version: 10.4.20(postcss@8.4.44) @@ -442,7 +442,7 @@ importers: 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.2 - version: 6.0.2(rwfzlnjuk4hzzgjkzvpdfrnhqi) + 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) @@ -457,7 +457,7 @@ importers: 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) '@mui/material-nextjs': specifier: ^5.16.6 - version: 5.16.6(@emotion/cache@11.13.1)(@emotion/server@11.11.0)(@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)(next@14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.47.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) + version: 5.16.6(@emotion/cache@11.13.1)(@emotion/server@11.11.0)(@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)(next@14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.44.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) '@mui/styles': specifier: ^5.16.7 version: 5.16.7(@types/react@18.3.4)(react@18.3.1) @@ -589,7 +589,7 @@ importers: version: 0.5.45 next: specifier: ^14.2.7 - version: 14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.47.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.44.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -3096,15 +3096,15 @@ packages: resolution: {integrity: sha512-wi72R01tgjBjzG2kjRyTHl4yCTKDfDMIXRyKz9E/FBa9SkFvUOAE4bdyY9MhEsRZmSWL7+CYE8Flv/HScRpBbA==} engines: {node: '>=18.0.0'} - '@mswjs/interceptors@0.29.1': - resolution: {integrity: sha512-3rDakgJZ77+RiQUuSK69t1F0m8BQKA8Vh5DCS5V0DWvNY67zob2JhhQrhCO0AKLGINTRSFd1tBaHcJTkhefoSw==} + '@mswjs/interceptors@0.35.0': + resolution: {integrity: sha512-f5cHyIvm4m4g1I5x9EH1etGx0puaU0OaX2szqGRVBVgUC6aMASlOI5hbpe7tJ9l4/VWjCUu5OMraCazLZGI24A==} engines: {node: '>=18'} '@mui/base@5.0.0-beta.40': resolution: {integrity: sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==} engines: {node: '>=12.0.0'} peerDependencies: - '@types/react': ^18.3.4 + '@types/react': ^17.0.0 || ^18.0.0 react: ^17.0.0 || ^18.0.0 react-dom: ^17.0.0 || ^18.0.0 peerDependenciesMeta: @@ -3746,9 +3746,9 @@ packages: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@playwright/test@1.47.0': - resolution: {integrity: sha512-SgAdlSwYVpToI4e/IH19IHHWvoijAYH5hu2MWSXptRypLSnzj51PcGD+rsOXFayde4P9ZLi+loXVwArg6IUkCA==} - engines: {node: '>=18'} + '@playwright/test@1.44.1': + resolution: {integrity: sha512-1hZ4TNvD5z9VuhNJ/walIjvMVvYkZKf71axoF/uiAqpntQJXpG64dlXhoDXE3OczPuTuvjf/M5KWFg5VAVUS3Q==} + engines: {node: '>=16'} hasBin: true '@polka/url@1.0.0-next.24': @@ -6646,6 +6646,10 @@ packages: graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + graphql@16.9.0: + resolution: {integrity: sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} + gtoken@7.0.1: resolution: {integrity: sha512-KcFVtoP1CVFtQu0aSk3AyAt2og66PFhZAlkUOuWKwzMLoulHXG5W5wE5xAnHb+yl3/wEFoqGW7/cDGMU8igDZQ==} engines: {node: '>=14.0.0'} @@ -7990,16 +7994,13 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - msw@2.4.2: - resolution: {integrity: sha512-GImSQGhn19czhVpxPdiUDK8CMZ6jbBcvOhzfJd8KFErjEER2wDKWs1UYaetJs2GSNlAqt6heZYm7g3eLatTcog==} + msw@2.4.4: + resolution: {integrity: sha512-iuM0qGs4YmgYCLH+xqb07w2e/e4fYmsx3+WHVlIOUA34TW1sw+wRpNmOlXnLDkw/T7233Jnm6t+aNf4v2E3e2Q==} engines: {node: '>=18'} hasBin: true peerDependencies: - graphql: '>= 16.8.x' typescript: '>= 4.8.x' peerDependenciesMeta: - graphql: - optional: true typescript: optional: true @@ -8600,13 +8601,23 @@ packages: resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} engines: {node: '>=8'} - playwright-core@1.47.0: - resolution: {integrity: sha512-1DyHT8OqkcfCkYUD9zzUTfg7EfTd+6a8MkD/NWOvjo0u/SCNd5YmY/lJwFvUZOxJbWNds+ei7ic2+R/cRz/PDg==} + playwright-core@1.44.1: + resolution: {integrity: sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA==} + engines: {node: '>=16'} + hasBin: true + + playwright-core@1.46.1: + resolution: {integrity: sha512-h9LqIQaAv+CYvWzsZ+h3RsrqCStkBHlgo6/TJlFst3cOTlLghBQlJwPOZKQJTKNaD3QIB7aAVQ+gfWbN3NXB7A==} engines: {node: '>=18'} hasBin: true - playwright@1.47.0: - resolution: {integrity: sha512-jOWiRq2pdNAX/mwLiwFYnPHpEZ4rM+fRSQpRHwEwZlP2PUANvL3+aJOF/bvISMhFD30rqMxUB4RJx9aQbfh4Ww==} + playwright@1.44.1: + resolution: {integrity: sha512-qr/0UJ5CFAtloI3avF95Y0L1xQo6r3LQArLIg/z/PoGJ6xa+EwzrwO5lpNr/09STxdHuUoP2mvuELJS+hLdtgg==} + engines: {node: '>=16'} + hasBin: true + + playwright@1.46.1: + resolution: {integrity: sha512-oPcr1yqoXLCkgKtD5eNUPLiN40rYEM39odNpIb6VE6S7/15gJmA1NzVv6zJYusV0e7tzvkU/utBFNa/Kpxmwng==} engines: {node: '>=18'} hasBin: true @@ -9777,8 +9788,8 @@ packages: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} - type-fest@4.26.0: - resolution: {integrity: sha512-OduNjVJsFbifKb57UqZ2EMP1i4u64Xwow3NYXUtBbD4vIwJdQd4+xl8YDou1dlm4DVrtwT/7Ky8z8WyCULVfxw==} + type-fest@4.26.1: + resolution: {integrity: sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==} engines: {node: '>=16'} type-is@1.6.18: @@ -12037,7 +12048,7 @@ snapshots: - supports-color - typescript - '@mswjs/interceptors@0.29.1': + '@mswjs/interceptors@0.35.0': dependencies: '@open-draft/deferred-promise': 2.2.0 '@open-draft/logger': 0.3.0 @@ -12062,7 +12073,7 @@ snapshots: '@mui/core-downloads-tracker@5.16.7': {} - '@mui/docs@6.0.2(rwfzlnjuk4hzzgjkzvpdfrnhqi)': + '@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) @@ -12074,7 +12085,7 @@ snapshots: clipboard-copy: 4.0.1 clsx: 2.1.1 csstype: 3.1.3 - next: 14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.47.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + next: 14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.44.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) nprogress: 0.2.0 prop-types: 15.8.1 react: 18.3.1 @@ -12140,7 +12151,7 @@ snapshots: jsdom: 24.1.3 lodash: 4.17.21 mocha: 10.7.3 - playwright: 1.47.0 + playwright: 1.46.1 prop-types: 15.8.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -12173,7 +12184,7 @@ snapshots: jsdom: 24.1.3 lodash: 4.17.21 mocha: 10.7.3 - playwright: 1.47.0 + playwright: 1.46.1 prop-types: 15.8.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -12221,11 +12232,11 @@ snapshots: '@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 - '@mui/material-nextjs@5.16.6(@emotion/cache@11.13.1)(@emotion/server@11.11.0)(@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)(next@14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.47.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)': + '@mui/material-nextjs@5.16.6(@emotion/cache@11.13.1)(@emotion/server@11.11.0)(@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)(next@14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.44.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.25.6 '@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) - next: 14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.47.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + next: 14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.44.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 optionalDependencies: '@emotion/cache': 11.13.1 @@ -12884,9 +12895,9 @@ snapshots: '@pkgr/core@0.1.1': {} - '@playwright/test@1.47.0': + '@playwright/test@1.44.1': dependencies: - playwright: 1.47.0 + playwright: 1.44.1 '@polka/url@1.0.0-next.24': {} @@ -13635,21 +13646,20 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/browser@2.0.5(playwright@1.47.0)(typescript@5.5.4)(vitest@2.0.5)': + '@vitest/browser@2.0.5(playwright@1.46.1)(typescript@5.5.4)(vitest@2.0.5)': dependencies: '@testing-library/dom': 10.4.0 '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) '@vitest/utils': 2.0.5 magic-string: 0.30.10 - msw: 2.4.2(typescript@5.5.4) + msw: 2.4.4(typescript@5.5.4) sirv: 2.0.4 vitest: 2.0.5(@types/node@20.16.3)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) ws: 8.18.0 optionalDependencies: - playwright: 1.47.0 + playwright: 1.46.1 transitivePeerDependencies: - bufferutil - - graphql - typescript - utf-8-validate @@ -16416,6 +16426,8 @@ snapshots: graphemer@1.4.0: {} + graphql@16.9.0: {} + gtoken@7.0.1(encoding@0.1.13): dependencies: gaxios: 6.1.1(encoding@0.1.13) @@ -18028,23 +18040,24 @@ snapshots: ms@2.1.3: {} - msw@2.4.2(typescript@5.5.4): + msw@2.4.4(typescript@5.5.4): dependencies: '@bundled-es-modules/cookie': 2.0.0 '@bundled-es-modules/statuses': 1.0.1 '@bundled-es-modules/tough-cookie': 0.1.6 '@inquirer/confirm': 3.2.0 - '@mswjs/interceptors': 0.29.1 + '@mswjs/interceptors': 0.35.0 '@open-draft/until': 2.1.0 '@types/cookie': 0.6.0 '@types/statuses': 2.0.5 chalk: 4.1.2 + graphql: 16.9.0 headers-polyfill: 4.0.3 is-node-process: 1.2.0 outvariant: 1.4.3 path-to-regexp: 6.2.1 strict-event-emitter: 0.5.1 - type-fest: 4.26.0 + type-fest: 4.26.1 yargs: 17.7.2 optionalDependencies: typescript: 5.5.4 @@ -18082,7 +18095,7 @@ snapshots: nested-error-stacks@2.1.1: {} - next@14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.47.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + next@14.2.7(@babel/core@7.25.2)(@opentelemetry/api@1.8.0)(@playwright/test@1.44.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@next/env': 14.2.7 '@swc/helpers': 0.5.5 @@ -18104,7 +18117,7 @@ snapshots: '@next/swc-win32-ia32-msvc': 14.2.7 '@next/swc-win32-x64-msvc': 14.2.7 '@opentelemetry/api': 1.8.0 - '@playwright/test': 1.47.0 + '@playwright/test': 1.44.1 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros @@ -18747,11 +18760,19 @@ snapshots: dependencies: find-up: 3.0.0 - playwright-core@1.47.0: {} + playwright-core@1.44.1: {} + + playwright-core@1.46.1: {} + + playwright@1.44.1: + dependencies: + playwright-core: 1.44.1 + optionalDependencies: + fsevents: 2.3.2 - playwright@1.47.0: + playwright@1.46.1: dependencies: - playwright-core: 1.47.0 + playwright-core: 1.46.1 optionalDependencies: fsevents: 2.3.2 @@ -20045,7 +20066,7 @@ snapshots: type-fest@2.19.0: {} - type-fest@4.26.0: {} + type-fest@4.26.1: {} type-is@1.6.18: dependencies: @@ -20314,7 +20335,7 @@ snapshots: why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.16.3 - '@vitest/browser': 2.0.5(playwright@1.47.0)(typescript@5.5.4)(vitest@2.0.5) + '@vitest/browser': 2.0.5(playwright@1.46.1)(typescript@5.5.4)(vitest@2.0.5) '@vitest/ui': 2.0.5(vitest@2.0.5) jsdom: 24.1.3 transitivePeerDependencies: From ad28046bedf3b516f79b1bd9aaf7e0ccc732bf15 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 17:12:19 +0200 Subject: [PATCH 020/119] overwrite playwright in internal packages --- package.json | 4 +++- pnpm-lock.yaml | 38 +++++++++++--------------------------- 2 files changed, 14 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 5f951ff63784..4112e5d39db0 100644 --- a/package.json +++ b/package.json @@ -203,7 +203,9 @@ }, "resolutions": { "react-is": "^18.3.1", - "@types/node": "^20.14.8" + "@types/node": "^20.14.8", + "@playwright/test": "1.44.1", + "playwright": "1.44.1" }, "packageManager": "pnpm@9.9.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ebb349680c91..8a77c39bf8a4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,6 +7,8 @@ settings: overrides: react-is: ^18.3.1 '@types/node': ^20.14.8 + '@playwright/test': 1.44.1 + playwright: 1.44.1 patchedDependencies: babel-plugin-replace-imports@1.0.2: @@ -114,7 +116,7 @@ importers: specifier: ^21.0.2 version: 21.0.2 '@playwright/test': - specifier: ^1.44.1 + specifier: 1.44.1 version: 1.44.1 '@testing-library/react': specifier: ^16.0.1 @@ -175,7 +177,7 @@ importers: version: 4.3.1(vite@5.3.4(@types/node@20.16.3)(terser@5.27.0)) '@vitest/browser': specifier: ^2.0.5 - version: 2.0.5(playwright@1.46.1)(typescript@5.5.4)(vitest@2.0.5) + version: 2.0.5(playwright@1.44.1)(typescript@5.5.4)(vitest@2.0.5) autoprefixer: specifier: ^10.4.20 version: 10.4.20(postcss@8.4.44) @@ -4437,7 +4439,7 @@ packages: '@vitest/browser@2.0.5': resolution: {integrity: sha512-VbOYtu/6R3d7ASZREcrJmRY/sQuRFO9wMVsEDqfYbWiJRh2fDNi8CL1Csn7Ux31pOcPmmM5QvzFCMpiojvVh8g==} peerDependencies: - playwright: '*' + playwright: 1.44.1 safaridriver: '*' vitest: 2.0.5 webdriverio: '*' @@ -8045,7 +8047,7 @@ packages: hasBin: true peerDependencies: '@opentelemetry/api': ^1.1.0 - '@playwright/test': ^1.41.2 + '@playwright/test': 1.44.1 react: ^18.2.0 react-dom: ^18.2.0 sass: ^1.3.0 @@ -8606,21 +8608,11 @@ packages: engines: {node: '>=16'} hasBin: true - playwright-core@1.46.1: - resolution: {integrity: sha512-h9LqIQaAv+CYvWzsZ+h3RsrqCStkBHlgo6/TJlFst3cOTlLghBQlJwPOZKQJTKNaD3QIB7aAVQ+gfWbN3NXB7A==} - engines: {node: '>=18'} - hasBin: true - playwright@1.44.1: resolution: {integrity: sha512-qr/0UJ5CFAtloI3avF95Y0L1xQo6r3LQArLIg/z/PoGJ6xa+EwzrwO5lpNr/09STxdHuUoP2mvuELJS+hLdtgg==} engines: {node: '>=16'} hasBin: true - playwright@1.46.1: - resolution: {integrity: sha512-oPcr1yqoXLCkgKtD5eNUPLiN40rYEM39odNpIb6VE6S7/15gJmA1NzVv6zJYusV0e7tzvkU/utBFNa/Kpxmwng==} - engines: {node: '>=18'} - hasBin: true - possible-typed-array-names@1.0.0: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} @@ -12151,7 +12143,7 @@ snapshots: jsdom: 24.1.3 lodash: 4.17.21 mocha: 10.7.3 - playwright: 1.46.1 + playwright: 1.44.1 prop-types: 15.8.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -12184,7 +12176,7 @@ snapshots: jsdom: 24.1.3 lodash: 4.17.21 mocha: 10.7.3 - playwright: 1.46.1 + playwright: 1.44.1 prop-types: 15.8.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -13646,7 +13638,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/browser@2.0.5(playwright@1.46.1)(typescript@5.5.4)(vitest@2.0.5)': + '@vitest/browser@2.0.5(playwright@1.44.1)(typescript@5.5.4)(vitest@2.0.5)': dependencies: '@testing-library/dom': 10.4.0 '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) @@ -13657,7 +13649,7 @@ snapshots: vitest: 2.0.5(@types/node@20.16.3)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) ws: 8.18.0 optionalDependencies: - playwright: 1.46.1 + playwright: 1.44.1 transitivePeerDependencies: - bufferutil - typescript @@ -18762,20 +18754,12 @@ snapshots: playwright-core@1.44.1: {} - playwright-core@1.46.1: {} - playwright@1.44.1: dependencies: playwright-core: 1.44.1 optionalDependencies: fsevents: 2.3.2 - playwright@1.46.1: - dependencies: - playwright-core: 1.46.1 - optionalDependencies: - fsevents: 2.3.2 - possible-typed-array-names@1.0.0: {} postcss-selector-parser@6.1.0: @@ -20335,7 +20319,7 @@ snapshots: why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.16.3 - '@vitest/browser': 2.0.5(playwright@1.46.1)(typescript@5.5.4)(vitest@2.0.5) + '@vitest/browser': 2.0.5(playwright@1.44.1)(typescript@5.5.4)(vitest@2.0.5) '@vitest/ui': 2.0.5(vitest@2.0.5) jsdom: 24.1.3 transitivePeerDependencies: From d522dab0792bbe7defb8cc55c8a06af09e7c3a63 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 17:43:29 +0200 Subject: [PATCH 021/119] easy config --- vitest.workspace.ts | 54 ++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 0ab9f52689f3..723b73675d06 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -1,31 +1,35 @@ import { defineWorkspace } from 'vitest/config'; import react from '@vitejs/plugin-react'; -export default defineWorkspace([ - { - extends: './vitest.config.mts', - plugins: [react()], - test: { - include: ['packages/x-charts/**/*.test.tsx'], - name: 'charts/browser', - browser: { - enabled: true, - name: 'chromium', - provider: 'playwright', - headless: true, - // https://playwright.dev - providerOptions: {}, - screenshotFailures: false, +const packages = ['charts']; + +export default defineWorkspace( + packages.flatMap((name) => [ + { + extends: './vitest.config.mts', + plugins: [react()], + test: { + include: [`packages/x-${name}/**/*.test.tsx`], + name: `${name}/browser`, + browser: { + enabled: true, + name: 'chromium', + provider: 'playwright', + headless: true, + // https://playwright.dev + providerOptions: {}, + screenshotFailures: false, + }, }, }, - }, - { - extends: './vitest.config.mts', - plugins: [react()], - test: { - include: ['packages/x-charts/**/*.test.tsx'], - name: 'charts/jsdom', - environment: 'jsdom', + { + extends: './vitest.config.mts', + plugins: [react()], + test: { + include: [`packages/x-${name}/**/*.test.tsx`], + name: `${name}/jsdom`, + environment: 'jsdom', + }, }, - }, -]); + ]), +); From 795d4af98319d5540245710346c7ca3d53db71f6 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 17:56:37 +0200 Subject: [PATCH 022/119] Add date pickers to alias --- vitest.config.mts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vitest.config.mts b/vitest.config.mts index 863a4c246048..76ea28f0daa4 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -7,10 +7,18 @@ export default defineConfig({ find: '@mui/x-charts', replacement: new URL('./packages/x-charts/src', import.meta.url).pathname, }, + { + find: '@mui/x-date-pickers', + replacement: new URL('./packages/x-date-pickers/src', import.meta.url).pathname, + }, { find: 'test/utils', replacement: new URL('./test/utils', import.meta.url).pathname, }, + { + find: '@mui/x-internals', + replacement: new URL('./packages/x-internals/src', import.meta.url).pathname, + }, ], }, test: { From 18b7a5c8c25212fa8d0d42d109c57bf5678885c5 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 10 Sep 2024 17:56:47 +0200 Subject: [PATCH 023/119] fix skips in date pickers --- .../DateCalendar/tests/DateCalendar.test.tsx | 6 +- .../tests/editing.DateField.test.tsx | 6 +- .../DateField/tests/format.DateField.test.tsx | 6 +- .../tests/DesktopDatePicker.test.tsx | 24 ++-- .../tests/MobileDateTimePicker.test.tsx | 6 +- .../tests/MobileTimePicker.test.tsx | 6 +- .../tests/StaticDatePicker.test.tsx | 12 +- .../StaticTimePicker.test.tsx | 12 +- .../src/TimeClock/tests/TimeClock.test.tsx | 114 ++++++++++++++---- 9 files changed, 141 insertions(+), 51 deletions(-) diff --git a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx index 81833dfd0e52..f70a4332e5a6 100644 --- a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx +++ b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx @@ -520,9 +520,11 @@ describe('', () => { expect(screen.getByMuiTest('calendar-month-and-year-text')).to.have.text('January 2022'); }); - it('should scroll to show the selected year', function test() { + it('should scroll to show the selected year', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( - Editing', () => { }); }); - it('should support day with letter suffix', function test() { + it('should support day with letter suffix', function test(t = {}) { // Luxon don't have any day format with a letter suffix if (adapter.lib === 'luxon') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } testFieldChange({ diff --git a/packages/x-date-pickers/src/DateField/tests/format.DateField.test.tsx b/packages/x-date-pickers/src/DateField/tests/format.DateField.test.tsx index 67c0df9d5edc..341770ff553e 100644 --- a/packages/x-date-pickers/src/DateField/tests/format.DateField.test.tsx +++ b/packages/x-date-pickers/src/DateField/tests/format.DateField.test.tsx @@ -68,12 +68,14 @@ describeAdapters(' - Format', DateField, ({ adapter, renderWithProp expectFieldValueV6(input, 'January Escaped 2019'); }); - it('should support nested escaped characters', function test() { + it('should support nested escaped characters', function test(t = {}) { const { start: startChar, end: endChar } = adapter.escapedCharacters; // If your start character and end character are equal // Then you can't have nested escaped characters if (startChar === endChar) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } // Test with v7 input diff --git a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx index 5d90362ce078..570731e75b0e 100644 --- a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx +++ b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx @@ -101,9 +101,11 @@ describe('', () => { expect(screen.getByRole('radio', { checked: true, name: 'January' })).not.to.equal(null); }); - it('should move the focus to the newly opened views', function test() { + it('should move the focus to the newly opened views', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); @@ -157,13 +159,6 @@ describe('', () => { ); }); - before(function beforeHook() { - // JSDOM has neither layout nor window.scrollTo - if (/jsdom/.test(window.navigator.userAgent)) { - this.skip(); - } - }); - let originalScrollX: number; let originalScrollY: number; @@ -173,10 +168,17 @@ describe('', () => { }); afterEach(() => { - window.scrollTo(originalScrollX, originalScrollY); + window.scrollTo?.(originalScrollX, originalScrollY); }); - it('does not scroll when opened', () => { + it('does not scroll when opened', (t = {}) => { + // JSDOM has neither layout nor window.scrollTo + if (/jsdom/.test(window.navigator.userAgent)) { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleClose = spy(); const handleOpen = spy(); function BottomAnchoredDesktopTimePicker() { diff --git a/packages/x-date-pickers/src/MobileDateTimePicker/tests/MobileDateTimePicker.test.tsx b/packages/x-date-pickers/src/MobileDateTimePicker/tests/MobileDateTimePicker.test.tsx index 1e21c3dbc935..a1e8409873a8 100644 --- a/packages/x-date-pickers/src/MobileDateTimePicker/tests/MobileDateTimePicker.test.tsx +++ b/packages/x-date-pickers/src/MobileDateTimePicker/tests/MobileDateTimePicker.test.tsx @@ -104,9 +104,11 @@ describe('', () => { expect(screen.queryByRole('dialog')).toBeVisible(); }); - it('should call onChange when selecting each view', function test() { + it('should call onChange when selecting each view', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onChange = spy(); diff --git a/packages/x-date-pickers/src/MobileTimePicker/tests/MobileTimePicker.test.tsx b/packages/x-date-pickers/src/MobileTimePicker/tests/MobileTimePicker.test.tsx index 62d073d3c10c..79475e6b8242 100644 --- a/packages/x-date-pickers/src/MobileTimePicker/tests/MobileTimePicker.test.tsx +++ b/packages/x-date-pickers/src/MobileTimePicker/tests/MobileTimePicker.test.tsx @@ -48,9 +48,11 @@ describe('', () => { expect(handleChange.firstCall.args[0]).toEqualDateTime(new Date(2019, 0, 1, 16, 20)); }); - it('should call onChange when selecting each view', async function test() { + it('should call onChange when selecting each view', async function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onChange = spy(); diff --git a/packages/x-date-pickers/src/StaticDatePicker/tests/StaticDatePicker.test.tsx b/packages/x-date-pickers/src/StaticDatePicker/tests/StaticDatePicker.test.tsx index 4041769edcd6..e9410f0f0ef1 100644 --- a/packages/x-date-pickers/src/StaticDatePicker/tests/StaticDatePicker.test.tsx +++ b/packages/x-date-pickers/src/StaticDatePicker/tests/StaticDatePicker.test.tsx @@ -42,9 +42,11 @@ describe('', () => { ); } - it('should take focus when `autoFocus=true`', function test() { + it('should take focus when `autoFocus=true`', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); @@ -53,9 +55,11 @@ describe('', () => { expect(isInside).to.equal(true); }); - it('should not take focus when `autoFocus=false`', function test() { + it('should not take focus when `autoFocus=false`', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); diff --git a/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.test.tsx b/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.test.tsx index f5a04623b4af..39871420ac0c 100644 --- a/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.test.tsx +++ b/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.test.tsx @@ -35,10 +35,12 @@ describe('', () => { ], })); - it('should allow view modification, but not update value when `readOnly` prop is passed', function test() { + it('should allow view modification, but not update value when `readOnly` prop is passed', function test(t = {}) { // Only run in supported browsers if (typeof Touch === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const selectEvent = { changedTouches: [ @@ -85,10 +87,12 @@ describe('', () => { expect(disabledHours.length).to.equal(0); }); - it('should allow switching between views and display disabled options when `disabled` prop is passed', function test() { + it('should allow switching between views and display disabled options when `disabled` prop is passed', function test(t = {}) { // Only run in supported browsers if (typeof Touch === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const selectEvent = { changedTouches: [ diff --git a/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx b/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx index 9fbf3dfcfe98..11558005d7ec 100644 --- a/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx +++ b/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx @@ -180,10 +180,12 @@ describe('', () => { }); }); - it('should display options, but not update value when readOnly prop is passed', function test() { + it('should display options, but not update value when readOnly prop is passed', function test(t = {}) { // Only run in supported browsers if (typeof Touch === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const selectEvent = { changedTouches: [ @@ -208,10 +210,12 @@ describe('', () => { expect(disabledHours.length).to.equal(0); }); - it('should display disabled options when disabled prop is passed', function test() { + it('should display disabled options when disabled prop is passed', function test(t = {}) { // Only run in supported browsers if (typeof Touch === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const selectEvent = { changedTouches: [ @@ -237,12 +241,6 @@ describe('', () => { }); describe('Time validation on touch ', () => { - before(function beforeHook() { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - this.skip(); - } - }); - const clockTouchEvent = { '13:--': { changedTouches: [ @@ -278,7 +276,13 @@ describe('', () => { }, }; - it('should select enabled hour', () => { + it('should select enabled hour', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); const handleViewChange = spy(); render( @@ -301,7 +305,13 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should select enabled minute', () => { + it('should select enabled minute', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); const handleViewChange = spy(); render( @@ -325,7 +335,13 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should not select minute when time is disabled', () => { + it('should not select minute when time is disabled', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select minute when time is disabled (no current value)', () => { + it('should not select minute when time is disabled (no current value)', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select disabled hour', () => { + it('should not select disabled hour', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select disabled hour (no current value)', () => { + it('should not select disabled hour (no current value)', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should visually disable the dates not matching minutesStep', () => { + it('should visually disable the dates not matching minutesStep', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + render( ', () => { expect(screen.getByLabelText('30 minutes')).not.to.have.class('Mui-disabled'); }); - it('should select enabled second', () => { + it('should select enabled second', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); const handleViewChange = spy(); render( @@ -436,7 +482,13 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should not select second when time is disabled', () => { + it('should not select second when time is disabled', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select second when time is disabled (no current value)', () => { + it('should not select second when time is disabled (no current value)', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should select enabled hour on touch and drag', () => { + it('should select enabled hour on touch and drag', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); const handleViewChange = spy(); render( @@ -494,7 +558,13 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should select enabled hour and move to next view on touch end', () => { + it('should select enabled hour and move to next view on touch end', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); const handleViewChange = spy(); render( From bbeed7fa8303baec92b9183c9104321e6421ae7d Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 11 Sep 2024 15:26:34 +0200 Subject: [PATCH 024/119] Revert "fix skips in date pickers" This reverts commit 18b7a5c8c25212fa8d0d42d109c57bf5678885c5. --- .../DateCalendar/tests/DateCalendar.test.tsx | 6 +- .../tests/editing.DateField.test.tsx | 6 +- .../DateField/tests/format.DateField.test.tsx | 6 +- .../tests/DesktopDatePicker.test.tsx | 24 ++-- .../tests/MobileDateTimePicker.test.tsx | 6 +- .../tests/MobileTimePicker.test.tsx | 6 +- .../tests/StaticDatePicker.test.tsx | 12 +- .../StaticTimePicker.test.tsx | 12 +- .../src/TimeClock/tests/TimeClock.test.tsx | 114 ++++-------------- 9 files changed, 51 insertions(+), 141 deletions(-) diff --git a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx index f70a4332e5a6..81833dfd0e52 100644 --- a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx +++ b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx @@ -520,11 +520,9 @@ describe('', () => { expect(screen.getByMuiTest('calendar-month-and-year-text')).to.have.text('January 2022'); }); - it('should scroll to show the selected year', function test(t = {}) { + it('should scroll to show the selected year', function test() { if (isJSDOM) { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); + this.skip(); // Needs layout } render( - Editing', () => { }); }); - it('should support day with letter suffix', function test(t = {}) { + it('should support day with letter suffix', function test() { // Luxon don't have any day format with a letter suffix if (adapter.lib === 'luxon') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); + this.skip(); } testFieldChange({ diff --git a/packages/x-date-pickers/src/DateField/tests/format.DateField.test.tsx b/packages/x-date-pickers/src/DateField/tests/format.DateField.test.tsx index 341770ff553e..67c0df9d5edc 100644 --- a/packages/x-date-pickers/src/DateField/tests/format.DateField.test.tsx +++ b/packages/x-date-pickers/src/DateField/tests/format.DateField.test.tsx @@ -68,14 +68,12 @@ describeAdapters(' - Format', DateField, ({ adapter, renderWithProp expectFieldValueV6(input, 'January Escaped 2019'); }); - it('should support nested escaped characters', function test(t = {}) { + it('should support nested escaped characters', function test() { const { start: startChar, end: endChar } = adapter.escapedCharacters; // If your start character and end character are equal // Then you can't have nested escaped characters if (startChar === endChar) { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); + this.skip(); } // Test with v7 input diff --git a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx index 570731e75b0e..5d90362ce078 100644 --- a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx +++ b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx @@ -101,11 +101,9 @@ describe('', () => { expect(screen.getByRole('radio', { checked: true, name: 'January' })).not.to.equal(null); }); - it('should move the focus to the newly opened views', function test(t = {}) { + it('should move the focus to the newly opened views', function test() { if (isJSDOM) { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); + this.skip(); } render(); @@ -159,6 +157,13 @@ describe('', () => { ); }); + before(function beforeHook() { + // JSDOM has neither layout nor window.scrollTo + if (/jsdom/.test(window.navigator.userAgent)) { + this.skip(); + } + }); + let originalScrollX: number; let originalScrollY: number; @@ -168,17 +173,10 @@ describe('', () => { }); afterEach(() => { - window.scrollTo?.(originalScrollX, originalScrollY); + window.scrollTo(originalScrollX, originalScrollY); }); - it('does not scroll when opened', (t = {}) => { - // JSDOM has neither layout nor window.scrollTo - if (/jsdom/.test(window.navigator.userAgent)) { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('does not scroll when opened', () => { const handleClose = spy(); const handleOpen = spy(); function BottomAnchoredDesktopTimePicker() { diff --git a/packages/x-date-pickers/src/MobileDateTimePicker/tests/MobileDateTimePicker.test.tsx b/packages/x-date-pickers/src/MobileDateTimePicker/tests/MobileDateTimePicker.test.tsx index a1e8409873a8..1e21c3dbc935 100644 --- a/packages/x-date-pickers/src/MobileDateTimePicker/tests/MobileDateTimePicker.test.tsx +++ b/packages/x-date-pickers/src/MobileDateTimePicker/tests/MobileDateTimePicker.test.tsx @@ -104,11 +104,9 @@ describe('', () => { expect(screen.queryByRole('dialog')).toBeVisible(); }); - it('should call onChange when selecting each view', function test(t = {}) { + it('should call onChange when selecting each view', function test() { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); + this.skip(); } const onChange = spy(); diff --git a/packages/x-date-pickers/src/MobileTimePicker/tests/MobileTimePicker.test.tsx b/packages/x-date-pickers/src/MobileTimePicker/tests/MobileTimePicker.test.tsx index 79475e6b8242..62d073d3c10c 100644 --- a/packages/x-date-pickers/src/MobileTimePicker/tests/MobileTimePicker.test.tsx +++ b/packages/x-date-pickers/src/MobileTimePicker/tests/MobileTimePicker.test.tsx @@ -48,11 +48,9 @@ describe('', () => { expect(handleChange.firstCall.args[0]).toEqualDateTime(new Date(2019, 0, 1, 16, 20)); }); - it('should call onChange when selecting each view', async function test(t = {}) { + it('should call onChange when selecting each view', async function test() { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); + this.skip(); } const onChange = spy(); diff --git a/packages/x-date-pickers/src/StaticDatePicker/tests/StaticDatePicker.test.tsx b/packages/x-date-pickers/src/StaticDatePicker/tests/StaticDatePicker.test.tsx index e9410f0f0ef1..4041769edcd6 100644 --- a/packages/x-date-pickers/src/StaticDatePicker/tests/StaticDatePicker.test.tsx +++ b/packages/x-date-pickers/src/StaticDatePicker/tests/StaticDatePicker.test.tsx @@ -42,11 +42,9 @@ describe('', () => { ); } - it('should take focus when `autoFocus=true`', function test(t = {}) { + it('should take focus when `autoFocus=true`', function test() { if (isJSDOM) { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); + this.skip(); } render(); @@ -55,11 +53,9 @@ describe('', () => { expect(isInside).to.equal(true); }); - it('should not take focus when `autoFocus=false`', function test(t = {}) { + it('should not take focus when `autoFocus=false`', function test() { if (isJSDOM) { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); + this.skip(); } render(); diff --git a/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.test.tsx b/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.test.tsx index 39871420ac0c..f5a04623b4af 100644 --- a/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.test.tsx +++ b/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.test.tsx @@ -35,12 +35,10 @@ describe('', () => { ], })); - it('should allow view modification, but not update value when `readOnly` prop is passed', function test(t = {}) { + it('should allow view modification, but not update value when `readOnly` prop is passed', function test() { // Only run in supported browsers if (typeof Touch === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); + this.skip(); } const selectEvent = { changedTouches: [ @@ -87,12 +85,10 @@ describe('', () => { expect(disabledHours.length).to.equal(0); }); - it('should allow switching between views and display disabled options when `disabled` prop is passed', function test(t = {}) { + it('should allow switching between views and display disabled options when `disabled` prop is passed', function test() { // Only run in supported browsers if (typeof Touch === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); + this.skip(); } const selectEvent = { changedTouches: [ diff --git a/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx b/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx index 11558005d7ec..9fbf3dfcfe98 100644 --- a/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx +++ b/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx @@ -180,12 +180,10 @@ describe('', () => { }); }); - it('should display options, but not update value when readOnly prop is passed', function test(t = {}) { + it('should display options, but not update value when readOnly prop is passed', function test() { // Only run in supported browsers if (typeof Touch === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); + this.skip(); } const selectEvent = { changedTouches: [ @@ -210,12 +208,10 @@ describe('', () => { expect(disabledHours.length).to.equal(0); }); - it('should display disabled options when disabled prop is passed', function test(t = {}) { + it('should display disabled options when disabled prop is passed', function test() { // Only run in supported browsers if (typeof Touch === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); + this.skip(); } const selectEvent = { changedTouches: [ @@ -241,6 +237,12 @@ describe('', () => { }); describe('Time validation on touch ', () => { + before(function beforeHook() { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + this.skip(); + } + }); + const clockTouchEvent = { '13:--': { changedTouches: [ @@ -276,13 +278,7 @@ describe('', () => { }, }; - it('should select enabled hour', (t = {}) => { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('should select enabled hour', () => { const handleChange = spy(); const handleViewChange = spy(); render( @@ -305,13 +301,7 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should select enabled minute', (t = {}) => { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('should select enabled minute', () => { const handleChange = spy(); const handleViewChange = spy(); render( @@ -335,13 +325,7 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should not select minute when time is disabled', (t = {}) => { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('should not select minute when time is disabled', () => { const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select minute when time is disabled (no current value)', (t = {}) => { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('should not select minute when time is disabled (no current value)', () => { const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select disabled hour', (t = {}) => { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('should not select disabled hour', () => { const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select disabled hour (no current value)', (t = {}) => { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('should not select disabled hour (no current value)', () => { const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should visually disable the dates not matching minutesStep', (t = {}) => { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('should visually disable the dates not matching minutesStep', () => { render( ', () => { expect(screen.getByLabelText('30 minutes')).not.to.have.class('Mui-disabled'); }); - it('should select enabled second', (t = {}) => { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('should select enabled second', () => { const handleChange = spy(); const handleViewChange = spy(); render( @@ -482,13 +436,7 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should not select second when time is disabled', (t = {}) => { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('should not select second when time is disabled', () => { const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select second when time is disabled (no current value)', (t = {}) => { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('should not select second when time is disabled (no current value)', () => { const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should select enabled hour on touch and drag', (t = {}) => { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('should select enabled hour on touch and drag', () => { const handleChange = spy(); const handleViewChange = spy(); render( @@ -558,13 +494,7 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should select enabled hour and move to next view on touch end', (t = {}) => { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - this?.skip?.() || t?.skip(); - } - + it('should select enabled hour and move to next view on touch end', () => { const handleChange = spy(); const handleViewChange = spy(); render( From 8e375a28d88a61eb630cc8746688dfcbf1afc2c5 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 11 Sep 2024 15:30:00 +0200 Subject: [PATCH 025/119] Add skip logic --- .../DateCalendar/tests/DateCalendar.test.tsx | 6 +- .../tests/editing.DateField.test.tsx | 6 +- .../DateField/tests/format.DateField.test.tsx | 6 +- .../tests/DesktopDatePicker.test.tsx | 24 ++-- .../tests/MobileDateTimePicker.test.tsx | 6 +- .../tests/MobileTimePicker.test.tsx | 6 +- .../tests/StaticDatePicker.test.tsx | 12 +- .../StaticTimePicker.test.tsx | 12 +- .../src/TimeClock/tests/TimeClock.test.tsx | 114 ++++++++++++++---- .../testCalculations.ts | 96 ++++++++++----- .../pickers/describePicker/describePicker.tsx | 54 ++++++--- .../testPickerOpenCloseLifeCycle.tsx | 12 +- 12 files changed, 249 insertions(+), 105 deletions(-) diff --git a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx index 81833dfd0e52..f70a4332e5a6 100644 --- a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx +++ b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx @@ -520,9 +520,11 @@ describe('', () => { expect(screen.getByMuiTest('calendar-month-and-year-text')).to.have.text('January 2022'); }); - it('should scroll to show the selected year', function test() { + it('should scroll to show the selected year', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( - Editing', () => { }); }); - it('should support day with letter suffix', function test() { + it('should support day with letter suffix', function test(t = {}) { // Luxon don't have any day format with a letter suffix if (adapter.lib === 'luxon') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } testFieldChange({ diff --git a/packages/x-date-pickers/src/DateField/tests/format.DateField.test.tsx b/packages/x-date-pickers/src/DateField/tests/format.DateField.test.tsx index 67c0df9d5edc..341770ff553e 100644 --- a/packages/x-date-pickers/src/DateField/tests/format.DateField.test.tsx +++ b/packages/x-date-pickers/src/DateField/tests/format.DateField.test.tsx @@ -68,12 +68,14 @@ describeAdapters(' - Format', DateField, ({ adapter, renderWithProp expectFieldValueV6(input, 'January Escaped 2019'); }); - it('should support nested escaped characters', function test() { + it('should support nested escaped characters', function test(t = {}) { const { start: startChar, end: endChar } = adapter.escapedCharacters; // If your start character and end character are equal // Then you can't have nested escaped characters if (startChar === endChar) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } // Test with v7 input diff --git a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx index 5d90362ce078..570731e75b0e 100644 --- a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx +++ b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx @@ -101,9 +101,11 @@ describe('', () => { expect(screen.getByRole('radio', { checked: true, name: 'January' })).not.to.equal(null); }); - it('should move the focus to the newly opened views', function test() { + it('should move the focus to the newly opened views', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); @@ -157,13 +159,6 @@ describe('', () => { ); }); - before(function beforeHook() { - // JSDOM has neither layout nor window.scrollTo - if (/jsdom/.test(window.navigator.userAgent)) { - this.skip(); - } - }); - let originalScrollX: number; let originalScrollY: number; @@ -173,10 +168,17 @@ describe('', () => { }); afterEach(() => { - window.scrollTo(originalScrollX, originalScrollY); + window.scrollTo?.(originalScrollX, originalScrollY); }); - it('does not scroll when opened', () => { + it('does not scroll when opened', (t = {}) => { + // JSDOM has neither layout nor window.scrollTo + if (/jsdom/.test(window.navigator.userAgent)) { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleClose = spy(); const handleOpen = spy(); function BottomAnchoredDesktopTimePicker() { diff --git a/packages/x-date-pickers/src/MobileDateTimePicker/tests/MobileDateTimePicker.test.tsx b/packages/x-date-pickers/src/MobileDateTimePicker/tests/MobileDateTimePicker.test.tsx index 1e21c3dbc935..a1e8409873a8 100644 --- a/packages/x-date-pickers/src/MobileDateTimePicker/tests/MobileDateTimePicker.test.tsx +++ b/packages/x-date-pickers/src/MobileDateTimePicker/tests/MobileDateTimePicker.test.tsx @@ -104,9 +104,11 @@ describe('', () => { expect(screen.queryByRole('dialog')).toBeVisible(); }); - it('should call onChange when selecting each view', function test() { + it('should call onChange when selecting each view', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onChange = spy(); diff --git a/packages/x-date-pickers/src/MobileTimePicker/tests/MobileTimePicker.test.tsx b/packages/x-date-pickers/src/MobileTimePicker/tests/MobileTimePicker.test.tsx index 62d073d3c10c..79475e6b8242 100644 --- a/packages/x-date-pickers/src/MobileTimePicker/tests/MobileTimePicker.test.tsx +++ b/packages/x-date-pickers/src/MobileTimePicker/tests/MobileTimePicker.test.tsx @@ -48,9 +48,11 @@ describe('', () => { expect(handleChange.firstCall.args[0]).toEqualDateTime(new Date(2019, 0, 1, 16, 20)); }); - it('should call onChange when selecting each view', async function test() { + it('should call onChange when selecting each view', async function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onChange = spy(); diff --git a/packages/x-date-pickers/src/StaticDatePicker/tests/StaticDatePicker.test.tsx b/packages/x-date-pickers/src/StaticDatePicker/tests/StaticDatePicker.test.tsx index 4041769edcd6..e9410f0f0ef1 100644 --- a/packages/x-date-pickers/src/StaticDatePicker/tests/StaticDatePicker.test.tsx +++ b/packages/x-date-pickers/src/StaticDatePicker/tests/StaticDatePicker.test.tsx @@ -42,9 +42,11 @@ describe('', () => { ); } - it('should take focus when `autoFocus=true`', function test() { + it('should take focus when `autoFocus=true`', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); @@ -53,9 +55,11 @@ describe('', () => { expect(isInside).to.equal(true); }); - it('should not take focus when `autoFocus=false`', function test() { + it('should not take focus when `autoFocus=false`', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); diff --git a/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.test.tsx b/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.test.tsx index f5a04623b4af..39871420ac0c 100644 --- a/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.test.tsx +++ b/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.test.tsx @@ -35,10 +35,12 @@ describe('', () => { ], })); - it('should allow view modification, but not update value when `readOnly` prop is passed', function test() { + it('should allow view modification, but not update value when `readOnly` prop is passed', function test(t = {}) { // Only run in supported browsers if (typeof Touch === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const selectEvent = { changedTouches: [ @@ -85,10 +87,12 @@ describe('', () => { expect(disabledHours.length).to.equal(0); }); - it('should allow switching between views and display disabled options when `disabled` prop is passed', function test() { + it('should allow switching between views and display disabled options when `disabled` prop is passed', function test(t = {}) { // Only run in supported browsers if (typeof Touch === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const selectEvent = { changedTouches: [ diff --git a/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx b/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx index 9fbf3dfcfe98..11558005d7ec 100644 --- a/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx +++ b/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx @@ -180,10 +180,12 @@ describe('', () => { }); }); - it('should display options, but not update value when readOnly prop is passed', function test() { + it('should display options, but not update value when readOnly prop is passed', function test(t = {}) { // Only run in supported browsers if (typeof Touch === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const selectEvent = { changedTouches: [ @@ -208,10 +210,12 @@ describe('', () => { expect(disabledHours.length).to.equal(0); }); - it('should display disabled options when disabled prop is passed', function test() { + it('should display disabled options when disabled prop is passed', function test(t = {}) { // Only run in supported browsers if (typeof Touch === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const selectEvent = { changedTouches: [ @@ -237,12 +241,6 @@ describe('', () => { }); describe('Time validation on touch ', () => { - before(function beforeHook() { - if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { - this.skip(); - } - }); - const clockTouchEvent = { '13:--': { changedTouches: [ @@ -278,7 +276,13 @@ describe('', () => { }, }; - it('should select enabled hour', () => { + it('should select enabled hour', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); const handleViewChange = spy(); render( @@ -301,7 +305,13 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should select enabled minute', () => { + it('should select enabled minute', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); const handleViewChange = spy(); render( @@ -325,7 +335,13 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should not select minute when time is disabled', () => { + it('should not select minute when time is disabled', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select minute when time is disabled (no current value)', () => { + it('should not select minute when time is disabled (no current value)', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select disabled hour', () => { + it('should not select disabled hour', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select disabled hour (no current value)', () => { + it('should not select disabled hour (no current value)', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should visually disable the dates not matching minutesStep', () => { + it('should visually disable the dates not matching minutesStep', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + render( ', () => { expect(screen.getByLabelText('30 minutes')).not.to.have.class('Mui-disabled'); }); - it('should select enabled second', () => { + it('should select enabled second', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); const handleViewChange = spy(); render( @@ -436,7 +482,13 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should not select second when time is disabled', () => { + it('should not select second when time is disabled', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select second when time is disabled (no current value)', () => { + it('should not select second when time is disabled (no current value)', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); render( ', () => { expect(handleChange.callCount).to.equal(0); }); - it('should select enabled hour on touch and drag', () => { + it('should select enabled hour on touch and drag', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); const handleViewChange = spy(); render( @@ -494,7 +558,13 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should select enabled hour and move to next view on touch end', () => { + it('should select enabled hour and move to next view on touch end', (t = {}) => { + if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const handleChange = spy(); const handleViewChange = spy(); render( diff --git a/test/utils/pickers/describeGregorianAdapter/testCalculations.ts b/test/utils/pickers/describeGregorianAdapter/testCalculations.ts index 10ef8845ec08..d479c2c27f93 100644 --- a/test/utils/pickers/describeGregorianAdapter/testCalculations.ts +++ b/test/utils/pickers/describeGregorianAdapter/testCalculations.ts @@ -222,9 +222,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ expect(adapter.isEqual(null, testDateLocale)).to.equal(false); }); - it('should work with different timezones', function test() { + it('should work with different timezones', function test(t = {}) { if (!adapter.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const dateInLondonTZ = adapterTZ.setTimezone(testDateIso, 'Europe/London'); @@ -250,9 +252,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ ).to.equal(false); }); - it('should work with different timezones', function test() { + it('should work with different timezones', function test(t = {}) { if (!adapter.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } // Both dates below have the same timestamp, but they are not in the same year when represented in their respective timezone. @@ -283,9 +287,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ ).to.equal(false); }); - it('should work with different timezones', function test() { + it('should work with different timezones', function test(t = {}) { if (!adapter.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } // Both dates below have the same timestamp, but they are not in the same month when represented in their respective timezone. @@ -316,9 +322,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ ); }); - it('should work with different timezones', function test() { + it('should work with different timezones', function test(t = {}) { if (!adapter.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } // Both dates below have the same timestamp, but they are not in the same day when represented in their respective timezone. @@ -343,9 +351,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ ); }); - it('should work with different timezones', function test() { + it('should work with different timezones', function test(t = {}) { if (!adapter.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } // Both dates below have the same timestamp, but they are not in the same day when represented in their respective timezone. @@ -367,9 +377,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ expect(adapter.isAfter(testDateLocale, adapter.date()!)).to.equal(false); }); - it('should work with different timezones', function test() { + it('should work with different timezones', function test(t = {}) { if (!adapter.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const dateInLondonTZ = adapterTZ.endOfDay( @@ -396,9 +408,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ expect(adapter.isAfterYear(testDateLocale, nextYearLocale)).to.equal(false); }); - it('should work with different timezones', function test() { + it('should work with different timezones', function test(t = {}) { if (!adapter.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } // Both dates below have the same timestamp, but they are not in the same year when represented in their respective timezone. @@ -424,9 +438,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ expect(adapter.isAfterDay(testDateLocale, nextDayLocale)).to.equal(false); }); - it('should work with different timezones', function test() { + it('should work with different timezones', function test(t = {}) { if (!adapter.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } // Both dates below have the same timestamp, but they are not in the same day when represented in their respective timezone. @@ -464,9 +480,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ expect(adapter.isBefore(adapter.date()!, testDateLocale)).to.equal(false); }); - it('should work with different timezones', function test() { + it('should work with different timezones', function test(t = {}) { if (!adapter.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const dateInLondonTZ = adapterTZ.endOfDay( @@ -493,9 +511,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ expect(adapter.isBeforeYear(testDateLocale, nextYearLocale)).to.equal(false); }); - it('should work with different timezones', function test() { + it('should work with different timezones', function test(t = {}) { if (!adapter.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } // Both dates below have the same timestamp, but they are not in the same year when represented in their respective timezone. @@ -521,9 +541,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ expect(adapter.isBeforeDay(testDateLocale, previousDayLocale)).to.equal(false); }); - it('should work with different timezones', function test() { + it('should work with different timezones', function test(t = {}) { if (!adapter.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } // Both dates below have the same timestamp, but they are not in the same day when represented in their respective timezone. @@ -659,9 +681,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ expect(adapter.endOfMonth(testDateLocale)).toEqualDateTime(expected); }); - it('should update the offset when entering DST', function test() { + it('should update the offset when entering DST', function test(t = {}) { if (!adapterTZ.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } expectSameTimeInMonacoTZ(adapterTZ, testDateLastNonDSTDay); @@ -692,9 +716,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ expect(adapter.addMonths(testDateIso, 3)).toEqualDateTime('2019-01-30T11:44:00.000Z'); }); - it('should update the offset when entering DST', function test() { + it('should update the offset when entering DST', function test(t = {}) { if (!adapterTZ.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } expectSameTimeInMonacoTZ(adapterTZ, testDateLastNonDSTDay); @@ -708,9 +734,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ expect(adapter.addWeeks(testDateIso, -2)).toEqualDateTime('2018-10-16T11:44:00.000Z'); }); - it('should update the offset when entering DST', function test() { + it('should update the offset when entering DST', function test(t = {}) { if (!adapterTZ.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } expectSameTimeInMonacoTZ(adapterTZ, testDateLastNonDSTDay); @@ -724,9 +752,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ expect(adapter.addDays(testDateIso, -2)).toEqualDateTime('2018-10-28T11:44:00.000Z'); }); - it('should update the offset when entering DST', function test() { + it('should update the offset when entering DST', function test(t = {}) { if (!adapterTZ.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } expectSameTimeInMonacoTZ(adapterTZ, testDateLastNonDSTDay); @@ -833,9 +863,11 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ }); }); - it('should respect the DST', function test() { + it('should respect the DST', function test(t = {}) { if (!adapterTZ.isTimezoneCompatible) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const referenceDate = adapterTZ.date('2022-03-17', 'Europe/Paris'); diff --git a/test/utils/pickers/describePicker/describePicker.tsx b/test/utils/pickers/describePicker/describePicker.tsx index 4332a4c15710..3c5e39dc0351 100644 --- a/test/utils/pickers/describePicker/describePicker.tsx +++ b/test/utils/pickers/describePicker/describePicker.tsx @@ -11,9 +11,11 @@ function innerDescribePicker(ElementToTest: React.ElementType, options: Describe const propsToOpen = variant === 'static' ? {} : { open: true }; - it('should forward the `inputRef` prop to the text field ( textfield DOM structure only)', function test() { + it('should forward the `inputRef` prop to the text field ( textfield DOM structure only)', function test(t = {}) { if (fieldType === 'multi-input' || variant === 'static') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const inputRef = React.createRef(); @@ -23,9 +25,11 @@ function innerDescribePicker(ElementToTest: React.ElementType, options: Describe }); describe('Localization', () => { - it('should respect the `localeText` prop', function test() { + it('should respect the `localeText` prop', function test(t = {}) { if (hasNoView) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -41,9 +45,11 @@ function innerDescribePicker(ElementToTest: React.ElementType, options: Describe }); describe('Component slot: OpenPickerIcon', () => { - it('should render custom component', function test() { + it('should render custom component', function test(t = {}) { if (variant === 'static' || fieldType === 'multi-input') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } function HomeIcon(props: SvgIconProps) { @@ -69,9 +75,11 @@ function innerDescribePicker(ElementToTest: React.ElementType, options: Describe }); describe('Component slot: DesktopPaper', () => { - it('should forward onClick and onTouchStart', function test() { + it('should forward onClick and onTouchStart', function test(t = {}) { if (hasNoView || variant !== 'desktop') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const handleClick = spy(); @@ -99,9 +107,11 @@ function innerDescribePicker(ElementToTest: React.ElementType, options: Describe }); describe('Component slot: Popper', () => { - it('should forward onClick and onTouchStart', function test() { + it('should forward onClick and onTouchStart', function test(t = {}) { if (hasNoView || variant !== 'desktop') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const handleClick = spy(); @@ -129,9 +139,11 @@ function innerDescribePicker(ElementToTest: React.ElementType, options: Describe }); describe('Component slot: Toolbar', () => { - it('should render toolbar on mobile but not on desktop when `hidden` is not defined', function test() { + it('should render toolbar on mobile but not on desktop when `hidden` is not defined', function test(t = {}) { if (hasNoView) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -148,9 +160,11 @@ function innerDescribePicker(ElementToTest: React.ElementType, options: Describe } }); - it('should render toolbar when `hidden` is `false`', function test() { + it('should render toolbar when `hidden` is `false`', function test(t = {}) { if (hasNoView) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -163,9 +177,11 @@ function innerDescribePicker(ElementToTest: React.ElementType, options: Describe expect(screen.getByTestId('pickers-toolbar')).toBeVisible(); }); - it('should not render toolbar when `hidden` is `true`', function test() { + it('should not render toolbar when `hidden` is `true`', function test(t = {}) { if (hasNoView) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -180,9 +196,11 @@ function innerDescribePicker(ElementToTest: React.ElementType, options: Describe }); describe('prop: disableOpenPicker', () => { - it('should not render the open picker button, but still render the picker if its open', function test() { + it('should not render the open picker button, but still render the picker if its open', function test(t = {}) { if (variant === 'static') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( diff --git a/test/utils/pickers/describeValue/testPickerOpenCloseLifeCycle.tsx b/test/utils/pickers/describeValue/testPickerOpenCloseLifeCycle.tsx index 57aa07b9e9c6..26ab3a2056bc 100644 --- a/test/utils/pickers/describeValue/testPickerOpenCloseLifeCycle.tsx +++ b/test/utils/pickers/describeValue/testPickerOpenCloseLifeCycle.tsx @@ -286,10 +286,12 @@ export const testPickerOpenCloseLifeCycle: DescribeValueTestSuite expect(onClose.callCount).to.equal(1); }); - it('should call onClose when clicking outside of the picker without prior change', function test() { + it('should call onClose when clicking outside of the picker without prior change', function test(t = {}) { // TODO: Fix this test and enable it on mobile and date-range if (pickerParams.variant === 'mobile' || isRangeType) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onChange = spy(); @@ -315,10 +317,12 @@ export const testPickerOpenCloseLifeCycle: DescribeValueTestSuite expect(onClose.callCount).to.equal(1); }); - it('should call onClose and onAccept with the live value when clicking outside of the picker', function test() { + it('should call onClose and onAccept with the live value when clicking outside of the picker', function test(t = {}) { // TODO: Fix this test and enable it on mobile and date-range if (pickerParams.variant === 'mobile' || isRangeType) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onChange = spy(); From 3eced208a07db8a4559708128ca3229d4feac9a7 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 11 Sep 2024 16:02:16 +0200 Subject: [PATCH 026/119] Fix low hanging fruits --- .../src/TimeClock/tests/timezone.TimeClock.test.tsx | 10 +++++++++- test/setup.ts | 7 +------ test/utils/pickers/createPickerRenderer.tsx | 3 ++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/x-date-pickers/src/TimeClock/tests/timezone.TimeClock.test.tsx b/packages/x-date-pickers/src/TimeClock/tests/timezone.TimeClock.test.tsx index c3886da5774c..31117cf8d7d3 100644 --- a/packages/x-date-pickers/src/TimeClock/tests/timezone.TimeClock.test.tsx +++ b/packages/x-date-pickers/src/TimeClock/tests/timezone.TimeClock.test.tsx @@ -12,6 +12,12 @@ import { const TIMEZONE_TO_TEST = ['UTC', 'system', 'America/New_York']; +const isVitest = + // VITEST is present on the environment when not in browser mode. + process.env.VITEST === 'true' || + // VITEST_BROWSER_DEBUG is present on vitest in browser mode. + typeof process.env.VITEST_BROWSER_DEBUG !== 'undefined'; + describe(' - Timezone', () => { describeAdapters('Timezone prop', TimeClock, ({ adapter, render }) => { if (!adapter.isTimezoneCompatible) { @@ -33,7 +39,9 @@ describe(' - Timezone', () => { // On dayjs, we are not able to know if a date is UTC because it's the system timezone or because it was created as UTC. // In a real world scenario, this should probably never occur. - expect(adapter.getTimezone(actualDate)).to.equal(adapter.lib === 'dayjs' ? 'UTC' : 'system'); + expect(adapter.getTimezone(actualDate)).to.equal( + adapter.lib === 'dayjs' && !isVitest ? 'UTC' : 'system', + ); expect(actualDate).toEqualDateTime(expectedDate); }); diff --git a/test/setup.ts b/test/setup.ts index f5b177be6d65..8e34fcebb931 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -1,10 +1,5 @@ import { beforeAll, afterAll } from 'vitest'; -import chai from 'chai'; -import chaiDom from 'chai-dom'; -import chaiPlugin from '@mui/internal-test-utils/chaiPlugin'; - -chai.use(chaiDom); -chai.use(chaiPlugin); +import 'test/utils/addChaiAssertions'; // @ts-ignore globalThis.before = beforeAll; diff --git a/test/utils/pickers/createPickerRenderer.tsx b/test/utils/pickers/createPickerRenderer.tsx index 25da543cf517..5dfc92bd0536 100644 --- a/test/utils/pickers/createPickerRenderer.tsx +++ b/test/utils/pickers/createPickerRenderer.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; import { createRenderer, CreateRendererOptions, RenderOptions } from '@mui/internal-test-utils'; import { AdapterClassToUse, AdapterName, adapterToUse, availableAdapters } from './adapters'; +import { vi } from 'vitest'; interface CreatePickerRendererOptions extends CreateRendererOptions { // Set-up locale with date-fns object. Other are deduced from `locale.code` @@ -16,7 +17,7 @@ export function createPickerRenderer({ instance, ...createRendererOptions }: CreatePickerRendererOptions = {}) { - const { clock, render: clientRender } = createRenderer(createRendererOptions); + const { clock, render: clientRender } = createRenderer({ ...createRendererOptions, vi }); let adapterLocale = [ 'date-fns', From 2893eef406f4a4b2f233a19aafbf6659a66f7511 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 11 Sep 2024 16:20:56 +0200 Subject: [PATCH 027/119] Add touch, remove timeout --- test/setup.ts | 27 +++++++++++++++++++ .../testPickerOpenCloseLifeCycle.tsx | 2 -- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/test/setup.ts b/test/setup.ts index 8e34fcebb931..3758e3d50bab 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -5,3 +5,30 @@ import 'test/utils/addChaiAssertions'; globalThis.before = beforeAll; // @ts-ignore globalThis.after = afterAll; + +class Touch { + constructor(instance) { + this.instance = instance; + } + + get identifier() { + return this.instance.identifier; + } + + get pageX() { + return this.instance.pageX; + } + + get pageY() { + return this.instance.pageY; + } + + get clientX() { + return this.instance.clientX; + } + + get clientY() { + return this.instance.clientY; + } +} +globalThis.window.Touch = Touch; diff --git a/test/utils/pickers/describeValue/testPickerOpenCloseLifeCycle.tsx b/test/utils/pickers/describeValue/testPickerOpenCloseLifeCycle.tsx index 26ab3a2056bc..91f60aea3d08 100644 --- a/test/utils/pickers/describeValue/testPickerOpenCloseLifeCycle.tsx +++ b/test/utils/pickers/describeValue/testPickerOpenCloseLifeCycle.tsx @@ -182,8 +182,6 @@ export const testPickerOpenCloseLifeCycle: DescribeValueTestSuite }); it('should not call onClose or onAccept when selecting a date and `props.closeOnSelect` is false', function test() { - // increase the timeout of this test as it tends to sometimes fail on CI with `DesktopDateTimeRangePicker` or `MobileDateTimeRangePicker` - this.timeout(10000); const onChange = spy(); const onAccept = spy(); const onClose = spy(); From 4645e727e4c31a21129eac4c05d6f320b2247518 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 11 Sep 2024 16:21:20 +0200 Subject: [PATCH 028/119] Run test in utc --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b4966dfef440..68fc06f2f916 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "release:tag": "node scripts/releaseTag.mjs", "validate": "concurrently \"pnpm prettier && pnpm eslint\" \"pnpm proptypes\" \"pnpm docs:typescript:formatted\" \"pnpm docs:api\"", "clean:node_modules": "rimraf --glob \"**/node_modules\"", - "vitest": "vitest" + "vitest": "cross-env TZ=UTC vitest" }, "devDependencies": { "@actions/core": "^1.10.1", From a8464a9c161a2e5c2da034c9ebff6cda1a9dd691 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 11 Sep 2024 16:44:54 +0200 Subject: [PATCH 029/119] update config --- vitest.config.mts | 2 ++ vitest.workspace.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vitest.config.mts b/vitest.config.mts index 76ea28f0daa4..c50dc5adf585 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -24,5 +24,7 @@ export default defineConfig({ test: { globals: true, setupFiles: ['test/setup.ts'], + // Required for some datepickers tests that contain early returns. + passWithNoTests: true, }, }); diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 723b73675d06..69bd98b1f3f4 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -1,7 +1,7 @@ import { defineWorkspace } from 'vitest/config'; import react from '@vitejs/plugin-react'; -const packages = ['charts']; +const packages = ['charts', 'date-pickers']; export default defineWorkspace( packages.flatMap((name) => [ From 8f540d7789790575c1d5f62f60e914c9cc1df70b Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 11 Sep 2024 16:51:22 +0200 Subject: [PATCH 030/119] global override pnpm --- package.json | 5 +- packages/x-charts/package.json | 2 +- pnpm-lock.yaml | 90 ++++++++++------------------------ 3 files changed, 30 insertions(+), 67 deletions(-) diff --git a/package.json b/package.json index 68fc06f2f916..d9cacc2913d8 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@mui/icons-material": "^5.16.7", "@mui/internal-babel-plugin-resolve-imports": "1.0.17", "@mui/internal-markdown": "^1.0.12", - "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils", + "@mui/internal-test-utils": "^1.0.12", "@mui/material": "^5.16.7", "@mui/monorepo": "github:mui/material-ui#64aaf564c82cd8bd709116ad38123dbcab8d3bfb", "@mui/utils": "^5.16.6", @@ -205,7 +205,8 @@ "react-is": "^18.3.1", "@types/node": "^20.16.5", "@playwright/test": "1.44.1", - "playwright": "1.44.1" + "playwright": "1.44.1", + "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils" }, "packageManager": "pnpm@9.10.0", "engines": { diff --git a/packages/x-charts/package.json b/packages/x-charts/package.json index 7966165f2806..ebd5bd8c47d7 100644 --- a/packages/x-charts/package.json +++ b/packages/x-charts/package.json @@ -65,7 +65,7 @@ } }, "devDependencies": { - "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils", + "@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/pnpm-lock.yaml b/pnpm-lock.yaml index 4f2599fedac0..309f41715402 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,6 +9,7 @@ overrides: '@types/node': ^20.16.5 '@playwright/test': 1.44.1 playwright: 1.44.1 + '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils patchedDependencies: babel-plugin-replace-imports@1.0.2: @@ -95,8 +96,8 @@ importers: specifier: ^1.0.12 version: 1.0.12 '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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) @@ -766,8 +767,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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) @@ -1010,8 +1011,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - 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) + specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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) @@ -1122,8 +1123,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - 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) + specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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) @@ -1184,8 +1185,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - 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) + specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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) @@ -1237,8 +1238,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.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) + specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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) @@ -1332,8 +1333,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.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) + specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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) @@ -1379,8 +1380,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - 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) + specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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 @@ -1399,8 +1400,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - 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) + specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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 @@ -1443,8 +1444,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.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) + specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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) @@ -1502,8 +1503,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.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) + specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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) @@ -3161,14 +3162,8 @@ packages: '@mui/internal-scripts@1.0.19': resolution: {integrity: sha512-NFyNxOIfrUtn3744rqk4UmkgGfbG7rntHxSFEXGAEy4yQRoEIIbOfHQURKJSupDKyCc48vSFMk+eGbiMBEYpKg==} - '@mui/internal-test-utils@1.0.12': - resolution: {integrity: sha512-D6qc9h2sK2owOMQ68j9yaChr0iNW5mqSrfVGbRJ7NHMeyovkqIMQLHCwvs05d+5cccAeqalvKVsNvK3BkMilEw==} - peerDependencies: - react: ^18.2.0 - react-dom: ^18.2.0 - - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils': - resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils} + '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils': + resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils} version: 1.0.12 peerDependencies: react: ^18.2.0 @@ -12113,40 +12108,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@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) - '@babel/register': 7.24.6(@babel/core@7.25.2) - '@babel/runtime': 7.25.6 - '@emotion/cache': 11.13.1 - '@emotion/react': 11.13.3(@types/react@18.3.4)(react@18.3.1) - '@testing-library/dom': 10.4.0 - '@testing-library/react': 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) - chai: 4.5.0 - chai-dom: 1.12.0(chai@4.5.0) - dom-accessibility-api: 0.7.0 - format-util: 1.0.5 - fs-extra: 11.2.0 - jsdom: 24.1.3 - lodash: 4.17.21 - mocha: 10.7.3 - playwright: 1.44.1 - prop-types: 15.8.1 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - sinon: 18.0.0 - transitivePeerDependencies: - - '@babel/core' - - '@types/react' - - '@types/react-dom' - - bufferutil - - canvas - - supports-color - - utf-8-validate - - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/5fd08300/@mui/internal-test-utils(@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@https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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) From 4507e81e2ecf8f137049d91357e03d20febff396 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 11 Sep 2024 17:08:34 +0200 Subject: [PATCH 031/119] Refactor Touch class to support non-browser mode --- test/setup.ts | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/test/setup.ts b/test/setup.ts index 3758e3d50bab..4a73419fa317 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -6,29 +6,38 @@ globalThis.before = beforeAll; // @ts-ignore globalThis.after = afterAll; -class Touch { - constructor(instance) { - this.instance = instance; - } +const isVitest = + // VITEST is present on the environment when not in browser mode. + process.env.VITEST === 'true'; - get identifier() { - return this.instance.identifier; - } +// Only necessary when not in browser mode. +if (isVitest) { + class Touch { + instance: any; + constructor(instance: any) { + this.instance = instance; + } - get pageX() { - return this.instance.pageX; - } + get identifier() { + return this.instance.identifier; + } - get pageY() { - return this.instance.pageY; - } + get pageX() { + return this.instance.pageX; + } - get clientX() { - return this.instance.clientX; - } + get pageY() { + return this.instance.pageY; + } + + get clientX() { + return this.instance.clientX; + } - get clientY() { - return this.instance.clientY; + get clientY() { + return this.instance.clientY; + } } + // @ts-expect-error + globalThis.window.Touch = Touch; } -globalThis.window.Touch = Touch; From 90754d6fa01f206cb36109ae459e73c282cea1a2 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 11 Sep 2024 17:29:23 +0200 Subject: [PATCH 032/119] divide jsdom/browser tests --- .github/workflows/vitest.yml | 24 ++++++++++++++++--- .../tests/editing.DateField.test.tsx | 6 ++--- vitest.workspace.ts | 4 ++-- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vitest.yml b/.github/workflows/vitest.yml index 8343e89d261a..72fb915a9c17 100644 --- a/.github/workflows/vitest.yml +++ b/.github/workflows/vitest.yml @@ -13,8 +13,8 @@ on: permissions: {} jobs: - benchmarks: - name: Vitest Tests + vitest-jsdom: + name: Vitest Tests (jsdom) runs-on: ubuntu-latest steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 @@ -30,4 +30,22 @@ jobs: - name: Install Playwright Browsers run: pnpm playwright install --with-deps - name: Run Tests - run: pnpm vitest + run: pnpm vitest --project "jsdom/*" + vitest-browser: + name: Vitest Tests (browser) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 + with: + run_install: false + - name: Use Node.js 20.x + uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 + with: + node-version: 20 + cache: 'pnpm' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies + - run: pnpm install --frozen-lockfile + - name: Install Playwright Browsers + run: pnpm playwright install --with-deps + - name: Run Tests + run: pnpm vitest --project "browser/*" diff --git a/packages/x-date-pickers/src/DateField/tests/editing.DateField.test.tsx b/packages/x-date-pickers/src/DateField/tests/editing.DateField.test.tsx index 9ac3fdec4b35..94dd08bb7054 100644 --- a/packages/x-date-pickers/src/DateField/tests/editing.DateField.test.tsx +++ b/packages/x-date-pickers/src/DateField/tests/editing.DateField.test.tsx @@ -2086,8 +2086,8 @@ describe(' - Editing', () => { let originalUserAgent: string = ''; beforeEach(() => { - originalUserAgent = global.navigator.userAgent; - Object.defineProperty(global.navigator, 'userAgent', { + originalUserAgent = globalThis.navigator.userAgent; + Object.defineProperty(globalThis.navigator, 'userAgent', { configurable: true, writable: true, value: @@ -2096,7 +2096,7 @@ describe(' - Editing', () => { }); afterEach(() => { - Object.defineProperty(global.navigator, 'userAgent', { + Object.defineProperty(globalThis.navigator, 'userAgent', { configurable: true, value: originalUserAgent, }); diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 69bd98b1f3f4..211d5ac9b55d 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -10,7 +10,7 @@ export default defineWorkspace( plugins: [react()], test: { include: [`packages/x-${name}/**/*.test.tsx`], - name: `${name}/browser`, + name: `browser/${name}`, browser: { enabled: true, name: 'chromium', @@ -27,7 +27,7 @@ export default defineWorkspace( plugins: [react()], test: { include: [`packages/x-${name}/**/*.test.tsx`], - name: `${name}/jsdom`, + name: `jsdom/${name}`, environment: 'jsdom', }, }, From 8218f0ecc4873c5da31c103ec98d4c1adc65ab9d Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Thu, 12 Sep 2024 11:14:02 +0200 Subject: [PATCH 033/119] fix pickers setup --- test/setup.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/setup.ts b/test/setup.ts index 4a73419fa317..3f9568978bdf 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -1,5 +1,6 @@ import { beforeAll, afterAll } from 'vitest'; import 'test/utils/addChaiAssertions'; +import 'test/utils/setupPickers'; // @ts-ignore globalThis.before = beforeAll; From a9af3e46ef570f21eb55b65ec1d280a5efe32698 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Thu, 12 Sep 2024 11:55:22 +0200 Subject: [PATCH 034/119] Fix date-fns-v3 imports --- vitest.config.mts | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/vitest.config.mts b/vitest.config.mts index c50dc5adf585..638d60689691 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -19,6 +19,23 @@ export default defineConfig({ find: '@mui/x-internals', replacement: new URL('./packages/x-internals/src', import.meta.url).pathname, }, + // Use built in replacements for date-fns and date-fns-jalali + { + find: 'date-fns', + replacement: 'date-fns-v3', + customResolver(source, importer) { + if (importer?.includes('src/AdapterDateFnsV3')) return source; + return null; + }, + }, + { + find: 'date-fns-jalali', + replacement: 'date-fns-jalali-v3', + customResolver(source, importer) { + if (importer?.includes('src/AdapterDateFnsJalaliV3')) return source; + return null; + }, + }, ], }, test: { @@ -28,3 +45,24 @@ export default defineConfig({ passWithNoTests: true, }, }); + +// plugins.push([ +// 'babel-plugin-replace-imports', +// { +// test: /date-fns/i, +// replacer: 'date-fns-v3', +// // This option is provided by the `patches/babel-plugin-replace-imports@1.0.2.patch` patch +// filenameIncludes: 'src/AdapterDateFnsV3/', +// }, +// ]); +// plugins.push([ +// 'babel-plugin-replace-imports', +// { +// test: /date-fns-jalali/i, +// replacer: 'date-fns-jalali-v3', +// // This option is provided by the `patches/babel-plugin-replace-imports@1.0.2.patch` patch +// filenameIncludes: 'src/AdapterDateFnsJalaliV3/', +// }, +// 'replace-date-fns-jalali-imports', +// ]); +// } From 6fffa88a930a9ecd26d08975325c5a27dbae1d37 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Thu, 12 Sep 2024 17:19:33 +0200 Subject: [PATCH 035/119] Ignore datefnsv3 in browser --- vitest.config.mts | 8 +++++-- vitest.workspace.ts | 53 ++++++++++++++++++++++++--------------------- 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/vitest.config.mts b/vitest.config.mts index 638d60689691..77d9b7f87f2b 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -24,7 +24,9 @@ export default defineConfig({ find: 'date-fns', replacement: 'date-fns-v3', customResolver(source, importer) { - if (importer?.includes('src/AdapterDateFnsV3')) return source; + if (importer?.includes('src/AdapterDateFnsV3')) { + return source; + } return null; }, }, @@ -32,7 +34,9 @@ export default defineConfig({ find: 'date-fns-jalali', replacement: 'date-fns-jalali-v3', customResolver(source, importer) { - if (importer?.includes('src/AdapterDateFnsJalaliV3')) return source; + if (importer?.includes('src/AdapterDateFnsJalaliV3')) { + return source; + } return null; }, }, diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 211d5ac9b55d..4a0ca0ca6c3f 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -4,32 +4,35 @@ import react from '@vitejs/plugin-react'; const packages = ['charts', 'date-pickers']; export default defineWorkspace( - packages.flatMap((name) => [ - { - extends: './vitest.config.mts', - plugins: [react()], - test: { - include: [`packages/x-${name}/**/*.test.tsx`], - name: `browser/${name}`, - browser: { - enabled: true, - name: 'chromium', - provider: 'playwright', - headless: true, - // https://playwright.dev - providerOptions: {}, - screenshotFailures: false, + packages.flatMap( + (name): ReturnType => [ + { + extends: './vitest.config.mts', + plugins: [react()], + test: { + include: [`packages/x-${name}/**/*.test.tsx`], + exclude: [`packages/x-${name}/**/*V3.test.tsx`], + name: `browser/${name}`, + browser: { + enabled: true, + name: 'chromium', + provider: 'playwright', + headless: true, + // https://playwright.dev + providerOptions: {}, + screenshotFailures: false, + }, }, }, - }, - { - extends: './vitest.config.mts', - plugins: [react()], - test: { - include: [`packages/x-${name}/**/*.test.tsx`], - name: `jsdom/${name}`, - environment: 'jsdom', + { + extends: './vitest.config.mts', + plugins: [react()], + test: { + include: [`packages/x-${name}/**/*.test.tsx`], + name: `jsdom/${name}`, + environment: 'jsdom', + }, }, - }, - ]), + ], + ), ); From 2b0754e0e5484241d01ed4b17163ed4a7e640196 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Thu, 12 Sep 2024 17:38:13 +0200 Subject: [PATCH 036/119] Revert unnecessary check --- .../src/TimeClock/tests/timezone.TimeClock.test.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/x-date-pickers/src/TimeClock/tests/timezone.TimeClock.test.tsx b/packages/x-date-pickers/src/TimeClock/tests/timezone.TimeClock.test.tsx index 31117cf8d7d3..c3886da5774c 100644 --- a/packages/x-date-pickers/src/TimeClock/tests/timezone.TimeClock.test.tsx +++ b/packages/x-date-pickers/src/TimeClock/tests/timezone.TimeClock.test.tsx @@ -12,12 +12,6 @@ import { const TIMEZONE_TO_TEST = ['UTC', 'system', 'America/New_York']; -const isVitest = - // VITEST is present on the environment when not in browser mode. - process.env.VITEST === 'true' || - // VITEST_BROWSER_DEBUG is present on vitest in browser mode. - typeof process.env.VITEST_BROWSER_DEBUG !== 'undefined'; - describe(' - Timezone', () => { describeAdapters('Timezone prop', TimeClock, ({ adapter, render }) => { if (!adapter.isTimezoneCompatible) { @@ -39,9 +33,7 @@ describe(' - Timezone', () => { // On dayjs, we are not able to know if a date is UTC because it's the system timezone or because it was created as UTC. // In a real world scenario, this should probably never occur. - expect(adapter.getTimezone(actualDate)).to.equal( - adapter.lib === 'dayjs' && !isVitest ? 'UTC' : 'system', - ); + expect(adapter.getTimezone(actualDate)).to.equal(adapter.lib === 'dayjs' ? 'UTC' : 'system'); expect(actualDate).toEqualDateTime(expectedDate); }); From 23925ac65442c4ba6860fe78ca15527c32941c45 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Thu, 12 Sep 2024 22:07:09 +0200 Subject: [PATCH 037/119] jsdom working for charts and datepickers --- .../src/AdapterMoment/AdapterMoment.test.tsx | 4 ++++ .../tests/localization.DateCalendar.test.tsx | 23 +++++++++++------- .../tests/DesktopDatePicker.test.tsx | 2 +- .../src/internals/utils/date-utils.test.ts | 4 ++-- test/setup.ts | 2 ++ test/utils/pickers/createPickerRenderer.tsx | 2 +- .../testCalculations.ts | 5 ++++ .../testLocalization.ts | 5 ++++ vitest.config.mts | 24 +++---------------- vitest.workspace.ts | 13 +++++++--- 10 files changed, 48 insertions(+), 36 deletions(-) diff --git a/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx b/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx index fa684d96e860..e29237af2fbf 100644 --- a/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx +++ b/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx @@ -25,8 +25,12 @@ describe('', () => { frenchLocale: 'fr', }; + moment.locale('en'); + describeGregorianAdapter(AdapterMoment, commonParams); + moment.locale('en'); + // Makes sure that all the tests that do not use timezones works fine when dayjs do not support UTC / timezone. describeGregorianAdapter(AdapterMoment, { ...commonParams, diff --git a/packages/x-date-pickers/src/DateCalendar/tests/localization.DateCalendar.test.tsx b/packages/x-date-pickers/src/DateCalendar/tests/localization.DateCalendar.test.tsx index 1efabf353318..a5d5d66d4f50 100644 --- a/packages/x-date-pickers/src/DateCalendar/tests/localization.DateCalendar.test.tsx +++ b/packages/x-date-pickers/src/DateCalendar/tests/localization.DateCalendar.test.tsx @@ -9,27 +9,34 @@ import 'dayjs/locale/he'; import 'dayjs/locale/fr'; import 'moment/locale/he'; import 'moment/locale/fr'; +import moment from 'moment'; const ADAPTERS_TO_USE: AdapterName[] = ['date-fns', 'dayjs', 'luxon', 'moment']; describe(' - localization', () => { ADAPTERS_TO_USE.forEach((adapterName) => { describe(`with '${adapterName}'`, () => { - const { render } = createPickerRenderer({ - locale: adapterName === 'date-fns' ? he : { code: 'he' }, - adapterName, - }); + describe('with wrapper', () => { + const { render } = createPickerRenderer({ + locale: adapterName === 'date-fns' ? he : { code: 'he' }, + adapterName, + }); - it('should display correct week day labels in Hebrew locale ', () => { - render(); + it('should display correct week day labels in Hebrew locale ', () => { + render(); - expect(screen.getByText('א')).toBeVisible(); + expect(screen.getByText('א')).toBeVisible(); + }); }); describe('without wrapper', () => { const { render: renderWithoutWrapper } = createRenderer(); - it('should correctly switch between locale with week starting in Monday and week starting in Sunday', () => { + it('should correctly switch between locale with week starting in Monday and week starting in Sunday', async () => { + if (adapterName === 'moment') { + moment.locale('en'); + } + const { setProps } = renderWithoutWrapper( diff --git a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx index 570731e75b0e..d985d81e2d80 100644 --- a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx +++ b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx @@ -173,7 +173,7 @@ describe('', () => { it('does not scroll when opened', (t = {}) => { // JSDOM has neither layout nor window.scrollTo - if (/jsdom/.test(window.navigator.userAgent)) { + if (/jsdom/.test(window.navigator.userAgent) || process.env.MUI_BROWSER === 'true') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions this?.skip?.() || t?.skip(); diff --git a/packages/x-date-pickers/src/internals/utils/date-utils.test.ts b/packages/x-date-pickers/src/internals/utils/date-utils.test.ts index a9d642959c4e..bb13bf147ef8 100644 --- a/packages/x-date-pickers/src/internals/utils/date-utils.test.ts +++ b/packages/x-date-pickers/src/internals/utils/date-utils.test.ts @@ -116,7 +116,7 @@ describe('findClosestEnabledDate', () => { }); expect(result).toEqualDateTime(adapterToUse.addDays(tryDate, 1)); - clock.reset(); + clock.restore(); }); it('should return `null` when disablePast+disableFuture and now is invalid', () => { @@ -180,7 +180,7 @@ describe('findClosestEnabledDate', () => { }); expect(result).toEqualDateTime(adapterToUse.date('2000-01-02T11:12:13.550Z')); - clock.reset(); + clock.restore(); }); it('should return maxDate if it is before the date and valid', () => { diff --git a/test/setup.ts b/test/setup.ts index 3f9568978bdf..4f3411a86468 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -1,6 +1,7 @@ import { beforeAll, afterAll } from 'vitest'; import 'test/utils/addChaiAssertions'; import 'test/utils/setupPickers'; +import 'test/utils/licenseRelease'; // @ts-ignore globalThis.before = beforeAll; @@ -15,6 +16,7 @@ const isVitest = if (isVitest) { class Touch { instance: any; + constructor(instance: any) { this.instance = instance; } diff --git a/test/utils/pickers/createPickerRenderer.tsx b/test/utils/pickers/createPickerRenderer.tsx index 5dfc92bd0536..5323eeccee4c 100644 --- a/test/utils/pickers/createPickerRenderer.tsx +++ b/test/utils/pickers/createPickerRenderer.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; import { createRenderer, CreateRendererOptions, RenderOptions } from '@mui/internal-test-utils'; -import { AdapterClassToUse, AdapterName, adapterToUse, availableAdapters } from './adapters'; import { vi } from 'vitest'; +import { AdapterClassToUse, AdapterName, adapterToUse, availableAdapters } from './adapters'; interface CreatePickerRendererOptions extends CreateRendererOptions { // Set-up locale with date-fns object. Other are deduced from `locale.code` diff --git a/test/utils/pickers/describeGregorianAdapter/testCalculations.ts b/test/utils/pickers/describeGregorianAdapter/testCalculations.ts index d479c2c27f93..62d86974c3da 100644 --- a/test/utils/pickers/describeGregorianAdapter/testCalculations.ts +++ b/test/utils/pickers/describeGregorianAdapter/testCalculations.ts @@ -1,6 +1,7 @@ import { expect } from 'chai'; import { MuiPickersAdapter, PickersTimezone, PickerValidDate } from '@mui/x-date-pickers/models'; import { getDateOffset } from 'test/utils/pickers'; +import moment from 'moment'; import { DescribeGregorianAdapterTestSuite } from './describeGregorianAdapter.types'; import { TEST_DATE_ISO_STRING, TEST_DATE_LOCALE_STRING } from './describeGregorianAdapter.utils'; @@ -889,6 +890,10 @@ export const testCalculations: DescribeGregorianAdapterTestSuite = ({ }); it('should respect the locale of the adapter, not the locale of the date', function test() { + if (adapter.lib === 'moment') { + moment.locale('en'); + } + const dateFr = adapterFr.date('2022-03-17', 'default'); const weekArray = adapter.getWeekArray(dateFr); diff --git a/test/utils/pickers/describeGregorianAdapter/testLocalization.ts b/test/utils/pickers/describeGregorianAdapter/testLocalization.ts index a63d1e0cf851..2064d9672ad3 100644 --- a/test/utils/pickers/describeGregorianAdapter/testLocalization.ts +++ b/test/utils/pickers/describeGregorianAdapter/testLocalization.ts @@ -1,6 +1,7 @@ import { expect } from 'chai'; import { AdapterFormats } from '@mui/x-date-pickers/models'; import { cleanText } from 'test/utils/pickers'; +import moment from 'moment'; import { DescribeGregorianAdapterTestSuite } from './describeGregorianAdapter.types'; import { TEST_DATE_ISO_STRING } from './describeGregorianAdapter.utils'; @@ -42,6 +43,10 @@ export const testLocalization: DescribeGregorianAdapterTestSuite = ({ adapter }) }); it('Method: getCurrentLocaleCode', () => { + if (adapter.lib === 'moment') { + moment.locale('en'); + } + // Returns the default locale expect(adapter.getCurrentLocaleCode()).to.match(/en/); }); diff --git a/vitest.config.mts b/vitest.config.mts index 77d9b7f87f2b..7d6eecb8bf01 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -47,26 +47,8 @@ export default defineConfig({ setupFiles: ['test/setup.ts'], // Required for some datepickers tests that contain early returns. passWithNoTests: true, + env: { + MUI_VITEST: 'true', + }, }, }); - -// plugins.push([ -// 'babel-plugin-replace-imports', -// { -// test: /date-fns/i, -// replacer: 'date-fns-v3', -// // This option is provided by the `patches/babel-plugin-replace-imports@1.0.2.patch` patch -// filenameIncludes: 'src/AdapterDateFnsV3/', -// }, -// ]); -// plugins.push([ -// 'babel-plugin-replace-imports', -// { -// test: /date-fns-jalali/i, -// replacer: 'date-fns-jalali-v3', -// // This option is provided by the `patches/babel-plugin-replace-imports@1.0.2.patch` patch -// filenameIncludes: 'src/AdapterDateFnsJalaliV3/', -// }, -// 'replace-date-fns-jalali-imports', -// ]); -// } diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 4a0ca0ca6c3f..8ca730a0c6d9 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -10,9 +10,12 @@ export default defineWorkspace( extends: './vitest.config.mts', plugins: [react()], test: { - include: [`packages/x-${name}/**/*.test.tsx`], - exclude: [`packages/x-${name}/**/*V3.test.tsx`], + include: [`packages/x-${name}/src/**/*.test.{ts,tsx,js,jsx}`], + exclude: [`packages/x-${name}/src/**/*V3.test.{ts,tsx,js,jsx}`], name: `browser/${name}`, + env: { + MUI_BROWSER: 'true', + }, browser: { enabled: true, name: 'chromium', @@ -28,9 +31,13 @@ export default defineWorkspace( extends: './vitest.config.mts', plugins: [react()], test: { - include: [`packages/x-${name}/**/*.test.tsx`], + include: [`packages/x-${name}/src/**/*.test.{ts,tsx,js,jsx}`], + exclude: [`packages/x-${name}/src/**/*.browser.test.{ts,tsx,js,jsx}`], name: `jsdom/${name}`, environment: 'jsdom', + env: { + MUI_JSDOM: 'true', + }, }, }, ], From 5c85b9faf2bfba49d308638c77dc1aed88f914af Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 13 Sep 2024 13:56:21 +0200 Subject: [PATCH 038/119] add small config changes --- test/setup.ts | 6 ++---- vitest.workspace.ts | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/setup.ts b/test/setup.ts index 4f3411a86468..9b1a10c68a9d 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -8,12 +8,10 @@ globalThis.before = beforeAll; // @ts-ignore globalThis.after = afterAll; -const isVitest = - // VITEST is present on the environment when not in browser mode. - process.env.VITEST === 'true'; +const isVitestJsdom = process.env.MUI_JSDOM === 'true'; // Only necessary when not in browser mode. -if (isVitest) { +if (isVitestJsdom) { class Touch { instance: any; diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 8ca730a0c6d9..7cd40a27b279 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -3,6 +3,10 @@ import react from '@vitejs/plugin-react'; const packages = ['charts', 'date-pickers']; +// Ideally we move the configuration to each package. +// Currently it doesn't work because vitest doesn't detect two different configurations in the same package. +// We could bypass this limitation by having a folder per configuration. + export default defineWorkspace( packages.flatMap( (name): ReturnType => [ From f1269fd363d3fc341bbab97baf5d623974f30e41 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 13 Sep 2024 14:17:24 +0200 Subject: [PATCH 039/119] import vitest only if in vitest --- test/utils/pickers/createPickerRenderer.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/utils/pickers/createPickerRenderer.tsx b/test/utils/pickers/createPickerRenderer.tsx index 5323eeccee4c..f4e453e665b0 100644 --- a/test/utils/pickers/createPickerRenderer.tsx +++ b/test/utils/pickers/createPickerRenderer.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; import { createRenderer, CreateRendererOptions, RenderOptions } from '@mui/internal-test-utils'; -import { vi } from 'vitest'; import { AdapterClassToUse, AdapterName, adapterToUse, availableAdapters } from './adapters'; interface CreatePickerRendererOptions extends CreateRendererOptions { @@ -11,6 +10,12 @@ interface CreatePickerRendererOptions extends CreateRendererOptions { instance?: any; } +let vi: any; + +if (process.env.MUI_VITEST === 'true') { + vi = (await import('vitest')).vi; +} + export function createPickerRenderer({ locale, adapterName, From 3e2fbe4dee2ba73366754642226807e83cf7d212 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 13 Sep 2024 14:33:05 +0200 Subject: [PATCH 040/119] types/chai clash with vitest --- package.json | 1 - pnpm-lock.yaml | 6 ------ test/package.json | 1 - 3 files changed, 8 deletions(-) diff --git a/package.json b/package.json index d9cacc2913d8..fde91f610da3 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,6 @@ "@testing-library/react": "^16.0.1", "@types/babel__core": "^7.20.5", "@types/babel__traverse": "^7.20.6", - "@types/chai": "^4.3.19", "@types/chai-dom": "^1.11.3", "@types/fs-extra": "^11.0.4", "@types/karma": "^6.3.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 309f41715402..4d3a0f695530 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,9 +128,6 @@ importers: '@types/babel__traverse': specifier: ^7.20.6 version: 7.20.6 - '@types/chai': - specifier: ^4.3.19 - version: 4.3.19 '@types/chai-dom': specifier: ^1.11.3 version: 1.11.3 @@ -1560,9 +1557,6 @@ importers: '@react-spring/web': specifier: ^9.7.4 version: 9.7.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@types/chai': - specifier: ^4.3.19 - version: 4.3.19 '@types/karma': specifier: ^6.3.8 version: 6.3.8 diff --git a/test/package.json b/test/package.json index 1544d72be679..dd2526f5f9ca 100644 --- a/test/package.json +++ b/test/package.json @@ -19,7 +19,6 @@ "@mui/x-date-pickers-pro": "workspace:*", "@mui/x-license": "workspace:*", "@react-spring/web": "^9.7.4", - "@types/chai": "^4.3.19", "@types/karma": "^6.3.8", "@types/moment-jalaali": "^0.7.9", "@types/prop-types": "^15.7.12", From e396545d8f4eda4a424dc442428340eb59fb2926 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 13 Sep 2024 14:46:00 +0200 Subject: [PATCH 041/119] Use global vi --- package.json | 2 +- pnpm-lock.yaml | 54 ++++++++++----------- test/utils/pickers/createPickerRenderer.tsx | 12 ++--- 3 files changed, 33 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 6a5a5cf4b5d0..8e713d449362 100644 --- a/package.json +++ b/package.json @@ -206,7 +206,7 @@ "@types/node": "^20.16.5", "@playwright/test": "1.44.1", "playwright": "1.44.1", - "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils" + "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils" }, "packageManager": "pnpm@9.10.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58bce6a1a1d5..cdcfa9a1bdd1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,7 +9,7 @@ overrides: '@types/node': ^20.16.5 '@playwright/test': 1.44.1 playwright: 1.44.1 - '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils + '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils patchedDependencies: babel-plugin-replace-imports@1.0.2: @@ -96,8 +96,8 @@ importers: specifier: ^1.0.12 version: 1.0.12 '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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) @@ -780,8 +780,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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) @@ -1024,8 +1024,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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) @@ -1136,8 +1136,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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) @@ -1198,8 +1198,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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) @@ -1251,8 +1251,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: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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) @@ -1346,8 +1346,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: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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) @@ -1393,8 +1393,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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 @@ -1413,8 +1413,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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 @@ -1457,8 +1457,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: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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) @@ -1516,8 +1516,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: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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) @@ -3172,9 +3172,9 @@ packages: '@mui/internal-scripts@1.0.19': resolution: {integrity: sha512-NFyNxOIfrUtn3744rqk4UmkgGfbG7rntHxSFEXGAEy4yQRoEIIbOfHQURKJSupDKyCc48vSFMk+eGbiMBEYpKg==} - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils': - resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils} - version: 1.0.12 + '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils': + resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils} + version: 1.0.13 peerDependencies: react: ^18.2.0 react-dom: ^18.2.0 @@ -12124,7 +12124,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/ae23bac4/@mui/internal-test-utils(@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@https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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) diff --git a/test/utils/pickers/createPickerRenderer.tsx b/test/utils/pickers/createPickerRenderer.tsx index f4e453e665b0..7bda8acb1dc7 100644 --- a/test/utils/pickers/createPickerRenderer.tsx +++ b/test/utils/pickers/createPickerRenderer.tsx @@ -10,19 +10,17 @@ interface CreatePickerRendererOptions extends CreateRendererOptions { instance?: any; } -let vi: any; - -if (process.env.MUI_VITEST === 'true') { - vi = (await import('vitest')).vi; -} - export function createPickerRenderer({ locale, adapterName, instance, ...createRendererOptions }: CreatePickerRendererOptions = {}) { - const { clock, render: clientRender } = createRenderer({ ...createRendererOptions, vi }); + const { clock, render: clientRender } = createRenderer({ + ...createRendererOptions, + // @ts-expect-error is global + vi, + }); let adapterLocale = [ 'date-fns', From 5121079a506e1e3536a4bedf2d5448d3543bcd33 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 13 Sep 2024 15:22:41 +0200 Subject: [PATCH 042/119] Use globalThis.vi --- test/utils/pickers/createPickerRenderer.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/utils/pickers/createPickerRenderer.tsx b/test/utils/pickers/createPickerRenderer.tsx index 7bda8acb1dc7..880110e4048a 100644 --- a/test/utils/pickers/createPickerRenderer.tsx +++ b/test/utils/pickers/createPickerRenderer.tsx @@ -18,8 +18,7 @@ export function createPickerRenderer({ }: CreatePickerRendererOptions = {}) { const { clock, render: clientRender } = createRenderer({ ...createRendererOptions, - // @ts-expect-error is global - vi, + vi: globalThis.vi ?? undefined, }); let adapterLocale = [ From 570e9390857893f8129df64e5220e877d13c3b46 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 13 Sep 2024 15:57:47 +0200 Subject: [PATCH 043/119] Fix test functions without closure --- .../tests/DesktopDatePicker.test.tsx | 8 ++++--- .../src/TimeClock/tests/TimeClock.test.tsx | 24 +++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx index d985d81e2d80..3adfc21cfe1f 100644 --- a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx +++ b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx @@ -168,12 +168,14 @@ describe('', () => { }); afterEach(() => { - window.scrollTo?.(originalScrollX, originalScrollY); + if (isJSDOM || process.env.MUI_BROWSER === 'true') { + window.scrollTo?.(originalScrollX, originalScrollY); + } }); - it('does not scroll when opened', (t = {}) => { + it('does not scroll when opened', function test(t = {}) { // JSDOM has neither layout nor window.scrollTo - if (/jsdom/.test(window.navigator.userAgent) || process.env.MUI_BROWSER === 'true') { + if (isJSDOM || process.env.MUI_BROWSER === 'true') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions this?.skip?.() || t?.skip(); diff --git a/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx b/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx index 11558005d7ec..0d331f84aec6 100644 --- a/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx +++ b/packages/x-date-pickers/src/TimeClock/tests/TimeClock.test.tsx @@ -276,7 +276,7 @@ describe('', () => { }, }; - it('should select enabled hour', (t = {}) => { + it('should select enabled hour', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -305,7 +305,7 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should select enabled minute', (t = {}) => { + it('should select enabled minute', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -335,7 +335,7 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should not select minute when time is disabled', (t = {}) => { + it('should not select minute when time is disabled', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -359,7 +359,7 @@ describe('', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select minute when time is disabled (no current value)', (t = {}) => { + it('should not select minute when time is disabled (no current value)', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -383,7 +383,7 @@ describe('', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select disabled hour', (t = {}) => { + it('should not select disabled hour', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -407,7 +407,7 @@ describe('', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select disabled hour (no current value)', (t = {}) => { + it('should not select disabled hour (no current value)', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -431,7 +431,7 @@ describe('', () => { expect(handleChange.callCount).to.equal(0); }); - it('should visually disable the dates not matching minutesStep', (t = {}) => { + it('should visually disable the dates not matching minutesStep', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -452,7 +452,7 @@ describe('', () => { expect(screen.getByLabelText('30 minutes')).not.to.have.class('Mui-disabled'); }); - it('should select enabled second', (t = {}) => { + it('should select enabled second', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -482,7 +482,7 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should not select second when time is disabled', (t = {}) => { + it('should not select second when time is disabled', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -506,7 +506,7 @@ describe('', () => { expect(handleChange.callCount).to.equal(0); }); - it('should not select second when time is disabled (no current value)', (t = {}) => { + it('should not select second when time is disabled (no current value)', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -530,7 +530,7 @@ describe('', () => { expect(handleChange.callCount).to.equal(0); }); - it('should select enabled hour on touch and drag', (t = {}) => { + it('should select enabled hour on touch and drag', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -558,7 +558,7 @@ describe('', () => { expect(handleViewChange.callCount).to.equal(0); }); - it('should select enabled hour and move to next view on touch end', (t = {}) => { + it('should select enabled hour and move to next view on touch end', function test(t = {}) { if (typeof window.Touch === 'undefined' || typeof window.TouchEvent === 'undefined') { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions From 8812678b6ffd00c89f7976e031a9b4f233c10fe8 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 16 Sep 2024 15:23:02 +0200 Subject: [PATCH 044/119] browser only test example --- .eslintrc.js | 18 +- package.json | 4 +- .../tests/DesktopDatePicker.browser.test.tsx | 89 +++++++ packages/x-date-pickers/tsconfig.json | 3 +- pnpm-lock.yaml | 236 ++++++++++++++++-- tsconfig.json | 1 + vitest.workspace.ts | 13 +- 7 files changed, 329 insertions(+), 35 deletions(-) create mode 100644 packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.browser.test.tsx diff --git a/.eslintrc.js b/.eslintrc.js index d7b85f4b16de..319c98fb3388 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -37,7 +37,7 @@ const addReactCompilerRule = (packagesNames, isEnabled) => !isEnabled ? [] : packagesNames.map((packageName) => ({ - files: [`packages/${packageName}/src/**/*{.ts,.tsx,.js}`], + files: [`packages/${packageName}/src/**/*.?(c|m)[jt]s?(x)`], rules: { 'react-compiler/react-compiler': 'error', }, @@ -58,7 +58,7 @@ const RESTRICTED_TOP_LEVEL_IMPORTS = [ // It needs to know about the parent "no-restricted-imports" to not override them. const buildPackageRestrictedImports = (packageName, root, allowRootImports = true) => [ { - files: [`packages/${root}/src/**/*{.ts,.tsx,.js}`], + files: [`packages/${root}/src/**/*.?(c|m)[jt]s?(x)`], excludedFiles: ['*.d.ts', '*.spec.ts', '*.spec.tsx', '**.test.tx', '**.test.tsx'], rules: { 'no-restricted-imports': [ @@ -94,8 +94,8 @@ const buildPackageRestrictedImports = (packageName, root, allowRootImports = tru : [ { files: [ - `packages/${root}/src/**/*.test{.ts,.tsx,.js}`, - `packages/${root}/src/**/*.spec{.ts,.tsx,.js}`, + `packages/${root}/src/**/*.test.?(c|m)[jt]s?(x)`, + `packages/${root}/src/**/*.spec.?(c|m)[jt]s?(x)`, ], excludedFiles: ['*.d.ts'], rules: { @@ -244,7 +244,7 @@ module.exports = { }, }, { - files: ['packages/*/src/**/*{.ts,.tsx,.js}'], + files: ['packages/*/src/**/*.?(c|m)[jt]s?(x)'], excludedFiles: ['*.d.ts', '*.spec.ts', '*.spec.tsx'], rules: { 'material-ui/mui-name-matches-component-name': [ @@ -267,7 +267,7 @@ module.exports = { }, }, { - files: ['docs/**/*{.ts,.tsx,.js}'], + files: ['docs/**/*.?(c|m)[jt]s?(x)'], excludedFiles: ['*.d.ts'], rules: { 'no-restricted-imports': [ @@ -297,6 +297,12 @@ module.exports = { ], }, }, + { + files: ['**/*.browser.test.?(c|m)[jt]s?(x)'], + rules: { + 'testing-library/prefer-screen-queries': 'off', + }, + }, ...buildPackageRestrictedImports('@mui/x-charts', 'x-charts', false), ...buildPackageRestrictedImports('@mui/x-charts-pro', 'x-charts-pro', false), ...buildPackageRestrictedImports('@mui/x-codemod', 'x-codemod', false), diff --git a/package.json b/package.json index 8e713d449362..d4d30e07f9fc 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", "@vitejs/plugin-react": "^4.3.1", - "@vitest/browser": "^2.0.5", + "@vitest/browser": "^2.1.1", "autoprefixer": "^10.4.20", "axe-core": "4.10.0", "babel-loader": "^9.1.3", @@ -195,7 +195,7 @@ "typescript": "^5.5.4", "unist-util-visit": "^5.0.0", "util": "^0.12.5", - "vitest": "2.0.5", + "vitest": "2.1.1", "webpack": "^5.94.0", "webpack-bundle-analyzer": "^4.10.2", "webpack-cli": "^5.1.4", diff --git a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.browser.test.tsx b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.browser.test.tsx new file mode 100644 index 000000000000..2181ddc14696 --- /dev/null +++ b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.browser.test.tsx @@ -0,0 +1,89 @@ +import { page } from '@vitest/browser/context'; +import * as React from 'react'; +import { describe, expect, it } from 'vitest'; +import { TransitionProps } from '@mui/material/transitions'; +import { spy } from 'sinon'; +import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker'; +import { createPickerRenderer, adapterToUse } from 'test/utils/pickers'; +import { act } from '@mui/internal-test-utils'; + +// Alternative on how we could write browser tests + +describe('DesktopDatePicker (browser)', () => { + const { render } = createPickerRenderer(); + + const NoTransition = React.forwardRef(function NoTransition( + props: TransitionProps & { children?: React.ReactNode }, + ref: React.Ref, + ) { + const { children, in: inProp } = props; + + if (!inProp) { + return null; + } + return ( +
+ {children} +
+ ); + }); + + let originalScrollX: number; + let originalScrollY: number; + + beforeEach(() => { + originalScrollX = window.screenX; + originalScrollY = window.scrollY; + }); + + afterEach(() => { + window.scrollTo?.(originalScrollX, originalScrollY); + }); + + it('does not scroll when opened', async () => { + const handleClose = spy(); + const handleOpen = spy(); + function BottomAnchoredDesktopTimePicker() { + const [anchorEl, anchorElRef] = React.useState(null); + + React.useEffect(() => { + if (anchorEl !== null) { + window.scrollTo(0, anchorEl.getBoundingClientRect().top); + } + }, [anchorEl]); + + return ( + +
Spacer
+ +
+ ); + } + render(); + const scrollYBeforeOpen = window.scrollY; + + await expect.element(page.getByRole('button', { name: /choose date/i })).toBeInTheDocument(); + + await act(async () => { + await page.getByRole('button', { name: /choose date/i }).click({ + timeout: 10000, + }); + }); + + expect(handleClose.callCount).to.equal(0); + expect(handleOpen.callCount).to.equal(1); + expect(window.scrollY, 'focus caused scroll').to.equal(scrollYBeforeOpen); + }); +}); diff --git a/packages/x-date-pickers/tsconfig.json b/packages/x-date-pickers/tsconfig.json index 5f862d31ec2b..2cffb9a5455a 100644 --- a/packages/x-date-pickers/tsconfig.json +++ b/packages/x-date-pickers/tsconfig.json @@ -6,7 +6,8 @@ "@mui/material/themeCssVarsAugmentation", "chai-dom", "mocha", - "node" + "node", + "@vitest/browser/providers/playwright" ], "noImplicitAny": false }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cdcfa9a1bdd1..2e8e12623da0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -174,8 +174,8 @@ importers: specifier: ^4.3.1 version: 4.3.1(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0)) '@vitest/browser': - specifier: ^2.0.5 - version: 2.0.5(playwright@1.44.1)(typescript@5.5.4)(vitest@2.0.5) + specifier: ^2.1.1 + version: 2.1.1(@vitest/spy@2.1.1)(playwright@1.44.1)(typescript@5.5.4)(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.1.1) autoprefixer: specifier: ^10.4.20 version: 10.4.20(postcss@8.4.45) @@ -399,8 +399,8 @@ importers: specifier: ^0.12.5 version: 0.12.5 vitest: - specifier: 2.0.5 - version: 2.0.5(@types/node@20.16.5)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) + specifier: 2.1.1 + version: 2.1.1(@types/node@20.16.5)(@vitest/browser@2.1.1)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0) webpack: specifier: ^5.94.0 version: 5.94.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.94.0)) @@ -3102,8 +3102,8 @@ packages: '@jridgewell/source-map@0.3.5': resolution: {integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==} - '@jridgewell/sourcemap-codec@1.4.15': - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + '@jridgewell/sourcemap-codec@1.5.0': + resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} @@ -4462,21 +4462,63 @@ packages: webdriverio: optional: true + '@vitest/browser@2.1.1': + resolution: {integrity: sha512-wLKqohwlZI24xMIEZAPwv9SVliv1avaIBeE0ou471D++BRPhiw2mubKBczFFIDHXuSL7UXb8/JQK9Ui6ttW9bQ==} + peerDependencies: + playwright: 1.44.1 + safaridriver: '*' + vitest: 2.1.1 + webdriverio: '*' + peerDependenciesMeta: + playwright: + optional: true + safaridriver: + optional: true + webdriverio: + optional: true + '@vitest/expect@2.0.5': resolution: {integrity: sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==} + '@vitest/expect@2.1.1': + resolution: {integrity: sha512-YeueunS0HiHiQxk+KEOnq/QMzlUuOzbU1Go+PgAsHvvv3tUkJPm9xWt+6ITNTlzsMXUjmgm5T+U7KBPK2qQV6w==} + + '@vitest/mocker@2.1.1': + resolution: {integrity: sha512-LNN5VwOEdJqCmJ/2XJBywB11DLlkbY0ooDJW3uRX5cZyYCrc4PI/ePX0iQhE3BiEGiQmK4GE7Q/PqCkkaiPnrA==} + peerDependencies: + '@vitest/spy': 2.1.1 + msw: ^2.3.5 + vite: ^5.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + '@vitest/pretty-format@2.0.5': resolution: {integrity: sha512-h8k+1oWHfwTkyTkb9egzwNMfJAEx4veaPSnMeKbVSjp4euqGSbQlm5+6VHwTr7u4FJslVVsUG5nopCaAYdOmSQ==} + '@vitest/pretty-format@2.1.1': + resolution: {integrity: sha512-SjxPFOtuINDUW8/UkElJYQSFtnWX7tMksSGW0vfjxMneFqxVr8YJ979QpMbDW7g+BIiq88RAGDjf7en6rvLPPQ==} + '@vitest/runner@2.0.5': resolution: {integrity: sha512-TfRfZa6Bkk9ky4tW0z20WKXFEwwvWhRY+84CnSEtq4+3ZvDlJyY32oNTJtM7AW9ihW90tX/1Q78cb6FjoAs+ig==} + '@vitest/runner@2.1.1': + resolution: {integrity: sha512-uTPuY6PWOYitIkLPidaY5L3t0JJITdGTSwBtwMjKzo5O6RCOEncz9PUN+0pDidX8kTHYjO0EwUIvhlGpnGpxmA==} + '@vitest/snapshot@2.0.5': resolution: {integrity: sha512-SgCPUeDFLaM0mIUHfaArq8fD2WbaXG/zVXjRupthYfYGzc8ztbFbu6dUNOblBG7XLMR1kEhS/DNnfCZ2IhdDew==} + '@vitest/snapshot@2.1.1': + resolution: {integrity: sha512-BnSku1WFy7r4mm96ha2FzN99AZJgpZOWrAhtQfoxjUU5YMRpq1zmHRq7a5K9/NjqonebO7iVDla+VvZS8BOWMw==} + '@vitest/spy@2.0.5': resolution: {integrity: sha512-c/jdthAhvJdpfVuaexSrnawxZz6pywlTPe84LUB2m/4t3rl2fTo9NFGBG4oWgaD+FTgDDV8hJ/nibT7IfH3JfA==} + '@vitest/spy@2.1.1': + resolution: {integrity: sha512-ZM39BnZ9t/xZ/nF4UwRH5il0Sw93QnZXd9NAZGRpIgj0yvVwPpLd702s/Cx955rGaMlyBQkZJ2Ir7qyY48VZ+g==} + '@vitest/ui@2.0.5': resolution: {integrity: sha512-m+ZpVt/PVi/nbeRKEjdiYeoh0aOfI9zr3Ria9LO7V2PlMETtAXJS3uETEZkc8Be2oOl8mhd7Ew+5SRBXRYncNw==} peerDependencies: @@ -4485,6 +4527,9 @@ packages: '@vitest/utils@2.0.5': resolution: {integrity: sha512-d8HKbqIcya+GR67mkZbrzhS5kKhtp8dQLcmRZLGTscGVg7yImT82cIrhtn2L8+VujWcy6KZweApgNmPsTAO/UQ==} + '@vitest/utils@2.1.1': + resolution: {integrity: sha512-Y6Q9TsI+qJ2CC0ZKj6VBb+T8UPz593N113nnUykqwANqhgf3QkZeHFlusgKLTqrnVHbj/XDKZcDHol+dxVT+rQ==} + '@webassemblyjs/ast@1.12.1': resolution: {integrity: sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==} @@ -7666,8 +7711,8 @@ packages: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} hasBin: true - magic-string@0.30.10: - resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} + magic-string@0.30.11: + resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} make-array@1.0.5: resolution: {integrity: sha512-sgK2SAzxT19rWU+qxKUcn6PAh/swiIiz2F8C2cZjLc1z4iwYIfdoihqFIDQ8BDzAGtWPYJ6Sr13K1j/DXynDLA==} @@ -9623,8 +9668,11 @@ packages: tiny-warning@1.0.3: resolution: {integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==} - tinybench@2.8.0: - resolution: {integrity: sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==} + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@0.3.0: + resolution: {integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==} tinypool@1.0.0: resolution: {integrity: sha512-KIKExllK7jp3uvrNtvRBYBWBOAXSX8ZvoaD8T+7KB/QHIuoJW3Pmr60zucywjAlMb5TeXUkcs/MWeWLu0qvuAQ==} @@ -9988,6 +10036,11 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true + vite-node@2.1.1: + resolution: {integrity: sha512-N/mGckI1suG/5wQI35XeR9rsMsPqKXzq1CdUndzVstBj/HvyxxGctwnK6WX43NGt5L3Z5tcRf83g4TITKJhPrA==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + vite@5.3.4: resolution: {integrity: sha512-Cw+7zL3ZG9/NZBB8C+8QbQZmR54GwqIz+WMI4b3JgdYJvX+ny9AjJXqkGQlDXSXRP9rP0B4tbciRMOVEKulVOA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -10041,6 +10094,31 @@ packages: jsdom: optional: true + vitest@2.1.1: + resolution: {integrity: sha512-97We7/VC0e9X5zBVkvt7SGQMGrRtn3KtySFQG5fpaMlS+l62eeXRQO633AYhSTC3z7IMebnPPNjGXVGNRFlxBA==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/node': ^20.16.5 + '@vitest/browser': 2.1.1 + '@vitest/ui': 2.1.1 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + void-elements@2.0.1: resolution: {integrity: sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==} engines: {node: '>=0.10.0'} @@ -11938,7 +12016,7 @@ snapshots: '@jridgewell/gen-mapping@0.3.5': dependencies: '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 '@jridgewell/trace-mapping': 0.3.25 '@jridgewell/resolve-uri@3.1.1': {} @@ -11950,12 +12028,12 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@jridgewell/sourcemap-codec@1.4.15': {} + '@jridgewell/sourcemap-codec@1.5.0': {} '@jridgewell/trace-mapping@0.3.25': dependencies: '@jridgewell/resolve-uri': 3.1.1 - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 '@lerna/create@8.1.8(@swc/core@1.6.13(@swc/helpers@0.5.5))(babel-plugin-macros@3.1.0)(encoding@0.1.13)(typescript@5.5.4)': dependencies: @@ -13612,7 +13690,7 @@ snapshots: '@testing-library/dom': 10.4.0 '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) '@vitest/utils': 2.0.5 - magic-string: 0.30.10 + magic-string: 0.30.11 msw: 2.4.4(typescript@5.5.4) sirv: 2.0.4 vitest: 2.0.5(@types/node@20.16.5)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) @@ -13623,6 +13701,28 @@ snapshots: - bufferutil - typescript - utf-8-validate + optional: true + + '@vitest/browser@2.1.1(@vitest/spy@2.1.1)(playwright@1.44.1)(typescript@5.5.4)(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.1.1)': + dependencies: + '@testing-library/dom': 10.4.0 + '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) + '@vitest/mocker': 2.1.1(@vitest/spy@2.1.1)(msw@2.4.4(typescript@5.5.4))(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0)) + '@vitest/utils': 2.1.1 + magic-string: 0.30.11 + msw: 2.4.4(typescript@5.5.4) + sirv: 2.0.4 + tinyrainbow: 1.2.0 + vitest: 2.1.1(@types/node@20.16.5)(@vitest/browser@2.1.1)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0) + ws: 8.18.0 + optionalDependencies: + playwright: 1.44.1 + transitivePeerDependencies: + - '@vitest/spy' + - bufferutil + - typescript + - utf-8-validate + - vite '@vitest/expect@2.0.5': dependencies: @@ -13631,25 +13731,60 @@ snapshots: chai: 5.1.1 tinyrainbow: 1.2.0 + '@vitest/expect@2.1.1': + dependencies: + '@vitest/spy': 2.1.1 + '@vitest/utils': 2.1.1 + chai: 5.1.1 + tinyrainbow: 1.2.0 + + '@vitest/mocker@2.1.1(@vitest/spy@2.1.1)(msw@2.4.4(typescript@5.5.4))(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))': + dependencies: + '@vitest/spy': 2.1.1 + estree-walker: 3.0.3 + magic-string: 0.30.11 + optionalDependencies: + msw: 2.4.4(typescript@5.5.4) + vite: 5.3.4(@types/node@20.16.5)(terser@5.27.0) + '@vitest/pretty-format@2.0.5': dependencies: tinyrainbow: 1.2.0 + '@vitest/pretty-format@2.1.1': + dependencies: + tinyrainbow: 1.2.0 + '@vitest/runner@2.0.5': dependencies: '@vitest/utils': 2.0.5 pathe: 1.1.2 + '@vitest/runner@2.1.1': + dependencies: + '@vitest/utils': 2.1.1 + pathe: 1.1.2 + '@vitest/snapshot@2.0.5': dependencies: '@vitest/pretty-format': 2.0.5 - magic-string: 0.30.10 + magic-string: 0.30.11 + pathe: 1.1.2 + + '@vitest/snapshot@2.1.1': + dependencies: + '@vitest/pretty-format': 2.1.1 + magic-string: 0.30.11 pathe: 1.1.2 '@vitest/spy@2.0.5': dependencies: tinyspy: 3.0.0 + '@vitest/spy@2.1.1': + dependencies: + tinyspy: 3.0.0 + '@vitest/ui@2.0.5(vitest@2.0.5)': dependencies: '@vitest/utils': 2.0.5 @@ -13668,6 +13803,12 @@ snapshots: loupe: 3.1.1 tinyrainbow: 1.2.0 + '@vitest/utils@2.1.1': + dependencies: + '@vitest/pretty-format': 2.1.1 + loupe: 3.1.1 + tinyrainbow: 1.2.0 + '@webassemblyjs/ast@1.12.1': dependencies: '@webassemblyjs/helper-numbers': 1.11.6 @@ -17541,9 +17682,9 @@ snapshots: lz-string@1.5.0: {} - magic-string@0.30.10: + magic-string@0.30.11: dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 make-array@1.0.5: {} @@ -19872,7 +20013,9 @@ snapshots: tiny-warning@1.0.3: {} - tinybench@2.8.0: {} + tinybench@2.9.0: {} + + tinyexec@0.3.0: {} tinypool@1.0.0: {} @@ -20228,6 +20371,22 @@ snapshots: - supports-color - terser + vite-node@2.1.1(@types/node@20.16.5)(terser@5.27.0): + dependencies: + cac: 6.7.14 + debug: 4.3.6(supports-color@8.1.1) + pathe: 1.1.2 + vite: 5.3.4(@types/node@20.16.5)(terser@5.27.0) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + vite@5.3.4(@types/node@20.16.5)(terser@5.27.0): dependencies: esbuild: 0.21.5 @@ -20242,7 +20401,7 @@ snapshots: dependencies: '@ampproject/remapping': 2.3.0 '@vitest/expect': 2.0.5 - '@vitest/pretty-format': 2.0.5 + '@vitest/pretty-format': 2.1.1 '@vitest/runner': 2.0.5 '@vitest/snapshot': 2.0.5 '@vitest/spy': 2.0.5 @@ -20250,10 +20409,10 @@ snapshots: chai: 5.1.1 debug: 4.3.6(supports-color@8.1.1) execa: 8.0.1 - magic-string: 0.30.10 + magic-string: 0.30.11 pathe: 1.1.2 std-env: 3.7.0 - tinybench: 2.8.0 + tinybench: 2.9.0 tinypool: 1.0.0 tinyrainbow: 1.2.0 vite: 5.3.4(@types/node@20.16.5)(terser@5.27.0) @@ -20273,6 +20432,41 @@ snapshots: - supports-color - terser + vitest@2.1.1(@types/node@20.16.5)(@vitest/browser@2.1.1)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0): + dependencies: + '@vitest/expect': 2.1.1 + '@vitest/mocker': 2.1.1(@vitest/spy@2.1.1)(msw@2.4.4(typescript@5.5.4))(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0)) + '@vitest/pretty-format': 2.1.1 + '@vitest/runner': 2.1.1 + '@vitest/snapshot': 2.1.1 + '@vitest/spy': 2.1.1 + '@vitest/utils': 2.1.1 + chai: 5.1.1 + debug: 4.3.6(supports-color@8.1.1) + magic-string: 0.30.11 + pathe: 1.1.2 + std-env: 3.7.0 + tinybench: 2.9.0 + tinyexec: 0.3.0 + tinypool: 1.0.0 + tinyrainbow: 1.2.0 + vite: 5.3.4(@types/node@20.16.5)(terser@5.27.0) + vite-node: 2.1.1(@types/node@20.16.5)(terser@5.27.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 20.16.5 + '@vitest/browser': 2.1.1(@vitest/spy@2.1.1)(playwright@1.44.1)(typescript@5.5.4)(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.1.1) + jsdom: 24.1.3 + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - stylus + - sugarss + - supports-color + - terser + void-elements@2.0.1: {} w3c-xmlserializer@5.0.0: diff --git a/tsconfig.json b/tsconfig.json index a83b65a5e4b7..b44a09769cb8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ "strict": true, "baseUrl": "./", "allowJs": true, + "types": ["@vitest/browser/providers/playwright"], "paths": { "@mui/x-data-grid": ["./packages/x-data-grid/src"], "@mui/x-data-grid/*": ["./packages/x-data-grid/src/*"], diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 7cd40a27b279..ee117aff773e 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -5,7 +5,7 @@ const packages = ['charts', 'date-pickers']; // Ideally we move the configuration to each package. // Currently it doesn't work because vitest doesn't detect two different configurations in the same package. -// We could bypass this limitation by having a folder per configuration. +// We could bypass this limitation by having a folder per configuration. Eg: `packages/x-charts/browser` & `packages/x-charts/jsdom`. export default defineWorkspace( packages.flatMap( @@ -14,8 +14,11 @@ export default defineWorkspace( extends: './vitest.config.mts', plugins: [react()], test: { - include: [`packages/x-${name}/src/**/*.test.{ts,tsx,js,jsx}`], - exclude: [`packages/x-${name}/src/**/*V3.test.{ts,tsx,js,jsx}`], + include: [`packages/x-${name}/src/**/*.test.?(c|m)[jt]s?(x)`], + exclude: [ + `packages/x-${name}/src/**/*.jsdom.test.?(c|m)[jt]s?(x)`, + `packages/x-${name}/src/**/*V3.test.?(c|m)[jt]s?(x)`, + ], name: `browser/${name}`, env: { MUI_BROWSER: 'true', @@ -35,8 +38,8 @@ export default defineWorkspace( extends: './vitest.config.mts', plugins: [react()], test: { - include: [`packages/x-${name}/src/**/*.test.{ts,tsx,js,jsx}`], - exclude: [`packages/x-${name}/src/**/*.browser.test.{ts,tsx,js,jsx}`], + include: [`packages/x-${name}/src/**/*.test.?(c|m)[jt]s?(x)`], + exclude: [`packages/x-${name}/src/**/*.browser.test.?(c|m)[jt]s?(x)`], name: `jsdom/${name}`, environment: 'jsdom', env: { From a06bb502bf4fbcd9f872a19e7eded8f8cd316dfe Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 16 Sep 2024 15:23:14 +0200 Subject: [PATCH 045/119] Fix moment imports --- .../src/AdapterMoment/AdapterMoment.test.tsx | 6 +++--- .../AdapterMomentHijri/AdapterMomentHijri.test.tsx | 2 +- .../AdapterMomentJalaali.test.tsx | 2 +- .../tests/localization.DateCalendar.test.tsx | 4 ++-- .../tests/DesktopDatePicker.test.tsx | 11 +++++++---- .../fixtures/DatePicker/MomentJalaliDateCalendar.tsx | 2 +- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx b/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx index e29237af2fbf..4d191d34cf4d 100644 --- a/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx +++ b/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx @@ -12,9 +12,9 @@ import { TEST_DATE_ISO_STRING, buildFieldInteractions, } from 'test/utils/pickers'; -import 'moment/locale/de'; -import 'moment/locale/fr'; -import 'moment/locale/ko'; +import 'moment/dist/locale/de'; +import 'moment/dist/locale/fr'; +import 'moment/dist/locale/ko'; describe('', () => { const commonParams = { diff --git a/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx b/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx index bd86f319abe6..e4045cd7c951 100644 --- a/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx +++ b/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx @@ -9,7 +9,7 @@ import { describeHijriAdapter, buildFieldInteractions, } from 'test/utils/pickers'; -import 'moment/locale/ar'; +import 'moment/dist/locale/ar'; describe('', () => { describeHijriAdapter(AdapterMomentHijri, { diff --git a/packages/x-date-pickers/src/AdapterMomentJalaali/AdapterMomentJalaali.test.tsx b/packages/x-date-pickers/src/AdapterMomentJalaali/AdapterMomentJalaali.test.tsx index 9a30e357c05d..8cb1544738f8 100644 --- a/packages/x-date-pickers/src/AdapterMomentJalaali/AdapterMomentJalaali.test.tsx +++ b/packages/x-date-pickers/src/AdapterMomentJalaali/AdapterMomentJalaali.test.tsx @@ -10,7 +10,7 @@ import { buildFieldInteractions, } from 'test/utils/pickers'; import { AdapterFormats } from '@mui/x-date-pickers/models'; -import 'moment/locale/fa'; +import 'moment/dist/locale/fa'; describe('', () => { describeJalaliAdapter(AdapterMomentJalaali, { diff --git a/packages/x-date-pickers/src/DateCalendar/tests/localization.DateCalendar.test.tsx b/packages/x-date-pickers/src/DateCalendar/tests/localization.DateCalendar.test.tsx index a5d5d66d4f50..4fe3bba1d156 100644 --- a/packages/x-date-pickers/src/DateCalendar/tests/localization.DateCalendar.test.tsx +++ b/packages/x-date-pickers/src/DateCalendar/tests/localization.DateCalendar.test.tsx @@ -7,8 +7,8 @@ import { createPickerRenderer, AdapterName, availableAdapters } from 'test/utils import { he, fr } from 'date-fns/locale'; import 'dayjs/locale/he'; import 'dayjs/locale/fr'; -import 'moment/locale/he'; -import 'moment/locale/fr'; +import 'moment/dist/locale/he'; +import 'moment/dist/locale/fr'; import moment from 'moment'; const ADAPTERS_TO_USE: AdapterName[] = ['date-fns', 'dayjs', 'luxon', 'moment']; diff --git a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx index 3adfc21cfe1f..1f2606f79403 100644 --- a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx +++ b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.test.tsx @@ -3,7 +3,7 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { TransitionProps } from '@mui/material/transitions'; import { inputBaseClasses } from '@mui/material/InputBase'; -import { fireEvent, screen } from '@mui/internal-test-utils'; +import { act, fireEvent, screen } from '@mui/internal-test-utils'; import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker'; import { createPickerRenderer, adapterToUse, openPicker } from 'test/utils/pickers'; @@ -168,14 +168,14 @@ describe('', () => { }); afterEach(() => { - if (isJSDOM || process.env.MUI_BROWSER === 'true') { + if (!isJSDOM) { window.scrollTo?.(originalScrollX, originalScrollY); } }); it('does not scroll when opened', function test(t = {}) { // JSDOM has neither layout nor window.scrollTo - if (isJSDOM || process.env.MUI_BROWSER === 'true') { + if (isJSDOM) { // @ts-expect-error to support mocha and vitest // eslint-disable-next-line @typescript-eslint/no-unused-expressions this?.skip?.() || t?.skip(); @@ -214,7 +214,10 @@ describe('', () => { render(); const scrollYBeforeOpen = window.scrollY; - fireEvent.click(screen.getByLabelText(/choose date/i)); + // Can't use `userEvent.click` as it scrolls the window before it clicks on browsers. + act(() => { + screen.getByLabelText(/choose date/i).click(); + }); expect(handleClose.callCount).to.equal(0); expect(handleOpen.callCount).to.equal(1); diff --git a/test/e2e/fixtures/DatePicker/MomentJalaliDateCalendar.tsx b/test/e2e/fixtures/DatePicker/MomentJalaliDateCalendar.tsx index aabca41feb74..9ba98b56fd17 100644 --- a/test/e2e/fixtures/DatePicker/MomentJalaliDateCalendar.tsx +++ b/test/e2e/fixtures/DatePicker/MomentJalaliDateCalendar.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; import { AdapterMomentJalaali } from '@mui/x-date-pickers/AdapterMomentJalaali'; import moment from 'moment-jalaali'; -import 'moment/locale/fa'; +import 'moment/dist/locale/fa'; import { DateCalendar } from '@mui/x-date-pickers/DateCalendar'; export default function MomentJalaliDateCalendar() { From f3da2754193c0115c639e292f2c3a1b8b1e80e81 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 16 Sep 2024 15:39:26 +0200 Subject: [PATCH 046/119] fix russian tests --- packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx b/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx index 4d191d34cf4d..bf033ff530dc 100644 --- a/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx +++ b/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx @@ -15,6 +15,7 @@ import { import 'moment/dist/locale/de'; import 'moment/dist/locale/fr'; import 'moment/dist/locale/ko'; +import 'moment/dist/locale/ru'; describe('', () => { const commonParams = { From 7ba380b7be0c0b9724a42eb3b9fb4e82458e211d Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 16 Sep 2024 16:17:43 +0200 Subject: [PATCH 047/119] fix field keyboard test --- .../src/tests/fieldKeyboardInteraction.test.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/x-date-pickers/src/tests/fieldKeyboardInteraction.test.tsx b/packages/x-date-pickers/src/tests/fieldKeyboardInteraction.test.tsx index 3d7436f158ea..b90a92f43357 100644 --- a/packages/x-date-pickers/src/tests/fieldKeyboardInteraction.test.tsx +++ b/packages/x-date-pickers/src/tests/fieldKeyboardInteraction.test.tsx @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import moment from 'moment/moment'; +import moment from 'moment'; import jMoment from 'moment-jalaali'; import { fireEvent } from '@mui/internal-test-utils'; import { @@ -15,6 +15,7 @@ import { getDateSectionConfigFromFormatToken, cleanLeadingZeros, } from '../internals/hooks/useField/useField.utils'; +import 'moment/dist/locale/fa'; const testDate = '2018-05-15T09:35:10'; @@ -213,7 +214,7 @@ adapterToTest.forEach((adapterName) => { adapterName, }); - before(() => { + beforeEach(() => { if (adapterName === 'moment-jalaali') { jMoment.loadPersian(); } else if (adapterName === 'moment') { @@ -221,7 +222,7 @@ adapterToTest.forEach((adapterName) => { } }); - after(() => { + afterEach(() => { if (adapterName === 'moment-jalaali') { moment.locale('en'); } From ca22dde678144d15c29eb56927b70a05bb4f4f25 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 16 Sep 2024 17:42:32 +0200 Subject: [PATCH 048/119] Fix karma config --- test/karma.tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/karma.tests.js b/test/karma.tests.js index e041b5849b8c..7d585bfb04af 100644 --- a/test/karma.tests.js +++ b/test/karma.tests.js @@ -18,5 +18,5 @@ afterEach(function beforeEachHook() { }); }); -const packagesContext = require.context('../packages', true, /\.test\.tsx$/); +const packagesContext = require.context('../packages', true, /^((?!browser|jsdom).)*\.test\.tsx$/); packagesContext.keys().forEach(packagesContext); From ff6c7156642849a0689d950fa0b92e04305c6d1e Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 16 Sep 2024 22:25:06 +0200 Subject: [PATCH 049/119] mocha ignore browser/jsdom extensions --- .mocharc.js | 7 +++++-- .../src/AdapterMoment/AdapterMoment.test.tsx | 8 ++++---- .../src/AdapterMomentHijri/AdapterMomentHijri.test.tsx | 2 +- .../AdapterMomentJalaali/AdapterMomentJalaali.test.tsx | 2 +- .../DateCalendar/tests/localization.DateCalendar.test.tsx | 4 ++-- .../src/tests/fieldKeyboardInteraction.test.tsx | 2 +- vitest.config.mts | 4 ++++ 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.mocharc.js b/.mocharc.js index 3f1b312f2f7c..4cd5bea32607 100644 --- a/.mocharc.js +++ b/.mocharc.js @@ -1,12 +1,15 @@ // We can't import the `.mocharc.js` of the monorepo, otherwise we trigger its `setupBabel`. + module.exports = { - extension: ['js', 'ts', 'tsx'], + extension: ['js', 'ts', 'tsx', 'jsx'], ignore: [ '**/build/**', '**/node_modules/**', // Mocha seems to ignore .next anyway (maybe because dotfiles?). // We're leaving this to make sure. 'docs/.next/**', + 'packages/**/*.browser.test.{js,ts,tsx,jsx}', + 'packages/**/*.jsdom.test.{js,ts,tsx,jsx}', ], recursive: true, timeout: (process.env.CIRCLECI === 'true' ? 5 : 2) * 1000, // Circle CI has low-performance CPUs. @@ -21,5 +24,5 @@ module.exports = { '**/build/**', 'docs/.next/**', ], - spec: ['packages/**/*.test.{js,ts,tsx}', 'docs/src/modules/**/*.test.{js,ts,tsx}'], + spec: ['packages/**/*.test.{js,ts,tsx,jsx}', 'docs/src/modules/**/*.test.{js,ts,tsx,jsx}'], }; diff --git a/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx b/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx index bf033ff530dc..1f4608158062 100644 --- a/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx +++ b/packages/x-date-pickers/src/AdapterMoment/AdapterMoment.test.tsx @@ -12,10 +12,10 @@ import { TEST_DATE_ISO_STRING, buildFieldInteractions, } from 'test/utils/pickers'; -import 'moment/dist/locale/de'; -import 'moment/dist/locale/fr'; -import 'moment/dist/locale/ko'; -import 'moment/dist/locale/ru'; +import 'moment/locale/de'; +import 'moment/locale/fr'; +import 'moment/locale/ko'; +import 'moment/locale/ru'; describe('', () => { const commonParams = { diff --git a/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx b/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx index e4045cd7c951..bd86f319abe6 100644 --- a/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx +++ b/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx @@ -9,7 +9,7 @@ import { describeHijriAdapter, buildFieldInteractions, } from 'test/utils/pickers'; -import 'moment/dist/locale/ar'; +import 'moment/locale/ar'; describe('', () => { describeHijriAdapter(AdapterMomentHijri, { diff --git a/packages/x-date-pickers/src/AdapterMomentJalaali/AdapterMomentJalaali.test.tsx b/packages/x-date-pickers/src/AdapterMomentJalaali/AdapterMomentJalaali.test.tsx index 8cb1544738f8..9a30e357c05d 100644 --- a/packages/x-date-pickers/src/AdapterMomentJalaali/AdapterMomentJalaali.test.tsx +++ b/packages/x-date-pickers/src/AdapterMomentJalaali/AdapterMomentJalaali.test.tsx @@ -10,7 +10,7 @@ import { buildFieldInteractions, } from 'test/utils/pickers'; import { AdapterFormats } from '@mui/x-date-pickers/models'; -import 'moment/dist/locale/fa'; +import 'moment/locale/fa'; describe('', () => { describeJalaliAdapter(AdapterMomentJalaali, { diff --git a/packages/x-date-pickers/src/DateCalendar/tests/localization.DateCalendar.test.tsx b/packages/x-date-pickers/src/DateCalendar/tests/localization.DateCalendar.test.tsx index 4fe3bba1d156..a5d5d66d4f50 100644 --- a/packages/x-date-pickers/src/DateCalendar/tests/localization.DateCalendar.test.tsx +++ b/packages/x-date-pickers/src/DateCalendar/tests/localization.DateCalendar.test.tsx @@ -7,8 +7,8 @@ import { createPickerRenderer, AdapterName, availableAdapters } from 'test/utils import { he, fr } from 'date-fns/locale'; import 'dayjs/locale/he'; import 'dayjs/locale/fr'; -import 'moment/dist/locale/he'; -import 'moment/dist/locale/fr'; +import 'moment/locale/he'; +import 'moment/locale/fr'; import moment from 'moment'; const ADAPTERS_TO_USE: AdapterName[] = ['date-fns', 'dayjs', 'luxon', 'moment']; diff --git a/packages/x-date-pickers/src/tests/fieldKeyboardInteraction.test.tsx b/packages/x-date-pickers/src/tests/fieldKeyboardInteraction.test.tsx index b90a92f43357..6348a9b046b2 100644 --- a/packages/x-date-pickers/src/tests/fieldKeyboardInteraction.test.tsx +++ b/packages/x-date-pickers/src/tests/fieldKeyboardInteraction.test.tsx @@ -15,7 +15,7 @@ import { getDateSectionConfigFromFormatToken, cleanLeadingZeros, } from '../internals/hooks/useField/useField.utils'; -import 'moment/dist/locale/fa'; +import 'moment/locale/fa'; const testDate = '2018-05-15T09:35:10'; diff --git a/vitest.config.mts b/vitest.config.mts index 7d6eecb8bf01..8ce53f0bab1f 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -40,6 +40,10 @@ export default defineConfig({ return null; }, }, + { + find: 'moment/locale', + replacement: 'moment/dist/locale', + }, ], }, test: { From 90d0af7383b3477c55b0273cfe9dc73b6fe40f82 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 16 Sep 2024 22:54:08 +0200 Subject: [PATCH 050/119] Remove browser example to fix typescript --- .../tests/DesktopDatePicker.browser.test.tsx | 89 ------------------- packages/x-date-pickers/tsconfig.json | 3 +- tsconfig.json | 1 - 3 files changed, 1 insertion(+), 92 deletions(-) delete mode 100644 packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.browser.test.tsx diff --git a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.browser.test.tsx b/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.browser.test.tsx deleted file mode 100644 index 2181ddc14696..000000000000 --- a/packages/x-date-pickers/src/DesktopDatePicker/tests/DesktopDatePicker.browser.test.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { page } from '@vitest/browser/context'; -import * as React from 'react'; -import { describe, expect, it } from 'vitest'; -import { TransitionProps } from '@mui/material/transitions'; -import { spy } from 'sinon'; -import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker'; -import { createPickerRenderer, adapterToUse } from 'test/utils/pickers'; -import { act } from '@mui/internal-test-utils'; - -// Alternative on how we could write browser tests - -describe('DesktopDatePicker (browser)', () => { - const { render } = createPickerRenderer(); - - const NoTransition = React.forwardRef(function NoTransition( - props: TransitionProps & { children?: React.ReactNode }, - ref: React.Ref, - ) { - const { children, in: inProp } = props; - - if (!inProp) { - return null; - } - return ( -
- {children} -
- ); - }); - - let originalScrollX: number; - let originalScrollY: number; - - beforeEach(() => { - originalScrollX = window.screenX; - originalScrollY = window.scrollY; - }); - - afterEach(() => { - window.scrollTo?.(originalScrollX, originalScrollY); - }); - - it('does not scroll when opened', async () => { - const handleClose = spy(); - const handleOpen = spy(); - function BottomAnchoredDesktopTimePicker() { - const [anchorEl, anchorElRef] = React.useState(null); - - React.useEffect(() => { - if (anchorEl !== null) { - window.scrollTo(0, anchorEl.getBoundingClientRect().top); - } - }, [anchorEl]); - - return ( - -
Spacer
- -
- ); - } - render(); - const scrollYBeforeOpen = window.scrollY; - - await expect.element(page.getByRole('button', { name: /choose date/i })).toBeInTheDocument(); - - await act(async () => { - await page.getByRole('button', { name: /choose date/i }).click({ - timeout: 10000, - }); - }); - - expect(handleClose.callCount).to.equal(0); - expect(handleOpen.callCount).to.equal(1); - expect(window.scrollY, 'focus caused scroll').to.equal(scrollYBeforeOpen); - }); -}); diff --git a/packages/x-date-pickers/tsconfig.json b/packages/x-date-pickers/tsconfig.json index 2cffb9a5455a..5f862d31ec2b 100644 --- a/packages/x-date-pickers/tsconfig.json +++ b/packages/x-date-pickers/tsconfig.json @@ -6,8 +6,7 @@ "@mui/material/themeCssVarsAugmentation", "chai-dom", "mocha", - "node", - "@vitest/browser/providers/playwright" + "node" ], "noImplicitAny": false }, diff --git a/tsconfig.json b/tsconfig.json index b44a09769cb8..a83b65a5e4b7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,6 @@ "strict": true, "baseUrl": "./", "allowJs": true, - "types": ["@vitest/browser/providers/playwright"], "paths": { "@mui/x-data-grid": ["./packages/x-data-grid/src"], "@mui/x-data-grid/*": ["./packages/x-data-grid/src/*"], From db2817d153a7294aba08d3fc62c5021d47f37c6c Mon Sep 17 00:00:00 2001 From: Jose C Quintas Jr Date: Fri, 4 Oct 2024 15:30:55 +0200 Subject: [PATCH 051/119] Update .mocharc.js Co-authored-by: Olivier Tassinari Signed-off-by: Jose C Quintas Jr --- .mocharc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mocharc.js b/.mocharc.js index 4cd5bea32607..56cf1623cfab 100644 --- a/.mocharc.js +++ b/.mocharc.js @@ -1,7 +1,7 @@ // We can't import the `.mocharc.js` of the monorepo, otherwise we trigger its `setupBabel`. module.exports = { - extension: ['js', 'ts', 'tsx', 'jsx'], + extension: ['js', 'ts', 'tsx'], ignore: [ '**/build/**', '**/node_modules/**', From b2b862840dd141da48e764e8586aa9ffa22f08d8 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 4 Oct 2024 15:28:55 +0200 Subject: [PATCH 052/119] update packages --- package.json | 6 +- pnpm-lock.yaml | 400 +++++++-------------------- test/performance-charts/package.json | 2 +- 3 files changed, 109 insertions(+), 299 deletions(-) diff --git a/package.json b/package.json index d4d30e07f9fc..e0ff0cae941a 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", "@vitejs/plugin-react": "^4.3.1", - "@vitest/browser": "^2.1.1", + "@vitest/browser": "^2.1.2", "autoprefixer": "^10.4.20", "axe-core": "4.10.0", "babel-loader": "^9.1.3", @@ -195,7 +195,7 @@ "typescript": "^5.5.4", "unist-util-visit": "^5.0.0", "util": "^0.12.5", - "vitest": "2.1.1", + "vitest": "2.1.2", "webpack": "^5.94.0", "webpack-bundle-analyzer": "^4.10.2", "webpack-cli": "^5.1.4", @@ -206,7 +206,7 @@ "@types/node": "^20.16.5", "@playwright/test": "1.44.1", "playwright": "1.44.1", - "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils" + "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils" }, "packageManager": "pnpm@9.10.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2e8e12623da0..17e742d19a56 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,7 +9,7 @@ overrides: '@types/node': ^20.16.5 '@playwright/test': 1.44.1 playwright: 1.44.1 - '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils + '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils patchedDependencies: babel-plugin-replace-imports@1.0.2: @@ -96,8 +96,8 @@ importers: specifier: ^1.0.12 version: 1.0.12 '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@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) @@ -174,8 +174,8 @@ importers: specifier: ^4.3.1 version: 4.3.1(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0)) '@vitest/browser': - specifier: ^2.1.1 - version: 2.1.1(@vitest/spy@2.1.1)(playwright@1.44.1)(typescript@5.5.4)(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.1.1) + specifier: ^2.1.2 + version: 2.1.2(@vitest/spy@2.1.2)(playwright@1.44.1)(typescript@5.5.4)(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.1.2) autoprefixer: specifier: ^10.4.20 version: 10.4.20(postcss@8.4.45) @@ -399,8 +399,8 @@ importers: specifier: ^0.12.5 version: 0.12.5 vitest: - specifier: 2.1.1 - version: 2.1.1(@types/node@20.16.5)(@vitest/browser@2.1.1)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0) + specifier: 2.1.2 + version: 2.1.2(@types/node@20.16.5)(@vitest/browser@2.1.2)(@vitest/ui@2.0.5)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0) webpack: specifier: ^5.94.0 version: 5.94.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.94.0)) @@ -780,8 +780,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@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) @@ -1024,8 +1024,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@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) @@ -1136,8 +1136,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@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) @@ -1198,8 +1198,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@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) @@ -1251,8 +1251,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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@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) @@ -1346,8 +1346,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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@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) @@ -1393,8 +1393,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@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 @@ -1413,8 +1413,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@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 @@ -1457,8 +1457,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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@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) @@ -1516,8 +1516,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: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@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) @@ -1626,7 +1626,7 @@ importers: devDependencies: '@codspeed/vitest-plugin': specifier: ^3.1.1 - version: 3.1.1(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.0.5(@types/node@20.16.5)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0)) + version: 3.1.1(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.1.2(@types/node@20.16.5)(@vitest/browser@2.1.2)(@vitest/ui@2.0.5)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0)) '@emotion/react': specifier: ^11.13.3 version: 11.13.3(@types/react@18.3.4)(react@18.3.1) @@ -1653,7 +1653,7 @@ importers: version: 3.7.0(@swc/helpers@0.5.5)(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0)) '@vitest/ui': specifier: 2.0.5 - version: 2.0.5(vitest@2.0.5) + version: 2.0.5(vitest@2.1.2) jsdom: specifier: ^24.1.3 version: 24.1.3 @@ -1664,8 +1664,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) vitest: - specifier: 2.0.5 - version: 2.0.5(@types/node@20.16.5)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) + specifier: 2.1.2 + version: 2.1.2(@types/node@20.16.5)(@vitest/browser@2.1.2)(@vitest/ui@2.0.5)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0) packages: @@ -3172,9 +3172,9 @@ packages: '@mui/internal-scripts@1.0.19': resolution: {integrity: sha512-NFyNxOIfrUtn3744rqk4UmkgGfbG7rntHxSFEXGAEy4yQRoEIIbOfHQURKJSupDKyCc48vSFMk+eGbiMBEYpKg==} - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils': - resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils} - version: 1.0.13 + '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils': + resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils} + version: 1.0.15 peerDependencies: react: ^18.2.0 react-dom: ^18.2.0 @@ -4447,12 +4447,12 @@ packages: peerDependencies: vite: ^4.2.0 || ^5.0.0 - '@vitest/browser@2.0.5': - resolution: {integrity: sha512-VbOYtu/6R3d7ASZREcrJmRY/sQuRFO9wMVsEDqfYbWiJRh2fDNi8CL1Csn7Ux31pOcPmmM5QvzFCMpiojvVh8g==} + '@vitest/browser@2.1.2': + resolution: {integrity: sha512-tqpGfz2sfjFFNuZ2iLZ6EGRVnH8z18O93ZIicbLsxDhiLgRNz84UcjSvX4pbheuddW+BJeNbLGdM3BU8vohbEg==} peerDependencies: playwright: 1.44.1 safaridriver: '*' - vitest: 2.0.5 + vitest: 2.1.2 webdriverio: '*' peerDependenciesMeta: playwright: @@ -4462,31 +4462,13 @@ packages: webdriverio: optional: true - '@vitest/browser@2.1.1': - resolution: {integrity: sha512-wLKqohwlZI24xMIEZAPwv9SVliv1avaIBeE0ou471D++BRPhiw2mubKBczFFIDHXuSL7UXb8/JQK9Ui6ttW9bQ==} - peerDependencies: - playwright: 1.44.1 - safaridriver: '*' - vitest: 2.1.1 - webdriverio: '*' - peerDependenciesMeta: - playwright: - optional: true - safaridriver: - optional: true - webdriverio: - optional: true + '@vitest/expect@2.1.2': + resolution: {integrity: sha512-FEgtlN8mIUSEAAnlvn7mP8vzaWhEaAEvhSXCqrsijM7K6QqjB11qoRZYEd4AKSCDz8p0/+yH5LzhZ47qt+EyPg==} - '@vitest/expect@2.0.5': - resolution: {integrity: sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==} - - '@vitest/expect@2.1.1': - resolution: {integrity: sha512-YeueunS0HiHiQxk+KEOnq/QMzlUuOzbU1Go+PgAsHvvv3tUkJPm9xWt+6ITNTlzsMXUjmgm5T+U7KBPK2qQV6w==} - - '@vitest/mocker@2.1.1': - resolution: {integrity: sha512-LNN5VwOEdJqCmJ/2XJBywB11DLlkbY0ooDJW3uRX5cZyYCrc4PI/ePX0iQhE3BiEGiQmK4GE7Q/PqCkkaiPnrA==} + '@vitest/mocker@2.1.2': + resolution: {integrity: sha512-ExElkCGMS13JAJy+812fw1aCv2QO/LBK6CyO4WOPAzLTmve50gydOlWhgdBJPx2ztbADUq3JVI0C5U+bShaeEA==} peerDependencies: - '@vitest/spy': 2.1.1 + '@vitest/spy': 2.1.2 msw: ^2.3.5 vite: ^5.0.0 peerDependenciesMeta: @@ -4498,26 +4480,17 @@ packages: '@vitest/pretty-format@2.0.5': resolution: {integrity: sha512-h8k+1oWHfwTkyTkb9egzwNMfJAEx4veaPSnMeKbVSjp4euqGSbQlm5+6VHwTr7u4FJslVVsUG5nopCaAYdOmSQ==} - '@vitest/pretty-format@2.1.1': - resolution: {integrity: sha512-SjxPFOtuINDUW8/UkElJYQSFtnWX7tMksSGW0vfjxMneFqxVr8YJ979QpMbDW7g+BIiq88RAGDjf7en6rvLPPQ==} - - '@vitest/runner@2.0.5': - resolution: {integrity: sha512-TfRfZa6Bkk9ky4tW0z20WKXFEwwvWhRY+84CnSEtq4+3ZvDlJyY32oNTJtM7AW9ihW90tX/1Q78cb6FjoAs+ig==} - - '@vitest/runner@2.1.1': - resolution: {integrity: sha512-uTPuY6PWOYitIkLPidaY5L3t0JJITdGTSwBtwMjKzo5O6RCOEncz9PUN+0pDidX8kTHYjO0EwUIvhlGpnGpxmA==} + '@vitest/pretty-format@2.1.2': + resolution: {integrity: sha512-FIoglbHrSUlOJPDGIrh2bjX1sNars5HbxlcsFKCtKzu4+5lpsRhOCVcuzp0fEhAGHkPZRIXVNzPcpSlkoZ3LuA==} - '@vitest/snapshot@2.0.5': - resolution: {integrity: sha512-SgCPUeDFLaM0mIUHfaArq8fD2WbaXG/zVXjRupthYfYGzc8ztbFbu6dUNOblBG7XLMR1kEhS/DNnfCZ2IhdDew==} + '@vitest/runner@2.1.2': + resolution: {integrity: sha512-UCsPtvluHO3u7jdoONGjOSil+uON5SSvU9buQh3lP7GgUXHp78guN1wRmZDX4wGK6J10f9NUtP6pO+SFquoMlw==} - '@vitest/snapshot@2.1.1': - resolution: {integrity: sha512-BnSku1WFy7r4mm96ha2FzN99AZJgpZOWrAhtQfoxjUU5YMRpq1zmHRq7a5K9/NjqonebO7iVDla+VvZS8BOWMw==} + '@vitest/snapshot@2.1.2': + resolution: {integrity: sha512-xtAeNsZ++aRIYIUsek7VHzry/9AcxeULlegBvsdLncLmNCR6tR8SRjn8BbDP4naxtccvzTqZ+L1ltZlRCfBZFA==} - '@vitest/spy@2.0.5': - resolution: {integrity: sha512-c/jdthAhvJdpfVuaexSrnawxZz6pywlTPe84LUB2m/4t3rl2fTo9NFGBG4oWgaD+FTgDDV8hJ/nibT7IfH3JfA==} - - '@vitest/spy@2.1.1': - resolution: {integrity: sha512-ZM39BnZ9t/xZ/nF4UwRH5il0Sw93QnZXd9NAZGRpIgj0yvVwPpLd702s/Cx955rGaMlyBQkZJ2Ir7qyY48VZ+g==} + '@vitest/spy@2.1.2': + resolution: {integrity: sha512-GSUi5zoy+abNRJwmFhBDC0yRuVUn8WMlQscvnbbXdKLXX9dE59YbfwXxuJ/mth6eeqIzofU8BB5XDo/Ns/qK2A==} '@vitest/ui@2.0.5': resolution: {integrity: sha512-m+ZpVt/PVi/nbeRKEjdiYeoh0aOfI9zr3Ria9LO7V2PlMETtAXJS3uETEZkc8Be2oOl8mhd7Ew+5SRBXRYncNw==} @@ -4527,8 +4500,8 @@ packages: '@vitest/utils@2.0.5': resolution: {integrity: sha512-d8HKbqIcya+GR67mkZbrzhS5kKhtp8dQLcmRZLGTscGVg7yImT82cIrhtn2L8+VujWcy6KZweApgNmPsTAO/UQ==} - '@vitest/utils@2.1.1': - resolution: {integrity: sha512-Y6Q9TsI+qJ2CC0ZKj6VBb+T8UPz593N113nnUykqwANqhgf3QkZeHFlusgKLTqrnVHbj/XDKZcDHol+dxVT+rQ==} + '@vitest/utils@2.1.2': + resolution: {integrity: sha512-zMO2KdYy6mx56btx9JvAqAZ6EyS3g49krMPPrgOp1yxGZiA93HumGk+bZ5jIZtOg5/VBYl5eBmGRQHqq4FG6uQ==} '@webassemblyjs/ast@1.12.1': resolution: {integrity: sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==} @@ -6274,10 +6247,6 @@ packages: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} - execa@8.0.1: - resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} - engines: {node: '>=16.17'} - execa@9.3.1: resolution: {integrity: sha512-gdhefCCNy/8tpH/2+ajP9IQc14vXchNdd0weyzSJEFURhRMGncQ+zKFxwjAufIewPEJm9BPOaJnvg2UtlH2gPQ==} engines: {node: ^18.19.0 || >=20.5.0} @@ -6574,10 +6543,6 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} - get-stream@8.0.1: - resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} - engines: {node: '>=16'} - get-stream@9.0.1: resolution: {integrity: sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==} engines: {node: '>=18'} @@ -6857,10 +6822,6 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} - human-signals@5.0.0: - resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} - engines: {node: '>=16.17.0'} - human-signals@8.0.0: resolution: {integrity: sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==} engines: {node: '>=18.18.0'} @@ -7125,10 +7086,6 @@ packages: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} - is-stream@3.0.0: - resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - is-stream@4.0.1: resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==} engines: {node: '>=18'} @@ -7919,10 +7876,6 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} - mimic-fn@4.0.0: - resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} - engines: {node: '>=12'} - min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -8314,10 +8267,6 @@ packages: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} - onetime@6.0.0: - resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} - engines: {node: '>=12'} - open@8.4.2: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} @@ -9299,6 +9248,9 @@ packages: sinon@18.0.0: resolution: {integrity: sha512-+dXDXzD1sBO6HlmZDd7mXZCR/y5ECiEiGCBSGuFD/kZ0bDTofPYc6JaeGmPSF+1j1MejGUWkORbYOLDyvqCWpA==} + sinon@18.0.1: + resolution: {integrity: sha512-a2N2TDY1uGviajJ6r4D1CyRAkzE9NNVlYOV1wX5xQDuAk0ONgzgRl0EjCQuRCPxOwp13ghsMwt9Gdldujs39qw==} + sirv@2.0.4: resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} engines: {node: '>= 10'} @@ -9495,10 +9447,6 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} - strip-final-newline@3.0.0: - resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} - engines: {node: '>=12'} - strip-final-newline@4.0.0: resolution: {integrity: sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==} engines: {node: '>=18'} @@ -10031,13 +9979,8 @@ packages: vfile@6.0.3: resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} - vite-node@2.0.5: - resolution: {integrity: sha512-LdsW4pxj0Ot69FAoXZ1yTnA9bjGohr2yNBU7QKRxpz8ITSkhuDl6h3zS/tvgz4qrNjeRnvrWeXQ8ZF7Um4W00Q==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - - vite-node@2.1.1: - resolution: {integrity: sha512-N/mGckI1suG/5wQI35XeR9rsMsPqKXzq1CdUndzVstBj/HvyxxGctwnK6WX43NGt5L3Z5tcRf83g4TITKJhPrA==} + vite-node@2.1.2: + resolution: {integrity: sha512-HPcGNN5g/7I2OtPjLqgOtCRu/qhVvBxTUD3qzitmL0SrG1cWFzxzhMDWussxSbrRYWqnKf8P2jiNhPMSN+ymsQ==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -10069,40 +10012,15 @@ packages: terser: optional: true - vitest@2.0.5: - resolution: {integrity: sha512-8GUxONfauuIdeSl5f9GTgVEpg5BTOlplET4WEDaeY2QBiN8wSm68vxN/tb5z405OwppfoCavnwXafiaYBC/xOA==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@edge-runtime/vm': '*' - '@types/node': ^20.16.5 - '@vitest/browser': 2.0.5 - '@vitest/ui': 2.0.5 - happy-dom: '*' - jsdom: '*' - peerDependenciesMeta: - '@edge-runtime/vm': - optional: true - '@types/node': - optional: true - '@vitest/browser': - optional: true - '@vitest/ui': - optional: true - happy-dom: - optional: true - jsdom: - optional: true - - vitest@2.1.1: - resolution: {integrity: sha512-97We7/VC0e9X5zBVkvt7SGQMGrRtn3KtySFQG5fpaMlS+l62eeXRQO633AYhSTC3z7IMebnPPNjGXVGNRFlxBA==} + vitest@2.1.2: + resolution: {integrity: sha512-veNjLizOMkRrJ6xxb+pvxN6/QAWg95mzcRjtmkepXdN87FNfxAss9RKe2far/G9cQpipfgP2taqg0KiWsquj8A==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/node': ^20.16.5 - '@vitest/browser': 2.1.1 - '@vitest/ui': 2.1.1 + '@vitest/browser': 2.1.2 + '@vitest/ui': 2.1.2 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -11510,11 +11428,11 @@ snapshots: transitivePeerDependencies: - debug - '@codspeed/vitest-plugin@3.1.1(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.0.5(@types/node@20.16.5)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0))': + '@codspeed/vitest-plugin@3.1.1(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.1.2(@types/node@20.16.5)(@vitest/browser@2.1.2)(@vitest/ui@2.0.5)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0))': dependencies: '@codspeed/core': 3.1.1 vite: 5.3.4(@types/node@20.16.5)(terser@5.27.0) - vitest: 2.0.5(@types/node@20.16.5)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) + vitest: 2.1.2(@types/node@20.16.5)(@vitest/browser@2.1.2)(@vitest/ui@2.0.5)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0) transitivePeerDependencies: - debug @@ -12202,7 +12120,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/2284ad61/@mui/internal-test-utils(@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@https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@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) @@ -12225,7 +12143,7 @@ snapshots: prop-types: 15.8.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - sinon: 18.0.0 + sinon: 18.0.1 transitivePeerDependencies: - '@babel/core' - '@types/react' @@ -13685,35 +13603,17 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/browser@2.0.5(playwright@1.44.1)(typescript@5.5.4)(vitest@2.0.5)': + '@vitest/browser@2.1.2(@vitest/spy@2.1.2)(playwright@1.44.1)(typescript@5.5.4)(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.1.2)': dependencies: '@testing-library/dom': 10.4.0 '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) - '@vitest/utils': 2.0.5 - magic-string: 0.30.11 - msw: 2.4.4(typescript@5.5.4) - sirv: 2.0.4 - vitest: 2.0.5(@types/node@20.16.5)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) - ws: 8.18.0 - optionalDependencies: - playwright: 1.44.1 - transitivePeerDependencies: - - bufferutil - - typescript - - utf-8-validate - optional: true - - '@vitest/browser@2.1.1(@vitest/spy@2.1.1)(playwright@1.44.1)(typescript@5.5.4)(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.1.1)': - dependencies: - '@testing-library/dom': 10.4.0 - '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) - '@vitest/mocker': 2.1.1(@vitest/spy@2.1.1)(msw@2.4.4(typescript@5.5.4))(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0)) - '@vitest/utils': 2.1.1 + '@vitest/mocker': 2.1.2(@vitest/spy@2.1.2)(msw@2.4.4(typescript@5.5.4))(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0)) + '@vitest/utils': 2.1.2 magic-string: 0.30.11 msw: 2.4.4(typescript@5.5.4) sirv: 2.0.4 tinyrainbow: 1.2.0 - vitest: 2.1.1(@types/node@20.16.5)(@vitest/browser@2.1.1)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0) + vitest: 2.1.2(@types/node@20.16.5)(@vitest/browser@2.1.2)(@vitest/ui@2.0.5)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0) ws: 8.18.0 optionalDependencies: playwright: 1.44.1 @@ -13724,23 +13624,16 @@ snapshots: - utf-8-validate - vite - '@vitest/expect@2.0.5': - dependencies: - '@vitest/spy': 2.0.5 - '@vitest/utils': 2.0.5 - chai: 5.1.1 - tinyrainbow: 1.2.0 - - '@vitest/expect@2.1.1': + '@vitest/expect@2.1.2': dependencies: - '@vitest/spy': 2.1.1 - '@vitest/utils': 2.1.1 + '@vitest/spy': 2.1.2 + '@vitest/utils': 2.1.2 chai: 5.1.1 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.1(@vitest/spy@2.1.1)(msw@2.4.4(typescript@5.5.4))(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))': + '@vitest/mocker@2.1.2(@vitest/spy@2.1.2)(msw@2.4.4(typescript@5.5.4))(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))': dependencies: - '@vitest/spy': 2.1.1 + '@vitest/spy': 2.1.2 estree-walker: 3.0.3 magic-string: 0.30.11 optionalDependencies: @@ -13751,41 +13644,26 @@ snapshots: dependencies: tinyrainbow: 1.2.0 - '@vitest/pretty-format@2.1.1': + '@vitest/pretty-format@2.1.2': dependencies: tinyrainbow: 1.2.0 - '@vitest/runner@2.0.5': - dependencies: - '@vitest/utils': 2.0.5 - pathe: 1.1.2 - - '@vitest/runner@2.1.1': + '@vitest/runner@2.1.2': dependencies: - '@vitest/utils': 2.1.1 + '@vitest/utils': 2.1.2 pathe: 1.1.2 - '@vitest/snapshot@2.0.5': + '@vitest/snapshot@2.1.2': dependencies: - '@vitest/pretty-format': 2.0.5 + '@vitest/pretty-format': 2.1.2 magic-string: 0.30.11 pathe: 1.1.2 - '@vitest/snapshot@2.1.1': - dependencies: - '@vitest/pretty-format': 2.1.1 - magic-string: 0.30.11 - pathe: 1.1.2 - - '@vitest/spy@2.0.5': + '@vitest/spy@2.1.2': dependencies: tinyspy: 3.0.0 - '@vitest/spy@2.1.1': - dependencies: - tinyspy: 3.0.0 - - '@vitest/ui@2.0.5(vitest@2.0.5)': + '@vitest/ui@2.0.5(vitest@2.1.2)': dependencies: '@vitest/utils': 2.0.5 fast-glob: 3.3.2 @@ -13794,7 +13672,7 @@ snapshots: pathe: 1.1.2 sirv: 2.0.4 tinyrainbow: 1.2.0 - vitest: 2.0.5(@types/node@20.16.5)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0) + vitest: 2.1.2(@types/node@20.16.5)(@vitest/browser@2.1.2)(@vitest/ui@2.0.5)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0) '@vitest/utils@2.0.5': dependencies: @@ -13803,9 +13681,9 @@ snapshots: loupe: 3.1.1 tinyrainbow: 1.2.0 - '@vitest/utils@2.1.1': + '@vitest/utils@2.1.2': dependencies: - '@vitest/pretty-format': 2.1.1 + '@vitest/pretty-format': 2.1.2 loupe: 3.1.1 tinyrainbow: 1.2.0 @@ -15957,18 +15835,6 @@ snapshots: signal-exit: 3.0.7 strip-final-newline: 2.0.0 - execa@8.0.1: - dependencies: - cross-spawn: 7.0.3 - get-stream: 8.0.1 - human-signals: 5.0.0 - is-stream: 3.0.0 - merge-stream: 2.0.0 - npm-run-path: 5.3.0 - onetime: 6.0.0 - signal-exit: 4.1.0 - strip-final-newline: 3.0.0 - execa@9.3.1: dependencies: '@sindresorhus/merge-streams': 4.0.0 @@ -16321,8 +16187,6 @@ snapshots: get-stream@6.0.1: {} - get-stream@8.0.1: {} - get-stream@9.0.1: dependencies: '@sec-ant/readable-stream': 0.4.1 @@ -16685,8 +16549,6 @@ snapshots: human-signals@2.1.0: {} - human-signals@5.0.0: {} - human-signals@8.0.0: {} hyperlinker@1.0.0: {} @@ -16912,8 +16774,6 @@ snapshots: is-stream@2.0.1: {} - is-stream@3.0.0: {} - is-stream@4.0.1: {} is-string@1.0.7: @@ -17985,8 +17845,6 @@ snapshots: mimic-fn@2.1.0: {} - mimic-fn@4.0.0: {} - min-indent@1.0.1: {} minimatch@3.0.5: @@ -18506,10 +18364,6 @@ snapshots: dependencies: mimic-fn: 2.1.0 - onetime@6.0.0: - dependencies: - mimic-fn: 4.0.0 - open@8.4.2: dependencies: define-lazy-prop: 2.0.0 @@ -19606,6 +19460,15 @@ snapshots: nise: 6.0.0 supports-color: 7.2.0 + sinon@18.0.1: + dependencies: + '@sinonjs/commons': 3.0.1 + '@sinonjs/fake-timers': 11.2.2 + '@sinonjs/samsam': 8.0.0 + diff: 5.2.0 + nise: 6.0.0 + supports-color: 7.2.0 + sirv@2.0.4: dependencies: '@polka/url': 1.0.0-next.24 @@ -19842,8 +19705,6 @@ snapshots: strip-final-newline@2.0.0: {} - strip-final-newline@3.0.0: {} - strip-final-newline@4.0.0: {} strip-indent@3.0.0: @@ -20354,24 +20215,7 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-node@2.0.5(@types/node@20.16.5)(terser@5.27.0): - dependencies: - cac: 6.7.14 - debug: 4.3.6(supports-color@8.1.1) - pathe: 1.1.2 - tinyrainbow: 1.2.0 - vite: 5.3.4(@types/node@20.16.5)(terser@5.27.0) - transitivePeerDependencies: - - '@types/node' - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - - vite-node@2.1.1(@types/node@20.16.5)(terser@5.27.0): + vite-node@2.1.2(@types/node@20.16.5)(terser@5.27.0): dependencies: cac: 6.7.14 debug: 4.3.6(supports-color@8.1.1) @@ -20397,50 +20241,15 @@ snapshots: fsevents: 2.3.3 terser: 5.27.0 - vitest@2.0.5(@types/node@20.16.5)(@vitest/browser@2.0.5)(@vitest/ui@2.0.5)(jsdom@24.1.3)(terser@5.27.0): - dependencies: - '@ampproject/remapping': 2.3.0 - '@vitest/expect': 2.0.5 - '@vitest/pretty-format': 2.1.1 - '@vitest/runner': 2.0.5 - '@vitest/snapshot': 2.0.5 - '@vitest/spy': 2.0.5 - '@vitest/utils': 2.0.5 - chai: 5.1.1 - debug: 4.3.6(supports-color@8.1.1) - execa: 8.0.1 - magic-string: 0.30.11 - pathe: 1.1.2 - std-env: 3.7.0 - tinybench: 2.9.0 - tinypool: 1.0.0 - tinyrainbow: 1.2.0 - vite: 5.3.4(@types/node@20.16.5)(terser@5.27.0) - vite-node: 2.0.5(@types/node@20.16.5)(terser@5.27.0) - why-is-node-running: 2.3.0 - optionalDependencies: - '@types/node': 20.16.5 - '@vitest/browser': 2.0.5(playwright@1.44.1)(typescript@5.5.4)(vitest@2.0.5) - '@vitest/ui': 2.0.5(vitest@2.0.5) - jsdom: 24.1.3 - transitivePeerDependencies: - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - - vitest@2.1.1(@types/node@20.16.5)(@vitest/browser@2.1.1)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0): + vitest@2.1.2(@types/node@20.16.5)(@vitest/browser@2.1.2)(@vitest/ui@2.0.5)(jsdom@24.1.3)(msw@2.4.4(typescript@5.5.4))(terser@5.27.0): dependencies: - '@vitest/expect': 2.1.1 - '@vitest/mocker': 2.1.1(@vitest/spy@2.1.1)(msw@2.4.4(typescript@5.5.4))(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0)) - '@vitest/pretty-format': 2.1.1 - '@vitest/runner': 2.1.1 - '@vitest/snapshot': 2.1.1 - '@vitest/spy': 2.1.1 - '@vitest/utils': 2.1.1 + '@vitest/expect': 2.1.2 + '@vitest/mocker': 2.1.2(@vitest/spy@2.1.2)(msw@2.4.4(typescript@5.5.4))(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0)) + '@vitest/pretty-format': 2.1.2 + '@vitest/runner': 2.1.2 + '@vitest/snapshot': 2.1.2 + '@vitest/spy': 2.1.2 + '@vitest/utils': 2.1.2 chai: 5.1.1 debug: 4.3.6(supports-color@8.1.1) magic-string: 0.30.11 @@ -20451,11 +20260,12 @@ snapshots: tinypool: 1.0.0 tinyrainbow: 1.2.0 vite: 5.3.4(@types/node@20.16.5)(terser@5.27.0) - vite-node: 2.1.1(@types/node@20.16.5)(terser@5.27.0) + vite-node: 2.1.2(@types/node@20.16.5)(terser@5.27.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.16.5 - '@vitest/browser': 2.1.1(@vitest/spy@2.1.1)(playwright@1.44.1)(typescript@5.5.4)(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.1.1) + '@vitest/browser': 2.1.2(@vitest/spy@2.1.2)(playwright@1.44.1)(typescript@5.5.4)(vite@5.3.4(@types/node@20.16.5)(terser@5.27.0))(vitest@2.1.2) + '@vitest/ui': 2.0.5(vitest@2.1.2) jsdom: 24.1.3 transitivePeerDependencies: - less diff --git a/test/performance-charts/package.json b/test/performance-charts/package.json index d8a2c84264fb..8607f7dfab8e 100644 --- a/test/performance-charts/package.json +++ b/test/performance-charts/package.json @@ -20,6 +20,6 @@ "jsdom": "^24.1.3", "react": "^18.3.1", "react-dom": "^18.3.1", - "vitest": "2.0.5" + "vitest": "2.1.2" } } From 8434b41c2cd10f41d086d9c1c8d46642be0e391d Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 4 Oct 2024 15:37:13 +0200 Subject: [PATCH 053/119] use x-package for names --- vitest.workspace.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vitest.workspace.ts b/vitest.workspace.ts index ee117aff773e..a850f5b3d2ff 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -1,7 +1,7 @@ -import { defineWorkspace } from 'vitest/config'; import react from '@vitejs/plugin-react'; +import { defineWorkspace } from 'vitest/config'; -const packages = ['charts', 'date-pickers']; +const packages = ['x-charts', 'x-date-pickers']; // Ideally we move the configuration to each package. // Currently it doesn't work because vitest doesn't detect two different configurations in the same package. @@ -14,10 +14,10 @@ export default defineWorkspace( extends: './vitest.config.mts', plugins: [react()], test: { - include: [`packages/x-${name}/src/**/*.test.?(c|m)[jt]s?(x)`], + include: [`packages/${name}/src/**/*.test.?(c|m)[jt]s?(x)`], exclude: [ - `packages/x-${name}/src/**/*.jsdom.test.?(c|m)[jt]s?(x)`, - `packages/x-${name}/src/**/*V3.test.?(c|m)[jt]s?(x)`, + `packages/${name}/src/**/*.jsdom.test.?(c|m)[jt]s?(x)`, + `packages/${name}/src/**/*V3.test.?(c|m)[jt]s?(x)`, ], name: `browser/${name}`, env: { @@ -38,8 +38,8 @@ export default defineWorkspace( extends: './vitest.config.mts', plugins: [react()], test: { - include: [`packages/x-${name}/src/**/*.test.?(c|m)[jt]s?(x)`], - exclude: [`packages/x-${name}/src/**/*.browser.test.?(c|m)[jt]s?(x)`], + include: [`packages/${name}/src/**/*.test.?(c|m)[jt]s?(x)`], + exclude: [`packages/${name}/src/**/*.browser.test.?(c|m)[jt]s?(x)`], name: `jsdom/${name}`, environment: 'jsdom', env: { From 0f8b218fe18112f1a0ef8dc05065bb8cfbb172f5 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 8 Oct 2024 12:35:59 +0200 Subject: [PATCH 054/119] try urls --- vitest.config.mts | 17 ++++++++++++----- vitest.workspace.ts | 5 +---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/vitest.config.mts b/vitest.config.mts index 8ce53f0bab1f..81b3e7bd6ede 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -1,4 +1,5 @@ import { defineConfig } from 'vitest/config'; +import path from 'path'; export default defineConfig({ resolve: { @@ -23,11 +24,13 @@ export default defineConfig({ { find: 'date-fns', replacement: 'date-fns-v3', - customResolver(source, importer) { + async customResolver(source, importer) { if (importer?.includes('src/AdapterDateFnsV3')) { - return source; + const file = new URL(import.meta.resolve(source)).pathname; + return file; } - return null; + const file = new URL(import.meta.resolve('date-fns')).pathname; + return file; }, }, { @@ -35,9 +38,13 @@ export default defineConfig({ replacement: 'date-fns-jalali-v3', customResolver(source, importer) { if (importer?.includes('src/AdapterDateFnsJalaliV3')) { - return source; + const file = new URL(import.meta.resolve(source)).pathname; + console.log(source, file); + return file; } - return null; + const file = new URL(import.meta.resolve(source.replace('-v3', ''))).pathname; + console.log(source, JSON.stringify(file)); + return file; }, }, { diff --git a/vitest.workspace.ts b/vitest.workspace.ts index a850f5b3d2ff..db0ef5779c78 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -15,10 +15,7 @@ export default defineWorkspace( plugins: [react()], test: { include: [`packages/${name}/src/**/*.test.?(c|m)[jt]s?(x)`], - exclude: [ - `packages/${name}/src/**/*.jsdom.test.?(c|m)[jt]s?(x)`, - `packages/${name}/src/**/*V3.test.?(c|m)[jt]s?(x)`, - ], + exclude: [`packages/${name}/src/**/*.jsdom.test.?(c|m)[jt]s?(x)`], name: `browser/${name}`, env: { MUI_BROWSER: 'true', From 2d5d395c26c9842a9014b205205699d55e2f554f Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 8 Oct 2024 14:25:27 +0200 Subject: [PATCH 055/119] mock datefns in files instead of globally --- .../AdapterDateFnsJalaliV3.test.tsx | 49 ++++++++++++++++++- .../AdapterDateFnsJalaliV3.ts | 2 +- .../AdapterDateFnsV3.test.tsx | 49 ++++++++++++++++++- .../src/AdapterDateFnsV3/AdapterDateFnsV3.ts | 2 +- packages/x-date-pickers/tsconfig.build.json | 1 + packages/x-date-pickers/tsconfig.json | 1 + test/setup.ts | 5 +- test/utils/mochaHooks.js | 6 +++ vitest.config.mts | 28 ----------- 9 files changed, 108 insertions(+), 35 deletions(-) diff --git a/packages/x-date-pickers/src/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.test.tsx b/packages/x-date-pickers/src/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.test.tsx index f97f309af0fd..410d06ea7110 100644 --- a/packages/x-date-pickers/src/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.test.tsx +++ b/packages/x-date-pickers/src/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.test.tsx @@ -1,15 +1,60 @@ import { expect } from 'chai'; import { DateTimeField } from '@mui/x-date-pickers/DateTimeField'; -import { AdapterDateFnsJalali } from '@mui/x-date-pickers/AdapterDateFnsJalaliV3'; import { createPickerRenderer, expectFieldValueV7, describeJalaliAdapter, buildFieldInteractions, } from 'test/utils/pickers'; -import { enUS, faIR } from 'date-fns-jalali/locale'; +import { enUS, faIR } from 'date-fns-jalali-v3/locale'; import { AdapterFormats } from '@mui/x-date-pickers/models'; +import { AdapterDateFnsJalali } from '@mui/x-date-pickers/AdapterDateFnsJalaliV3'; + +vi.mock('date-fns-jalali/addSeconds', () => import('date-fns-jalali-v3/addSeconds')); +vi.mock('date-fns-jalali/addMinutes', () => import('date-fns-jalali-v3/addMinutes')); +vi.mock('date-fns-jalali/addHours', () => import('date-fns-jalali-v3/addHours')); +vi.mock('date-fns-jalali/addDays', () => import('date-fns-jalali-v3/addDays')); +vi.mock('date-fns-jalali/addWeeks', () => import('date-fns-jalali-v3/addWeeks')); +vi.mock('date-fns-jalali/addMonths', () => import('date-fns-jalali-v3/addMonths')); +vi.mock('date-fns-jalali/addYears', () => import('date-fns-jalali-v3/addYears')); +vi.mock('date-fns-jalali/endOfDay', () => import('date-fns-jalali-v3/endOfDay')); +vi.mock('date-fns-jalali/endOfWeek', () => import('date-fns-jalali-v3/endOfWeek')); +vi.mock('date-fns-jalali/endOfYear', () => import('date-fns-jalali-v3/endOfYear')); +vi.mock('date-fns-jalali/format', () => import('date-fns-jalali-v3/format')); +vi.mock('date-fns-jalali/getHours', () => import('date-fns-jalali-v3/getHours')); +vi.mock('date-fns-jalali/getSeconds', () => import('date-fns-jalali-v3/getSeconds')); +vi.mock('date-fns-jalali/getMilliseconds', () => import('date-fns-jalali-v3/getMilliseconds')); +vi.mock('date-fns-jalali/getWeek', () => import('date-fns-jalali-v3/getWeek')); +vi.mock('date-fns-jalali/getYear', () => import('date-fns-jalali-v3/getYear')); +vi.mock('date-fns-jalali/getMonth', () => import('date-fns-jalali-v3/getMonth')); +vi.mock('date-fns-jalali/getDate', () => import('date-fns-jalali-v3/getDate')); +vi.mock('date-fns-jalali/getDaysInMonth', () => import('date-fns-jalali-v3/getDaysInMonth')); +vi.mock('date-fns-jalali/getMinutes', () => import('date-fns-jalali-v3/getMinutes')); +vi.mock('date-fns-jalali/isAfter', () => import('date-fns-jalali-v3/isAfter')); +vi.mock('date-fns-jalali/isBefore', () => import('date-fns-jalali-v3/isBefore')); +vi.mock('date-fns-jalali/isEqual', () => import('date-fns-jalali-v3/isEqual')); +vi.mock('date-fns-jalali/isSameDay', () => import('date-fns-jalali-v3/isSameDay')); +vi.mock('date-fns-jalali/isSameYear', () => import('date-fns-jalali-v3/isSameYear')); +vi.mock('date-fns-jalali/isSameMonth', () => import('date-fns-jalali-v3/isSameMonth')); +vi.mock('date-fns-jalali/isSameHour', () => import('date-fns-jalali-v3/isSameHour')); +vi.mock('date-fns-jalali/isValid', () => import('date-fns-jalali-v3/isValid')); +vi.mock('date-fns-jalali/parse', () => import('date-fns-jalali-v3/parse')); +vi.mock('date-fns-jalali/setDate', () => import('date-fns-jalali-v3/setDate')); +vi.mock('date-fns-jalali/setHours', () => import('date-fns-jalali-v3/setHours')); +vi.mock('date-fns-jalali/setMinutes', () => import('date-fns-jalali-v3/setMinutes')); +vi.mock('date-fns-jalali/setMonth', () => import('date-fns-jalali-v3/setMonth')); +vi.mock('date-fns-jalali/setSeconds', () => import('date-fns-jalali-v3/setSeconds')); +vi.mock('date-fns-jalali/setMilliseconds', () => import('date-fns-jalali-v3/setMilliseconds')); +vi.mock('date-fns-jalali/setYear', () => import('date-fns-jalali-v3/setYear')); +vi.mock('date-fns-jalali/startOfDay', () => import('date-fns-jalali-v3/startOfDay')); +vi.mock('date-fns-jalali/startOfMonth', () => import('date-fns-jalali-v3/startOfMonth')); +vi.mock('date-fns-jalali/endOfMonth', () => import('date-fns-jalali-v3/endOfMonth')); +vi.mock('date-fns-jalali/startOfWeek', () => import('date-fns-jalali-v3/startOfWeek')); +vi.mock('date-fns-jalali/startOfYear', () => import('date-fns-jalali-v3/startOfYear')); +vi.mock('date-fns-jalali/isWithinInterval', () => import('date-fns-jalali-v3/isWithinInterval')); +vi.mock('date-fns-jalali/locale/fa-IR', () => import('date-fns-jalali-v3/locale/fa-IR')); + describe('', () => { describeJalaliAdapter(AdapterDateFnsJalali, {}); diff --git a/packages/x-date-pickers/src/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.ts b/packages/x-date-pickers/src/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.ts index 1dc566b74605..f83e4a80f50b 100644 --- a/packages/x-date-pickers/src/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.ts +++ b/packages/x-date-pickers/src/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.ts @@ -46,7 +46,7 @@ import { isWithinInterval } from 'date-fns-jalali/isWithinInterval'; import { faIR as defaultLocale } from 'date-fns-jalali/locale/fa-IR'; // date-fns-jalali v2 does not export types // @ts-ignore TODO remove when date-fns-jalali-v3 is the default -import { Locale as DateFnsLocale } from 'date-fns-jalali/locale/types'; +import type { Locale as DateFnsLocale } from 'date-fns-jalali/locale/types'; import { AdapterFormats, AdapterOptions, MuiPickersAdapter } from '../models'; import { AdapterDateFnsBase } from '../AdapterDateFnsBase'; diff --git a/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx b/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx index f84af39c4472..019757d08a0b 100644 --- a/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx +++ b/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx @@ -1,6 +1,51 @@ -import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3'; import { describeGregorianAdapter } from 'test/utils/pickers/describeGregorianAdapter'; -import { fr } from 'date-fns/locale'; +import { fr } from 'date-fns-v3/locale'; + +import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3'; + +vi.mock('date-fns/addSeconds', () => import('date-fns-v3/addSeconds')); +vi.mock('date-fns/addMinutes', () => import('date-fns-v3/addMinutes')); +vi.mock('date-fns/addHours', () => import('date-fns-v3/addHours')); +vi.mock('date-fns/addDays', () => import('date-fns-v3/addDays')); +vi.mock('date-fns/addWeeks', () => import('date-fns-v3/addWeeks')); +vi.mock('date-fns/addMonths', () => import('date-fns-v3/addMonths')); +vi.mock('date-fns/addYears', () => import('date-fns-v3/addYears')); +vi.mock('date-fns/endOfDay', () => import('date-fns-v3/endOfDay')); +vi.mock('date-fns/endOfWeek', () => import('date-fns-v3/endOfWeek')); +vi.mock('date-fns/endOfYear', () => import('date-fns-v3/endOfYear')); +vi.mock('date-fns/format', () => import('date-fns-v3/format')); +vi.mock('date-fns/getHours', () => import('date-fns-v3/getHours')); +vi.mock('date-fns/getSeconds', () => import('date-fns-v3/getSeconds')); +vi.mock('date-fns/getMilliseconds', () => import('date-fns-v3/getMilliseconds')); +vi.mock('date-fns/getWeek', () => import('date-fns-v3/getWeek')); +vi.mock('date-fns/getYear', () => import('date-fns-v3/getYear')); +vi.mock('date-fns/getMonth', () => import('date-fns-v3/getMonth')); +vi.mock('date-fns/getDate', () => import('date-fns-v3/getDate')); +vi.mock('date-fns/getDaysInMonth', () => import('date-fns-v3/getDaysInMonth')); +vi.mock('date-fns/getMinutes', () => import('date-fns-v3/getMinutes')); +vi.mock('date-fns/isAfter', () => import('date-fns-v3/isAfter')); +vi.mock('date-fns/isBefore', () => import('date-fns-v3/isBefore')); +vi.mock('date-fns/isEqual', () => import('date-fns-v3/isEqual')); +vi.mock('date-fns/isSameDay', () => import('date-fns-v3/isSameDay')); +vi.mock('date-fns/isSameYear', () => import('date-fns-v3/isSameYear')); +vi.mock('date-fns/isSameMonth', () => import('date-fns-v3/isSameMonth')); +vi.mock('date-fns/isSameHour', () => import('date-fns-v3/isSameHour')); +vi.mock('date-fns/isValid', () => import('date-fns-v3/isValid')); +vi.mock('date-fns/parse', () => import('date-fns-v3/parse')); +vi.mock('date-fns/setDate', () => import('date-fns-v3/setDate')); +vi.mock('date-fns/setHours', () => import('date-fns-v3/setHours')); +vi.mock('date-fns/setMinutes', () => import('date-fns-v3/setMinutes')); +vi.mock('date-fns/setMonth', () => import('date-fns-v3/setMonth')); +vi.mock('date-fns/setSeconds', () => import('date-fns-v3/setSeconds')); +vi.mock('date-fns/setMilliseconds', () => import('date-fns-v3/setMilliseconds')); +vi.mock('date-fns/setYear', () => import('date-fns-v3/setYear')); +vi.mock('date-fns/startOfDay', () => import('date-fns-v3/startOfDay')); +vi.mock('date-fns/startOfMonth', () => import('date-fns-v3/startOfMonth')); +vi.mock('date-fns/endOfMonth', () => import('date-fns-v3/endOfMonth')); +vi.mock('date-fns/startOfWeek', () => import('date-fns-v3/startOfWeek')); +vi.mock('date-fns/startOfYear', () => import('date-fns-v3/startOfYear')); +vi.mock('date-fns/isWithinInterval', () => import('date-fns-v3/isWithinInterval')); +vi.mock('date-fns/locale/en-US', () => import('date-fns-v3/locale/en-US')); describe('', () => { describeGregorianAdapter(AdapterDateFns, { diff --git a/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.ts b/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.ts index 9c5332b9e1fe..5fbc932b66be 100644 --- a/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.ts +++ b/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.ts @@ -47,7 +47,7 @@ import { isWithinInterval } from 'date-fns/isWithinInterval'; import { enUS } from 'date-fns/locale/en-US'; // date-fns v2 does not export types // @ts-ignore TODO remove when date-fns-v3 is the default -import { Locale as DateFnsLocale } from 'date-fns/locale/types'; +import type { Locale as DateFnsLocale } from 'date-fns/locale/types'; import { AdapterFormats, AdapterOptions, MuiPickersAdapter } from '../models'; import { AdapterDateFnsBase } from '../AdapterDateFnsBase'; diff --git a/packages/x-date-pickers/tsconfig.build.json b/packages/x-date-pickers/tsconfig.build.json index 308d2110b536..25e983d655eb 100644 --- a/packages/x-date-pickers/tsconfig.build.json +++ b/packages/x-date-pickers/tsconfig.build.json @@ -10,6 +10,7 @@ "outDir": "build", "rootDir": "./src", "types": [ + "vitest/globals", "node", "@mui/material/themeCssVarsAugmentation", "dayjs/plugin/utc.d.ts", diff --git a/packages/x-date-pickers/tsconfig.json b/packages/x-date-pickers/tsconfig.json index 5f862d31ec2b..4664bab602d7 100644 --- a/packages/x-date-pickers/tsconfig.json +++ b/packages/x-date-pickers/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "types": [ + "vitest/globals", "@mui/internal-test-utils/initMatchers", "@mui/material/themeCssVarsAugmentation", "chai-dom", diff --git a/test/setup.ts b/test/setup.ts index 9b1a10c68a9d..58e22ef960a4 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -1,4 +1,4 @@ -import { beforeAll, afterAll } from 'vitest'; +import { beforeAll, afterAll, vi } from 'vitest'; import 'test/utils/addChaiAssertions'; import 'test/utils/setupPickers'; import 'test/utils/licenseRelease'; @@ -8,6 +8,9 @@ globalThis.before = beforeAll; // @ts-ignore globalThis.after = afterAll; +// @ts-ignore +globalThis.vi = vi; + const isVitestJsdom = process.env.MUI_JSDOM === 'true'; // Only necessary when not in browser mode. diff --git a/test/utils/mochaHooks.js b/test/utils/mochaHooks.js index e7d0a9df9f61..28300ac5086a 100644 --- a/test/utils/mochaHooks.js +++ b/test/utils/mochaHooks.js @@ -39,3 +39,9 @@ export function createXMochaHooks(coreMochaHooks = {}) { return mochaHooks; } + +// So we can mock files without having to have a global override in vitest +// eslint-disable-next-line no-undef +globalThis.vi = { + mock: () => {}, +}; diff --git a/vitest.config.mts b/vitest.config.mts index 81b3e7bd6ede..456ad1884344 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -1,5 +1,4 @@ import { defineConfig } from 'vitest/config'; -import path from 'path'; export default defineConfig({ resolve: { @@ -20,33 +19,6 @@ export default defineConfig({ find: '@mui/x-internals', replacement: new URL('./packages/x-internals/src', import.meta.url).pathname, }, - // Use built in replacements for date-fns and date-fns-jalali - { - find: 'date-fns', - replacement: 'date-fns-v3', - async customResolver(source, importer) { - if (importer?.includes('src/AdapterDateFnsV3')) { - const file = new URL(import.meta.resolve(source)).pathname; - return file; - } - const file = new URL(import.meta.resolve('date-fns')).pathname; - return file; - }, - }, - { - find: 'date-fns-jalali', - replacement: 'date-fns-jalali-v3', - customResolver(source, importer) { - if (importer?.includes('src/AdapterDateFnsJalaliV3')) { - const file = new URL(import.meta.resolve(source)).pathname; - console.log(source, file); - return file; - } - const file = new URL(import.meta.resolve(source.replace('-v3', ''))).pathname; - console.log(source, JSON.stringify(file)); - return file; - }, - }, { find: 'moment/locale', replacement: 'moment/dist/locale', From 493133d43dcd867e6992751d343eae472dced1c4 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 8 Oct 2024 14:52:59 +0200 Subject: [PATCH 056/119] use datefnsv4 --- .../AdapterDateFnsV3.test.tsx | 88 +++++++++---------- pnpm-lock.yaml | 44 +++------- test/performance-charts/package.json | 2 +- 3 files changed, 59 insertions(+), 75 deletions(-) diff --git a/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx b/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx index 019757d08a0b..6277d9d46d63 100644 --- a/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx +++ b/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx @@ -1,51 +1,51 @@ import { describeGregorianAdapter } from 'test/utils/pickers/describeGregorianAdapter'; -import { fr } from 'date-fns-v3/locale'; +import { fr } from 'date-fns-v4/locale'; import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3'; -vi.mock('date-fns/addSeconds', () => import('date-fns-v3/addSeconds')); -vi.mock('date-fns/addMinutes', () => import('date-fns-v3/addMinutes')); -vi.mock('date-fns/addHours', () => import('date-fns-v3/addHours')); -vi.mock('date-fns/addDays', () => import('date-fns-v3/addDays')); -vi.mock('date-fns/addWeeks', () => import('date-fns-v3/addWeeks')); -vi.mock('date-fns/addMonths', () => import('date-fns-v3/addMonths')); -vi.mock('date-fns/addYears', () => import('date-fns-v3/addYears')); -vi.mock('date-fns/endOfDay', () => import('date-fns-v3/endOfDay')); -vi.mock('date-fns/endOfWeek', () => import('date-fns-v3/endOfWeek')); -vi.mock('date-fns/endOfYear', () => import('date-fns-v3/endOfYear')); -vi.mock('date-fns/format', () => import('date-fns-v3/format')); -vi.mock('date-fns/getHours', () => import('date-fns-v3/getHours')); -vi.mock('date-fns/getSeconds', () => import('date-fns-v3/getSeconds')); -vi.mock('date-fns/getMilliseconds', () => import('date-fns-v3/getMilliseconds')); -vi.mock('date-fns/getWeek', () => import('date-fns-v3/getWeek')); -vi.mock('date-fns/getYear', () => import('date-fns-v3/getYear')); -vi.mock('date-fns/getMonth', () => import('date-fns-v3/getMonth')); -vi.mock('date-fns/getDate', () => import('date-fns-v3/getDate')); -vi.mock('date-fns/getDaysInMonth', () => import('date-fns-v3/getDaysInMonth')); -vi.mock('date-fns/getMinutes', () => import('date-fns-v3/getMinutes')); -vi.mock('date-fns/isAfter', () => import('date-fns-v3/isAfter')); -vi.mock('date-fns/isBefore', () => import('date-fns-v3/isBefore')); -vi.mock('date-fns/isEqual', () => import('date-fns-v3/isEqual')); -vi.mock('date-fns/isSameDay', () => import('date-fns-v3/isSameDay')); -vi.mock('date-fns/isSameYear', () => import('date-fns-v3/isSameYear')); -vi.mock('date-fns/isSameMonth', () => import('date-fns-v3/isSameMonth')); -vi.mock('date-fns/isSameHour', () => import('date-fns-v3/isSameHour')); -vi.mock('date-fns/isValid', () => import('date-fns-v3/isValid')); -vi.mock('date-fns/parse', () => import('date-fns-v3/parse')); -vi.mock('date-fns/setDate', () => import('date-fns-v3/setDate')); -vi.mock('date-fns/setHours', () => import('date-fns-v3/setHours')); -vi.mock('date-fns/setMinutes', () => import('date-fns-v3/setMinutes')); -vi.mock('date-fns/setMonth', () => import('date-fns-v3/setMonth')); -vi.mock('date-fns/setSeconds', () => import('date-fns-v3/setSeconds')); -vi.mock('date-fns/setMilliseconds', () => import('date-fns-v3/setMilliseconds')); -vi.mock('date-fns/setYear', () => import('date-fns-v3/setYear')); -vi.mock('date-fns/startOfDay', () => import('date-fns-v3/startOfDay')); -vi.mock('date-fns/startOfMonth', () => import('date-fns-v3/startOfMonth')); -vi.mock('date-fns/endOfMonth', () => import('date-fns-v3/endOfMonth')); -vi.mock('date-fns/startOfWeek', () => import('date-fns-v3/startOfWeek')); -vi.mock('date-fns/startOfYear', () => import('date-fns-v3/startOfYear')); -vi.mock('date-fns/isWithinInterval', () => import('date-fns-v3/isWithinInterval')); -vi.mock('date-fns/locale/en-US', () => import('date-fns-v3/locale/en-US')); +vi.mock('date-fns/addSeconds', () => import('date-fns-v4/addSeconds')); +vi.mock('date-fns/addMinutes', () => import('date-fns-v4/addMinutes')); +vi.mock('date-fns/addHours', () => import('date-fns-v4/addHours')); +vi.mock('date-fns/addDays', () => import('date-fns-v4/addDays')); +vi.mock('date-fns/addWeeks', () => import('date-fns-v4/addWeeks')); +vi.mock('date-fns/addMonths', () => import('date-fns-v4/addMonths')); +vi.mock('date-fns/addYears', () => import('date-fns-v4/addYears')); +vi.mock('date-fns/endOfDay', () => import('date-fns-v4/endOfDay')); +vi.mock('date-fns/endOfWeek', () => import('date-fns-v4/endOfWeek')); +vi.mock('date-fns/endOfYear', () => import('date-fns-v4/endOfYear')); +vi.mock('date-fns/format', () => import('date-fns-v4/format')); +vi.mock('date-fns/getHours', () => import('date-fns-v4/getHours')); +vi.mock('date-fns/getSeconds', () => import('date-fns-v4/getSeconds')); +vi.mock('date-fns/getMilliseconds', () => import('date-fns-v4/getMilliseconds')); +vi.mock('date-fns/getWeek', () => import('date-fns-v4/getWeek')); +vi.mock('date-fns/getYear', () => import('date-fns-v4/getYear')); +vi.mock('date-fns/getMonth', () => import('date-fns-v4/getMonth')); +vi.mock('date-fns/getDate', () => import('date-fns-v4/getDate')); +vi.mock('date-fns/getDaysInMonth', () => import('date-fns-v4/getDaysInMonth')); +vi.mock('date-fns/getMinutes', () => import('date-fns-v4/getMinutes')); +vi.mock('date-fns/isAfter', () => import('date-fns-v4/isAfter')); +vi.mock('date-fns/isBefore', () => import('date-fns-v4/isBefore')); +vi.mock('date-fns/isEqual', () => import('date-fns-v4/isEqual')); +vi.mock('date-fns/isSameDay', () => import('date-fns-v4/isSameDay')); +vi.mock('date-fns/isSameYear', () => import('date-fns-v4/isSameYear')); +vi.mock('date-fns/isSameMonth', () => import('date-fns-v4/isSameMonth')); +vi.mock('date-fns/isSameHour', () => import('date-fns-v4/isSameHour')); +vi.mock('date-fns/isValid', () => import('date-fns-v4/isValid')); +vi.mock('date-fns/parse', () => import('date-fns-v4/parse')); +vi.mock('date-fns/setDate', () => import('date-fns-v4/setDate')); +vi.mock('date-fns/setHours', () => import('date-fns-v4/setHours')); +vi.mock('date-fns/setMinutes', () => import('date-fns-v4/setMinutes')); +vi.mock('date-fns/setMonth', () => import('date-fns-v4/setMonth')); +vi.mock('date-fns/setSeconds', () => import('date-fns-v4/setSeconds')); +vi.mock('date-fns/setMilliseconds', () => import('date-fns-v4/setMilliseconds')); +vi.mock('date-fns/setYear', () => import('date-fns-v4/setYear')); +vi.mock('date-fns/startOfDay', () => import('date-fns-v4/startOfDay')); +vi.mock('date-fns/startOfMonth', () => import('date-fns-v4/startOfMonth')); +vi.mock('date-fns/endOfMonth', () => import('date-fns-v4/endOfMonth')); +vi.mock('date-fns/startOfWeek', () => import('date-fns-v4/startOfWeek')); +vi.mock('date-fns/startOfYear', () => import('date-fns-v4/startOfYear')); +vi.mock('date-fns/isWithinInterval', () => import('date-fns-v4/isWithinInterval')); +vi.mock('date-fns/locale/en-US', () => import('date-fns-v4/locale/en-US')); describe('', () => { describeGregorianAdapter(AdapterDateFns, { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a9d6713ced3f..7152c9fcab2a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -400,7 +400,7 @@ importers: version: 0.12.5 vitest: specifier: 2.1.2 - version: 2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.1)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0) + version: 2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.2)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0) webpack: specifier: ^5.95.0 version: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) @@ -1652,8 +1652,8 @@ importers: specifier: ^3.7.0 version: 3.7.0(@swc/helpers@0.5.5)(vite@5.3.4(@types/node@20.16.11)(terser@5.27.0)) '@vitest/ui': - specifier: 2.1.1 - version: 2.1.1(vitest@2.1.2) + specifier: 2.1.2 + version: 2.1.2(vitest@2.1.2) jsdom: specifier: ^24.1.3 version: 24.1.3 @@ -1665,7 +1665,7 @@ importers: version: 18.3.1(react@18.3.1) vitest: specifier: 2.1.2 - version: 2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.1)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0) + version: 2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.2)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0) packages: @@ -4622,9 +4622,6 @@ packages: vite: optional: true - '@vitest/pretty-format@2.1.1': - resolution: {integrity: sha512-SjxPFOtuINDUW8/UkElJYQSFtnWX7tMksSGW0vfjxMneFqxVr8YJ979QpMbDW7g+BIiq88RAGDjf7en6rvLPPQ==} - '@vitest/pretty-format@2.1.2': resolution: {integrity: sha512-FIoglbHrSUlOJPDGIrh2bjX1sNars5HbxlcsFKCtKzu4+5lpsRhOCVcuzp0fEhAGHkPZRIXVNzPcpSlkoZ3LuA==} @@ -4637,13 +4634,10 @@ packages: '@vitest/spy@2.1.2': resolution: {integrity: sha512-GSUi5zoy+abNRJwmFhBDC0yRuVUn8WMlQscvnbbXdKLXX9dE59YbfwXxuJ/mth6eeqIzofU8BB5XDo/Ns/qK2A==} - '@vitest/ui@2.1.1': - resolution: {integrity: sha512-IIxo2LkQDA+1TZdPLYPclzsXukBWd5dX2CKpGqH8CCt8Wh0ZuDn4+vuQ9qlppEju6/igDGzjWF/zyorfsf+nHg==} + '@vitest/ui@2.1.2': + resolution: {integrity: sha512-92gcNzkDnmxOxyHzQrQYRsoV9Q0Aay0r4QMLnV+B+lbqlUWa8nDg9ivyLV5mMVTtGirHsYUGGh/zbIA55gBZqA==} peerDependencies: - vitest: 2.1.1 - - '@vitest/utils@2.1.1': - resolution: {integrity: sha512-Y6Q9TsI+qJ2CC0ZKj6VBb+T8UPz593N113nnUykqwANqhgf3QkZeHFlusgKLTqrnVHbj/XDKZcDHol+dxVT+rQ==} + vitest: 2.1.2 '@vitest/utils@2.1.2': resolution: {integrity: sha512-zMO2KdYy6mx56btx9JvAqAZ6EyS3g49krMPPrgOp1yxGZiA93HumGk+bZ5jIZtOg5/VBYl5eBmGRQHqq4FG6uQ==} @@ -11880,7 +11874,7 @@ snapshots: dependencies: '@codspeed/core': 3.1.1 vite: 5.3.4(@types/node@20.16.11)(terser@5.27.0) - vitest: 2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.1)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0) + vitest: 2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.2)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0) transitivePeerDependencies: - debug @@ -14061,7 +14055,7 @@ snapshots: msw: 2.4.4(typescript@5.6.2) sirv: 2.0.4 tinyrainbow: 1.2.0 - vitest: 2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.1)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0) + vitest: 2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.2)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0) ws: 8.18.0 optionalDependencies: playwright: 1.44.1 @@ -14088,10 +14082,6 @@ snapshots: msw: 2.4.4(typescript@5.6.2) vite: 5.3.4(@types/node@20.16.11)(terser@5.27.0) - '@vitest/pretty-format@2.1.1': - dependencies: - tinyrainbow: 1.2.0 - '@vitest/pretty-format@2.1.2': dependencies: tinyrainbow: 1.2.0 @@ -14111,22 +14101,16 @@ snapshots: dependencies: tinyspy: 3.0.0 - '@vitest/ui@2.1.1(vitest@2.1.2)': + '@vitest/ui@2.1.2(vitest@2.1.2)': dependencies: - '@vitest/utils': 2.1.1 + '@vitest/utils': 2.1.2 fflate: 0.8.2 flatted: 3.3.1 pathe: 1.1.2 sirv: 2.0.4 tinyglobby: 0.2.9 tinyrainbow: 1.2.0 - vitest: 2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.1)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0) - - '@vitest/utils@2.1.1': - dependencies: - '@vitest/pretty-format': 2.1.1 - loupe: 3.1.1 - tinyrainbow: 1.2.0 + vitest: 2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.2)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0) '@vitest/utils@2.1.2': dependencies: @@ -20783,7 +20767,7 @@ snapshots: fsevents: 2.3.3 terser: 5.27.0 - vitest@2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.1)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0): + vitest@2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.2)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0): dependencies: '@vitest/expect': 2.1.2 '@vitest/mocker': 2.1.2(@vitest/spy@2.1.2)(msw@2.4.4(typescript@5.6.2))(vite@5.3.4(@types/node@20.16.11)(terser@5.27.0)) @@ -20807,7 +20791,7 @@ snapshots: optionalDependencies: '@types/node': 20.16.11 '@vitest/browser': 2.1.2(@vitest/spy@2.1.2)(playwright@1.44.1)(typescript@5.6.2)(vite@5.3.4(@types/node@20.16.11)(terser@5.27.0))(vitest@2.1.2) - '@vitest/ui': 2.1.1(vitest@2.1.2) + '@vitest/ui': 2.1.2(vitest@2.1.2) jsdom: 24.1.3 transitivePeerDependencies: - less diff --git a/test/performance-charts/package.json b/test/performance-charts/package.json index 647abe1f2ef4..b6dbaf7360fd 100644 --- a/test/performance-charts/package.json +++ b/test/performance-charts/package.json @@ -16,7 +16,7 @@ "@testing-library/user-event": "^14.5.2", "@vitejs/plugin-react": "^4.3.1", "@vitejs/plugin-react-swc": "^3.7.0", - "@vitest/ui": "2.1.1", + "@vitest/ui": "2.1.2", "jsdom": "^24.1.3", "react": "^18.3.1", "react-dom": "^18.3.1", From f338a122f03cb5bfe90b9a20cbc52f86c887edd4 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 8 Oct 2024 14:56:07 +0200 Subject: [PATCH 057/119] dedupe --- pnpm-lock.yaml | 694 +++++++------------------------------------------ 1 file changed, 91 insertions(+), 603 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7152c9fcab2a..db4d09856ae1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -403,7 +403,7 @@ importers: version: 2.1.2(@types/node@20.16.11)(@vitest/browser@2.1.2)(@vitest/ui@2.1.2)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.2))(terser@5.27.0) webpack: specifier: ^5.95.0 - version: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + version: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) webpack-bundle-analyzer: specifier: ^4.10.2 version: 4.10.2 @@ -704,7 +704,7 @@ importers: version: 4.2.6 '@types/webpack-bundle-analyzer': specifier: ^4.7.0 - version: 4.7.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + version: 4.7.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) gm: specifier: ^1.25.0 version: 1.25.0 @@ -1776,18 +1776,10 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/code-frame@7.24.7': - resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} - engines: {node: '>=6.9.0'} - '@babel/code-frame@7.25.7': resolution: {integrity: sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.25.4': - resolution: {integrity: sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ==} - engines: {node: '>=6.9.0'} - '@babel/compat-data@7.25.7': resolution: {integrity: sha512-9ickoLz+hcXCeh7jrcin+/SLWm+GkxE2kTvoYyp38p4WkdFXfQJxDFGWp/YHjiKLPx06z2A7W8XKuqbReXDzsw==} engines: {node: '>=6.9.0'} @@ -1796,18 +1788,10 @@ packages: resolution: {integrity: sha512-yJ474Zv3cwiSOO9nXJuqzvwEeM+chDuQ8GJirw+pZ91sCGCyOZ3dJkVE09fTV0VEVzXyLWhh3G/AolYTPX7Mow==} engines: {node: '>=6.9.0'} - '@babel/generator@7.25.6': - resolution: {integrity: sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==} - engines: {node: '>=6.9.0'} - '@babel/generator@7.25.7': resolution: {integrity: sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==} engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.24.7': - resolution: {integrity: sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==} - engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.25.7': resolution: {integrity: sha512-4xwU8StnqnlIhhioZf1tqnVWeQ9pvH/ujS8hRfw/WOza+/a+1qv69BWNy+oY231maTCWgKWhfBU7kDpsds6zAA==} engines: {node: '>=6.9.0'} @@ -1816,32 +1800,16 @@ packages: resolution: {integrity: sha512-12xfNeKNH7jubQNm7PAkzlLwEmCs1tfuX3UjIw6vP6QXi+leKh6+LyC/+Ed4EIQermwd58wsyh070yjDHFlNGg==} engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.25.2': - resolution: {integrity: sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==} - engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.25.7': resolution: {integrity: sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==} engines: {node: '>=6.9.0'} - '@babel/helper-create-class-features-plugin@7.25.4': - resolution: {integrity: sha512-ro/bFs3/84MDgDmMwbcHgDa8/E6J3QKNTk4xJJnVeFtGE+tL0K26E3pNxhYz2b67fJpt7Aphw5XcploKXuCvCQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-create-class-features-plugin@7.25.7': resolution: {integrity: sha512-bD4WQhbkx80mAyj/WCm4ZHcF4rDxkoLFO6ph8/5/mQ3z4vAzltQXAmbc7GvVJx5H+lk5Mi5EmbTeox5nMGCsbw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-create-regexp-features-plugin@7.25.2': - resolution: {integrity: sha512-+wqVGP+DFmqwFD3EH6TMTfUNeqDehV3E/dl+Sd54eaXqm17tEUNbEIn4sVivVowbvUpOtIGxdo3GoXyDH9N/9g==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-create-regexp-features-plugin@7.25.7': resolution: {integrity: sha512-byHhumTj/X47wJ6C6eLpK7wW/WBEcnUeb7D0FNc/jFQnQVw7DOso3Zz5u9x/zLrFVkHa89ZGDbkAa1D54NdrCQ==} engines: {node: '>=6.9.0'} @@ -1853,46 +1821,24 @@ packages: peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - '@babel/helper-member-expression-to-functions@7.24.8': - resolution: {integrity: sha512-LABppdt+Lp/RlBxqrh4qgf1oEH/WxdzQNDJIu5gC/W1GyvPVrOBiItmmM8wan2fm4oYqFuFfkXmlGpLQhPY8CA==} - engines: {node: '>=6.9.0'} - '@babel/helper-member-expression-to-functions@7.25.7': resolution: {integrity: sha512-O31Ssjd5K6lPbTX9AAYpSKrZmLeagt9uwschJd+Ixo6QiRyfpvgtVQp8qrDR9UNFjZ8+DO34ZkdrN+BnPXemeA==} engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.24.7': - resolution: {integrity: sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==} - engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.25.7': resolution: {integrity: sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.25.2': - resolution: {integrity: sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-module-transforms@7.25.7': resolution: {integrity: sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-optimise-call-expression@7.24.7': - resolution: {integrity: sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==} - engines: {node: '>=6.9.0'} - '@babel/helper-optimise-call-expression@7.25.7': resolution: {integrity: sha512-VAwcwuYhv/AT+Vfr28c9y6SHzTan1ryqrydSTFGjU0uDJHw3uZ+PduI8plCLkRsDnqK2DMEDmwrOQRsK/Ykjng==} engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.24.8': - resolution: {integrity: sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==} - engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.25.7': resolution: {integrity: sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==} engines: {node: '>=6.9.0'} @@ -1903,54 +1849,28 @@ packages: peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-replace-supers@7.25.0': - resolution: {integrity: sha512-q688zIvQVYtZu+i2PsdIu/uWGRpfxzr5WESsfpShfZECkO+d2o+WROWezCi/Q6kJ0tfPa5+pUGUlfx2HhrA3Bg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-replace-supers@7.25.7': resolution: {integrity: sha512-iy8JhqlUW9PtZkd4pHM96v6BdJ66Ba9yWSE4z0W4TvSZwLBPkyDsiIU3ENe4SmrzRBs76F7rQXTy1lYC49n6Lw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-simple-access@7.24.7': - resolution: {integrity: sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==} - engines: {node: '>=6.9.0'} - '@babel/helper-simple-access@7.25.7': resolution: {integrity: sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==} engines: {node: '>=6.9.0'} - '@babel/helper-skip-transparent-expression-wrappers@7.24.7': - resolution: {integrity: sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==} - engines: {node: '>=6.9.0'} - '@babel/helper-skip-transparent-expression-wrappers@7.25.7': resolution: {integrity: sha512-pPbNbchZBkPMD50K0p3JGcFMNLVUCuU/ABybm/PGNj4JiHrpmNyqqCphBk4i19xXtNV0JhldQJJtbSW5aUvbyA==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.24.8': - resolution: {integrity: sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==} - engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.25.7': resolution: {integrity: sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.24.7': - resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} - engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.25.7': resolution: {integrity: sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.24.8': - resolution: {integrity: sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==} - engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.25.7': resolution: {integrity: sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==} engines: {node: '>=6.9.0'} @@ -1963,10 +1883,6 @@ packages: resolution: {integrity: sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.24.7': - resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} - engines: {node: '>=6.9.0'} - '@babel/highlight@7.25.7': resolution: {integrity: sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==} engines: {node: '>=6.9.0'} @@ -1978,11 +1894,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/parser@7.25.6': - resolution: {integrity: sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==} - engines: {node: '>=6.0.0'} - hasBin: true - '@babel/parser@7.25.7': resolution: {integrity: sha512-aZn7ETtQsjjGG5HruveUK06cU3Hljuhd9Iojm4M8WWv3wLE6OkE5PWbDUkItmMgegmccaITudyuW5RPYrYlgWw==} engines: {node: '>=6.0.0'} @@ -2085,12 +1996,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-jsx@7.24.7': - resolution: {integrity: sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-jsx@7.25.7': resolution: {integrity: sha512-ruZOnKO+ajVL/MVx+PwNBPOkrnXTXoWMtte1MBpegfCArhqOe3Bj52avVj1huLLxNKYKXYaSxZ2F+woK1ekXfw==} engines: {node: '>=6.9.0'} @@ -2181,12 +2086,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-properties@7.25.4': - resolution: {integrity: sha512-nZeZHyCWPfjkdU5pA/uHiTaDAFUEqkpzf1YoQT2NeSynCGYq9rxfyI3XpQbfx/a0hSnFH6TGlEXvae5Vi7GD8g==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-properties@7.25.7': resolution: {integrity: sha512-mhyfEW4gufjIqYFo9krXHJ3ElbFLIze5IDp+wQTxoPd+mwFb1NxatNAwmv8Q8Iuxv7Zc+q8EkiMQwc9IhyGf4g==} engines: {node: '>=6.9.0'} @@ -2301,12 +2200,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-commonjs@7.24.8': - resolution: {integrity: sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-commonjs@7.25.7': resolution: {integrity: sha512-L9Gcahi0kKFYXvweO6n0wc3ZG1ChpSFdgG+eV1WYZ3/dGbJK7vvk91FgGgak8YwRgrCuihF8tE/Xg07EkL5COg==} engines: {node: '>=6.9.0'} @@ -2337,12 +2230,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-nullish-coalescing-operator@7.24.7': - resolution: {integrity: sha512-Ts7xQVk1OEocqzm8rHMXHlxvsfZ0cEF2yomUqpKENHWMF4zKk175Y4q8H5knJes6PgYad50uuRmt3UJuhBw8pQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-nullish-coalescing-operator@7.25.7': resolution: {integrity: sha512-FbuJ63/4LEL32mIxrxwYaqjJxpbzxPVQj5a+Ebrc8JICV6YX8nE53jY+K0RZT3um56GoNWgkS2BQ/uLGTjtwfw==} engines: {node: '>=6.9.0'} @@ -2373,12 +2260,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-optional-chaining@7.24.8': - resolution: {integrity: sha512-5cTOLSMs9eypEy8JUVvIKOu6NgvbJMnpG62VpIHrTmROdQ+L5mDAaI40g25k5vXti55JWNX5jCkq3HZxXBQANw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-optional-chaining@7.25.7': resolution: {integrity: sha512-h39agClImgPWg4H8mYVAbD1qP9vClFbEjqoJmt87Zen8pjqK8FTPUwrOXAvqu5soytwxrLMd2fx2KSCp2CHcNg==} engines: {node: '>=6.9.0'} @@ -2391,12 +2272,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-private-methods@7.25.4': - resolution: {integrity: sha512-ao8BG7E2b/URaUQGqN3Tlsg+M3KlHY6rJ1O1gXAEUnZoyNQnvKyH87Kfg+FoxSeyWUB8ISZZsC91C44ZuBFytw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-private-methods@7.25.7': resolution: {integrity: sha512-KY0hh2FluNxMLwOCHbxVOKfdB5sjWG4M183885FmaqWWiGMhRZq4DQRKH6mHdEucbJnyDyYiZNwNG424RymJjA==} engines: {node: '>=6.9.0'} @@ -2564,21 +2439,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/register@7.24.6': - resolution: {integrity: sha512-WSuFCc2wCqMeXkz/i3yfAAsxwWflEgbVkZzivgAmXl/MxrXeoYFZOOPllbC8R8WTF7u61wSRQtDVZ1879cdu6w==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/register@7.25.7': resolution: {integrity: sha512-qHTd2Rhn/rKhSUwdY6+n98FmwXN+N+zxSVx3zWqRe9INyvTpv+aQ5gDV2+43ACd3VtMBzPPljbb0gZb8u5ma6Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/regjsgen@0.8.0': - resolution: {integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==} - '@babel/runtime-corejs2@7.25.7': resolution: {integrity: sha512-xdsLBlDCJIZzwH1fBJ7GJu+bRFO0Sqv10WotmwMu83Joep1erPcWbTr84rZD42kPzSjtmrFgshdWHKfQTWOsng==} engines: {node: '>=6.9.0'} @@ -2587,10 +2453,6 @@ packages: resolution: {integrity: sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==} engines: {node: '>=6.9.0'} - '@babel/template@7.25.0': - resolution: {integrity: sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==} - engines: {node: '>=6.9.0'} - '@babel/template@7.25.7': resolution: {integrity: sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==} engines: {node: '>=6.9.0'} @@ -2599,10 +2461,6 @@ packages: resolution: {integrity: sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==} engines: {node: '>=6.9.0'} - '@babel/types@7.25.6': - resolution: {integrity: sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==} - engines: {node: '>=6.9.0'} - '@babel/types@7.25.7': resolution: {integrity: sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==} engines: {node: '>=6.9.0'} @@ -3265,7 +3123,7 @@ packages: resolution: {integrity: sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==} engines: {node: '>=12.0.0'} peerDependencies: - '@types/react': ^17.0.0 || ^18.0.0 + '@types/react': ^18.3.4 react: ^17.0.0 || ^18.0.0 react-dom: ^17.0.0 || ^18.0.0 peerDependenciesMeta: @@ -5127,10 +4985,6 @@ packages: bluebird@3.4.7: resolution: {integrity: sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==} - body-parser@1.20.2: - resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} - engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - body-parser@1.20.3: resolution: {integrity: sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} @@ -5158,11 +5012,6 @@ packages: browser-stdout@1.3.1: resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} - browserslist@4.23.3: - resolution: {integrity: sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - browserslist@4.24.0: resolution: {integrity: sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -5254,9 +5103,6 @@ packages: camelize@1.0.1: resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - caniuse-lite@1.0.30001647: - resolution: {integrity: sha512-n83xdNiyeNcHpzWY+1aFbqCK7LuLfBricc4+alSQL2Xb6OR3XpnQAmlDG+pQcdTfiHRuLcQ96VOfrPSGiNJYSg==} - caniuse-lite@1.0.30001667: resolution: {integrity: sha512-7LTwJjcRkzKFmtqGsibMeuXmvFDfZq/nzIjnmgCGzKKRVzjD72selLDK1oPF/Oxzmt4fNcPvTDvGqSDG4tCALw==} @@ -6015,9 +5861,6 @@ packages: electron-to-chromium@1.5.33: resolution: {integrity: sha512-+cYTcFB1QqD4j4LegwLfpCNxifb6dDFUAwk6RsLusCwIaZI6or2f+q8rs5tTB2YC53HhOlIbEaqHMAAC8IOIwA==} - electron-to-chromium@1.5.4: - resolution: {integrity: sha512-orzA81VqLyIGUEA77YkVA1D+N+nNfl2isJVjjmOyrlxuooZ19ynb+dOlaDTqd/idKRS9lDCSBmtzM+kyCsMnkA==} - emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -6579,10 +6422,6 @@ packages: resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==} engines: {node: '>=8.0.0'} - foreground-child@3.1.1: - resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} - engines: {node: '>=14'} - foreground-child@3.3.0: resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} engines: {node: '>=14'} @@ -7441,15 +7280,6 @@ packages: canvas: optional: true - jsesc@0.5.0: - resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} - hasBin: true - - jsesc@2.5.2: - resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} - engines: {node: '>=4'} - hasBin: true - jsesc@3.0.2: resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} engines: {node: '>=6'} @@ -8134,10 +7964,6 @@ packages: resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} engines: {node: '>=8'} - minipass@7.0.4: - resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} - engines: {node: '>=16 || 14 >=14.17'} - minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} @@ -8758,9 +8584,6 @@ packages: resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} engines: {node: '>= 14.16'} - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - picocolors@1.1.0: resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} @@ -8978,14 +8801,6 @@ packages: resolution: {integrity: sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==} engines: {node: '>=0.9'} - qs@6.11.0: - resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} - engines: {node: '>=0.6'} - - qs@6.11.2: - resolution: {integrity: sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==} - engines: {node: '>=0.6'} - qs@6.13.0: resolution: {integrity: sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==} engines: {node: '>=0.6'} @@ -9153,10 +8968,6 @@ packages: resolution: {integrity: sha512-ECkTw8TmJwW60lOTR+ZkODISW6RQ8+2CL3COqtiJKLd6MmB45hN51HprHFziKLGkAuTGQhBb91V8cy+KHlaCjw==} engines: {node: '>= 0.4'} - regenerate-unicode-properties@10.1.1: - resolution: {integrity: sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==} - engines: {node: '>=4'} - regenerate-unicode-properties@10.2.0: resolution: {integrity: sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==} engines: {node: '>=4'} @@ -9177,10 +8988,6 @@ packages: resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} engines: {node: '>= 0.4'} - regexpu-core@5.3.2: - resolution: {integrity: sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==} - engines: {node: '>=4'} - regexpu-core@6.1.1: resolution: {integrity: sha512-k67Nb9jvwJcJmVpw0jPttR1/zVfnKf8Km0IPatrU/zJ5XeG3+Slx0xLXs9HByJSzXzrlz5EDvN6yLNMDc2qdnw==} engines: {node: '>=4'} @@ -9199,10 +9006,6 @@ packages: resolution: {integrity: sha512-1DHODs4B8p/mQHU9kr+jv8+wIC9mtG4eBHxWxIq5mhjE3D5oORhCc6deRKzTjs9DcfRFmj9BHSDguZklqCGFWQ==} hasBin: true - regjsparser@0.9.1: - resolution: {integrity: sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==} - hasBin: true - relateurl@0.2.7: resolution: {integrity: sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==} engines: {node: '>= 0.10'} @@ -9529,10 +9332,6 @@ packages: resolution: {integrity: sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==} engines: {node: '>=4'} - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -10335,16 +10134,6 @@ packages: resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} engines: {node: '>=10.13.0'} - webpack@5.94.0: - resolution: {integrity: sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==} - engines: {node: '>=10.13.0'} - hasBin: true - peerDependencies: - webpack-cli: '*' - peerDependenciesMeta: - webpack-cli: - optional: true - webpack@5.95.0: resolution: {integrity: sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==} engines: {node: '>=10.13.0'} @@ -10753,17 +10542,10 @@ snapshots: '@nicolo-ribaudo/chokidar-2': 2.1.8-no-fsevents.3 chokidar: 3.6.0 - '@babel/code-frame@7.24.7': - dependencies: - '@babel/highlight': 7.24.7 - picocolors: 1.0.1 - '@babel/code-frame@7.25.7': dependencies: '@babel/highlight': 7.25.7 - picocolors: 1.0.1 - - '@babel/compat-data@7.25.4': {} + picocolors: 1.1.0 '@babel/compat-data@7.25.7': {} @@ -10787,13 +10569,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/generator@7.25.6': - dependencies: - '@babel/types': 7.25.7 - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - jsesc: 2.5.2 - '@babel/generator@7.25.7': dependencies: '@babel/types': 7.25.7 @@ -10801,10 +10576,6 @@ snapshots: '@jridgewell/trace-mapping': 0.3.25 jsesc: 3.0.2 - '@babel/helper-annotate-as-pure@7.24.7': - dependencies: - '@babel/types': 7.25.7 - '@babel/helper-annotate-as-pure@7.25.7': dependencies: '@babel/types': 7.25.7 @@ -10816,14 +10587,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-compilation-targets@7.25.2': - dependencies: - '@babel/compat-data': 7.25.4 - '@babel/helper-validator-option': 7.24.8 - browserslist: 4.23.3 - lru-cache: 5.1.1 - semver: 6.3.1 - '@babel/helper-compilation-targets@7.25.7': dependencies: '@babel/compat-data': 7.25.7 @@ -10832,19 +10595,6 @@ snapshots: lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.25.4(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-member-expression-to-functions': 7.24.8 - '@babel/helper-optimise-call-expression': 7.24.7 - '@babel/helper-replace-supers': 7.25.0(@babel/core@7.25.7) - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/traverse': 7.25.7 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - '@babel/helper-create-class-features-plugin@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 @@ -10858,13 +10608,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-create-regexp-features-plugin@7.25.2(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-annotate-as-pure': 7.24.7 - regexpu-core: 5.3.2 - semver: 6.3.1 - '@babel/helper-create-regexp-features-plugin@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 @@ -10875,7 +10618,7 @@ snapshots: '@babel/helper-define-polyfill-provider@0.6.2(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-compilation-targets': 7.25.2 + '@babel/helper-compilation-targets': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 debug: 4.3.6(supports-color@8.1.1) lodash.debounce: 4.0.8 @@ -10883,13 +10626,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-member-expression-to-functions@7.24.8': - dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 - transitivePeerDependencies: - - supports-color - '@babel/helper-member-expression-to-functions@7.25.7': dependencies: '@babel/traverse': 7.25.7 @@ -10897,13 +10633,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-module-imports@7.24.7': - dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 - transitivePeerDependencies: - - supports-color - '@babel/helper-module-imports@7.25.7': dependencies: '@babel/traverse': 7.25.7 @@ -10911,16 +10640,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.25.2(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-simple-access': 7.24.7 - '@babel/helper-validator-identifier': 7.24.7 - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color - '@babel/helper-module-transforms@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 @@ -10931,16 +10650,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-optimise-call-expression@7.24.7': - dependencies: - '@babel/types': 7.25.7 - '@babel/helper-optimise-call-expression@7.25.7': dependencies: '@babel/types': 7.25.7 - '@babel/helper-plugin-utils@7.24.8': {} - '@babel/helper-plugin-utils@7.25.7': {} '@babel/helper-remap-async-to-generator@7.25.7(@babel/core@7.25.7)': @@ -10952,15 +10665,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-replace-supers@7.25.0(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-member-expression-to-functions': 7.24.8 - '@babel/helper-optimise-call-expression': 7.24.7 - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color - '@babel/helper-replace-supers@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 @@ -10970,13 +10674,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-simple-access@7.24.7': - dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 - transitivePeerDependencies: - - supports-color - '@babel/helper-simple-access@7.25.7': dependencies: '@babel/traverse': 7.25.7 @@ -10984,13 +10681,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-skip-transparent-expression-wrappers@7.24.7': - dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 - transitivePeerDependencies: - - supports-color - '@babel/helper-skip-transparent-expression-wrappers@7.25.7': dependencies: '@babel/traverse': 7.25.7 @@ -10998,16 +10688,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-string-parser@7.24.8': {} - '@babel/helper-string-parser@7.25.7': {} - '@babel/helper-validator-identifier@7.24.7': {} - '@babel/helper-validator-identifier@7.25.7': {} - '@babel/helper-validator-option@7.24.8': {} - '@babel/helper-validator-option@7.25.7': {} '@babel/helper-wrap-function@7.25.7': @@ -11023,19 +10707,12 @@ snapshots: '@babel/template': 7.25.7 '@babel/types': 7.25.7 - '@babel/highlight@7.24.7': - dependencies: - '@babel/helper-validator-identifier': 7.24.7 - chalk: 2.4.2 - js-tokens: 4.0.0 - picocolors: 1.0.1 - '@babel/highlight@7.25.7': dependencies: '@babel/helper-validator-identifier': 7.25.7 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.0.1 + picocolors: 1.1.0 '@babel/node@7.25.7(@babel/core@7.25.7)': dependencies: @@ -11047,10 +10724,6 @@ snapshots: regenerator-runtime: 0.14.1 v8flags: 3.2.0 - '@babel/parser@7.25.6': - dependencies: - '@babel/types': 7.25.7 - '@babel/parser@7.25.7': dependencies: '@babel/types': 7.25.7 @@ -11093,8 +10766,8 @@ snapshots: '@babel/plugin-proposal-private-methods@7.18.6(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-create-class-features-plugin': 7.25.4(@babel/core@7.25.7) - '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.7) + '@babel/helper-plugin-utils': 7.25.7 transitivePeerDependencies: - supports-color @@ -11110,7 +10783,7 @@ snapshots: '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.25.7)': dependencies: @@ -11130,7 +10803,7 @@ snapshots: '@babel/plugin-syntax-flow@7.24.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-import-assertions@7.25.7(@babel/core@7.25.7)': dependencies: @@ -11152,11 +10825,6 @@ snapshots: '@babel/core': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-syntax-jsx@7.24.7(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-jsx@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 @@ -11170,7 +10838,7 @@ snapshots: '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.25.7)': dependencies: @@ -11190,7 +10858,7 @@ snapshots: '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.25.7)': dependencies: @@ -11210,7 +10878,7 @@ snapshots: '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-create-regexp-features-plugin': 7.25.2(@babel/core@7.25.7) + '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.7) '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-transform-arrow-functions@7.25.7(@babel/core@7.25.7)': @@ -11247,14 +10915,6 @@ snapshots: '@babel/core': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-transform-class-properties@7.25.4(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-create-class-features-plugin': 7.25.4(@babel/core@7.25.7) - '@babel/helper-plugin-utils': 7.24.8 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-class-properties@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 @@ -11335,7 +10995,7 @@ snapshots: '@babel/plugin-transform-flow-strip-types@7.24.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.25.7) '@babel/plugin-transform-for-of@7.25.7(@babel/core@7.25.7)': @@ -11385,15 +11045,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-commonjs@7.24.8(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-module-transforms': 7.25.2(@babel/core@7.25.7) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-simple-access': 7.24.7 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-modules-commonjs@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 @@ -11432,12 +11083,6 @@ snapshots: '@babel/core': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-transform-nullish-coalescing-operator@7.24.7(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.25.7) - '@babel/plugin-transform-nullish-coalescing-operator@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 @@ -11472,15 +11117,6 @@ snapshots: '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.25.7) - '@babel/plugin-transform-optional-chaining@7.24.8(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.25.7) - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-optional-chaining@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 @@ -11495,14 +11131,6 @@ snapshots: '@babel/core': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-transform-private-methods@7.25.4(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-create-class-features-plugin': 7.25.4(@babel/core@7.25.7) - '@babel/helper-plugin-utils': 7.24.8 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-private-methods@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 @@ -11546,12 +11174,12 @@ snapshots: '@babel/plugin-transform-react-jsx-self@7.24.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-transform-react-jsx-source@7.24.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.25.7)': dependencies: @@ -11747,8 +11375,8 @@ snapshots: '@babel/preset-flow@7.24.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-validator-option': 7.24.8 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-validator-option': 7.25.7 '@babel/plugin-transform-flow-strip-types': 7.24.7(@babel/core@7.25.7) '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.25.7)': @@ -11781,15 +11409,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/register@7.24.6(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - clone-deep: 4.0.1 - find-cache-dir: 2.1.0 - make-dir: 2.1.0 - pirates: 4.0.6 - source-map-support: 0.5.21 - '@babel/register@7.25.7(@babel/core@7.25.7)': dependencies: '@babel/core': 7.25.7 @@ -11799,8 +11418,6 @@ snapshots: pirates: 4.0.6 source-map-support: 0.5.21 - '@babel/regjsgen@0.8.0': {} - '@babel/runtime-corejs2@7.25.7': dependencies: core-js: 2.6.12 @@ -11810,12 +11427,6 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 - '@babel/template@7.25.0': - dependencies: - '@babel/code-frame': 7.24.7 - '@babel/parser': 7.25.6 - '@babel/types': 7.25.7 - '@babel/template@7.25.7': dependencies: '@babel/code-frame': 7.25.7 @@ -11834,12 +11445,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/types@7.25.6': - dependencies: - '@babel/helper-string-parser': 7.24.8 - '@babel/helper-validator-identifier': 7.24.7 - to-fast-properties: 2.0.0 - '@babel/types@7.25.7': dependencies: '@babel/helper-string-parser': 7.25.7 @@ -11905,7 +11510,7 @@ snapshots: '@emotion/babel-plugin@11.12.0': dependencies: - '@babel/helper-module-imports': 7.24.7 + '@babel/helper-module-imports': 7.25.7 '@babel/runtime': 7.25.7 '@emotion/hash': 0.9.2 '@emotion/memoize': 0.9.0 @@ -12212,12 +11817,12 @@ snapshots: '@gitbeaker/core@38.12.1': dependencies: '@gitbeaker/requester-utils': 38.12.1 - qs: 6.11.2 + qs: 6.13.0 xcase: 2.0.1 '@gitbeaker/requester-utils@38.12.1': dependencies: - qs: 6.11.2 + qs: 6.13.0 xcase: 2.0.1 '@gitbeaker/rest@38.12.1': @@ -12551,7 +12156,7 @@ snapshots: dependencies: '@babel/core': 7.25.7 '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.25.7) - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.25.7) + '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.25.7) '@babel/plugin-syntax-typescript': 7.25.7(@babel/core@7.25.7) '@babel/types': 7.25.7 '@mui/internal-docs-utils': 1.0.14 @@ -12564,9 +12169,9 @@ snapshots: '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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.7) + '@babel/plugin-transform-modules-commonjs': 7.25.7(@babel/core@7.25.7) '@babel/preset-typescript': 7.25.7(@babel/core@7.25.7) - '@babel/register': 7.24.6(@babel/core@7.25.7) + '@babel/register': 7.25.7(@babel/core@7.25.7) '@babel/runtime': 7.25.7 '@emotion/cache': 11.13.1 '@emotion/react': 11.13.3(@types/react@18.3.4)(react@18.3.1) @@ -13579,7 +13184,7 @@ snapshots: '@testing-library/dom@10.4.0': dependencies: - '@babel/code-frame': 7.24.7 + '@babel/code-frame': 7.25.7 '@babel/runtime': 7.25.7 '@types/aria-query': 5.0.4 aria-query: 5.3.0 @@ -13625,7 +13230,7 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.25.6 + '@babel/parser': 7.25.7 '@babel/types': 7.25.7 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 @@ -13637,7 +13242,7 @@ snapshots: '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.25.6 + '@babel/parser': 7.25.7 '@babel/types': 7.25.7 '@types/babel__traverse@7.20.6': @@ -13880,11 +13485,11 @@ snapshots: '@types/unist@3.0.3': {} - '@types/webpack-bundle-analyzer@4.7.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4)': + '@types/webpack-bundle-analyzer@4.7.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))': dependencies: '@types/node': 20.16.11 tapable: 2.2.1 - webpack: 5.94.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) transitivePeerDependencies: - '@swc/core' - esbuild @@ -14194,19 +13799,19 @@ snapshots: '@webassemblyjs/ast': 1.12.1 '@xtuc/long': 4.2.2 - '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.95.0)': + '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0)': dependencies: - webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0) - '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.95.0)': + '@webpack-cli/info@2.0.2(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0)': dependencies: - webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0) - '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack@5.95.0)': + '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0)': dependencies: - webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0) '@xtuc/ieee754@1.2.0': {} @@ -14547,11 +14152,11 @@ snapshots: autoprefixer@10.4.20(postcss@8.4.47): dependencies: - browserslist: 4.23.3 - caniuse-lite: 1.0.30001647 + browserslist: 4.24.0 + caniuse-lite: 1.0.30001667 fraction.js: 4.3.7 normalize-range: 0.1.2 - picocolors: 1.0.1 + picocolors: 1.1.0 postcss: 8.4.47 postcss-value-parser: 4.2.0 @@ -14576,11 +14181,11 @@ snapshots: '@babel/core': 7.25.7 find-cache-dir: 4.0.0 schema-utils: 4.2.0 - webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) babel-plugin-istanbul@7.0.0: dependencies: - '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-plugin-utils': 7.25.7 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 6.0.2 @@ -14604,16 +14209,16 @@ snapshots: babel-plugin-optimize-clsx@2.6.2: dependencies: - '@babel/generator': 7.25.6 - '@babel/template': 7.25.0 - '@babel/types': 7.25.6 + '@babel/generator': 7.25.7 + '@babel/template': 7.25.7 + '@babel/types': 7.25.7 find-cache-dir: 3.3.2 lodash: 4.17.21 object-hash: 2.2.0 babel-plugin-polyfill-corejs2@0.4.10(@babel/core@7.25.7): dependencies: - '@babel/compat-data': 7.25.4 + '@babel/compat-data': 7.25.7 '@babel/core': 7.25.7 '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.25.7) semver: 6.3.1 @@ -14696,23 +14301,6 @@ snapshots: bluebird@3.4.7: {} - body-parser@1.20.2: - dependencies: - bytes: 3.1.2 - content-type: 1.0.5 - debug: 2.6.9 - depd: 2.0.0 - destroy: 1.2.0 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - on-finished: 2.4.1 - qs: 6.11.0 - raw-body: 2.5.2 - type-is: 1.6.18 - unpipe: 1.0.0 - transitivePeerDependencies: - - supports-color - body-parser@1.20.3: dependencies: bytes: 3.1.2 @@ -14760,13 +14348,6 @@ snapshots: browser-stdout@1.3.1: {} - browserslist@4.23.3: - dependencies: - caniuse-lite: 1.0.30001647 - electron-to-chromium: 1.5.4 - node-releases: 2.0.18 - update-browserslist-db: 1.1.0(browserslist@4.23.3) - browserslist@4.24.0: dependencies: caniuse-lite: 1.0.30001667 @@ -14824,7 +14405,7 @@ snapshots: fs-minipass: 3.0.3 glob: 10.3.10 lru-cache: 10.4.3 - minipass: 7.0.4 + minipass: 7.1.2 minipass-collect: 2.0.1 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 @@ -14869,8 +14450,6 @@ snapshots: camelize@1.0.1: {} - caniuse-lite@1.0.30001647: {} - caniuse-lite@1.0.30001667: {} chai-dom@1.12.0(chai@4.5.0): @@ -15101,7 +14680,7 @@ snapshots: dependencies: schema-utils: 4.2.0 serialize-javascript: 6.0.2 - webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) compression@1.7.4: dependencies: @@ -15226,7 +14805,7 @@ snapshots: core-js-compat@3.38.1: dependencies: - browserslist: 4.23.3 + browserslist: 4.24.0 core-js@2.6.12: {} @@ -15669,8 +15248,6 @@ snapshots: electron-to-chromium@1.5.33: {} - electron-to-chromium@1.5.4: {} - emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} @@ -15976,7 +15553,7 @@ snapshots: lodash: 4.17.21 resolve: 2.0.0-next.5 semver: 5.7.2 - webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) transitivePeerDependencies: - supports-color @@ -16085,7 +15662,7 @@ snapshots: eslint-plugin-react-compiler@0.0.0-experimental-9ed098e-20240725(eslint@8.57.1): dependencies: '@babel/core': 7.25.7 - '@babel/parser': 7.25.6 + '@babel/parser': 7.25.7 '@babel/plugin-proposal-private-methods': 7.18.6(@babel/core@7.25.7) eslint: 8.57.1 hermes-parser: 0.20.1 @@ -16510,11 +16087,6 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 3.0.7 - foreground-child@3.1.1: - dependencies: - cross-spawn: 7.0.3 - signal-exit: 4.1.0 - foreground-child@3.3.0: dependencies: cross-spawn: 7.0.3 @@ -16564,7 +16136,7 @@ snapshots: fs-minipass@3.0.3: dependencies: - minipass: 7.0.4 + minipass: 7.1.2 fs-readdir-recursive@1.1.0: {} @@ -16713,15 +16285,15 @@ snapshots: glob@10.3.10: dependencies: - foreground-child: 3.1.1 + foreground-child: 3.3.0 jackspeak: 2.3.6 minimatch: 9.0.4 - minipass: 7.0.4 + minipass: 7.1.2 path-scurry: 1.10.1 glob@11.0.0: dependencies: - foreground-child: 3.1.1 + foreground-child: 3.3.0 jackspeak: 4.0.2 minimatch: 10.0.1 minipass: 7.1.2 @@ -16822,7 +16394,7 @@ snapshots: extend: 3.0.2 gaxios: 6.1.1(encoding@0.1.13) google-auth-library: 9.14.1(encoding@0.1.13) - qs: 6.11.2 + qs: 6.13.0 url-template: 2.0.8 uuid: 9.0.1 transitivePeerDependencies: @@ -16955,7 +16527,7 @@ snapshots: pretty-error: 4.0.0 tapable: 2.2.1 optionalDependencies: - webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) htmlparser2@6.1.0: dependencies: @@ -17302,7 +16874,7 @@ snapshots: istanbul-lib-instrument@6.0.2: dependencies: '@babel/core': 7.25.7 - '@babel/parser': 7.25.6 + '@babel/parser': 7.25.7 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 7.6.3 @@ -17417,20 +16989,20 @@ snapshots: jscodeshift@17.0.0(@babel/preset-env@7.25.7(@babel/core@7.25.7)): dependencies: '@babel/core': 7.25.7 - '@babel/parser': 7.25.6 - '@babel/plugin-transform-class-properties': 7.25.4(@babel/core@7.25.7) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.25.7) - '@babel/plugin-transform-nullish-coalescing-operator': 7.24.7(@babel/core@7.25.7) - '@babel/plugin-transform-optional-chaining': 7.24.8(@babel/core@7.25.7) - '@babel/plugin-transform-private-methods': 7.25.4(@babel/core@7.25.7) + '@babel/parser': 7.25.7 + '@babel/plugin-transform-class-properties': 7.25.7(@babel/core@7.25.7) + '@babel/plugin-transform-modules-commonjs': 7.25.7(@babel/core@7.25.7) + '@babel/plugin-transform-nullish-coalescing-operator': 7.25.7(@babel/core@7.25.7) + '@babel/plugin-transform-optional-chaining': 7.25.7(@babel/core@7.25.7) + '@babel/plugin-transform-private-methods': 7.25.7(@babel/core@7.25.7) '@babel/preset-flow': 7.24.7(@babel/core@7.25.7) '@babel/preset-typescript': 7.25.7(@babel/core@7.25.7) - '@babel/register': 7.24.6(@babel/core@7.25.7) + '@babel/register': 7.25.7(@babel/core@7.25.7) flow-parser: 0.227.0 graceful-fs: 4.2.11 micromatch: 4.0.8 neo-async: 2.6.2 - picocolors: 1.0.1 + picocolors: 1.1.0 recast: 0.23.9 temp: 0.9.4 write-file-atomic: 5.0.1 @@ -17469,10 +17041,6 @@ snapshots: - supports-color - utf-8-validate - jsesc@0.5.0: {} - - jsesc@2.5.2: {} - jsesc@3.0.2: {} json-bigint@1.0.0: @@ -17657,13 +17225,13 @@ snapshots: dependencies: glob: 7.2.3 minimatch: 9.0.4 - webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) webpack-merge: 4.2.2 karma@6.4.4: dependencies: '@colors/colors': 1.5.0 - body-parser: 1.20.2 + body-parser: 1.20.3 braces: 3.0.3 chokidar: 3.6.0 connect: 3.7.0 @@ -18039,7 +17607,7 @@ snapshots: cacache: 18.0.3 http-cache-semantics: 4.1.1 is-lambda: 1.0.1 - minipass: 7.0.4 + minipass: 7.1.2 minipass-fetch: 3.0.4 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 @@ -18357,11 +17925,11 @@ snapshots: minipass-collect@2.0.1: dependencies: - minipass: 7.0.4 + minipass: 7.1.2 minipass-fetch@3.0.4: dependencies: - minipass: 7.0.4 + minipass: 7.1.2 minipass-sized: 1.0.3 minizlib: 2.1.2 optionalDependencies: @@ -18387,8 +17955,6 @@ snapshots: minipass@5.0.0: {} - minipass@7.0.4: {} - minipass@7.1.2: {} minizlib@2.1.2: @@ -18514,7 +18080,7 @@ snapshots: '@next/env': 14.2.14 '@swc/helpers': 0.5.5 busboy: 1.6.0 - caniuse-lite: 1.0.30001647 + caniuse-lite: 1.0.30001667 graceful-fs: 4.2.11 postcss: 8.4.31 react: 18.3.1 @@ -18662,7 +18228,7 @@ snapshots: '@npmcli/redact': 2.0.1 jsonparse: 1.3.1 make-fetch-happen: 13.0.0 - minipass: 7.0.4 + minipass: 7.1.2 minipass-fetch: 3.0.4 minizlib: 2.1.2 npm-package-arg: 11.0.2 @@ -19012,7 +18578,7 @@ snapshots: '@npmcli/run-script': 8.1.0 cacache: 18.0.3 fs-minipass: 3.0.3 - minipass: 7.0.4 + minipass: 7.1.2 npm-package-arg: 11.0.2 npm-packlist: 8.0.2 npm-pick-manifest: 9.0.1 @@ -19065,7 +18631,7 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.24.7 + '@babel/code-frame': 7.25.7 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -19116,7 +18682,7 @@ snapshots: path-scurry@1.10.1: dependencies: lru-cache: 10.4.3 - minipass: 7.0.4 + minipass: 7.1.2 path-scurry@2.0.0: dependencies: @@ -19145,8 +18711,6 @@ snapshots: pathval@2.0.0: {} - picocolors@1.0.1: {} - picocolors@1.1.0: {} picomatch@2.3.1: {} @@ -19203,14 +18767,14 @@ snapshots: postcss@8.4.31: dependencies: nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 + picocolors: 1.1.0 + source-map-js: 1.2.1 postcss@8.4.38: dependencies: nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 + picocolors: 1.1.0 + source-map-js: 1.2.1 postcss@8.4.47: dependencies: @@ -19255,7 +18819,7 @@ snapshots: find-up: 5.0.0 ignore: 5.3.1 mri: 1.2.0 - picocolors: 1.0.1 + picocolors: 1.1.0 picomatch: 3.0.1 prettier: 3.3.3 tslib: 2.6.2 @@ -19332,14 +18896,6 @@ snapshots: qjobs@1.2.0: {} - qs@6.11.0: - dependencies: - side-channel: 1.0.6 - - qs@6.11.2: - dependencies: - side-channel: 1.0.6 - qs@6.13.0: dependencies: side-channel: 1.0.6 @@ -19377,7 +18933,7 @@ snapshots: react-docgen@5.4.3: dependencies: '@babel/core': 7.25.7 - '@babel/generator': 7.25.6 + '@babel/generator': 7.25.7 '@babel/runtime': 7.25.7 ast-types: 0.14.2 commander: 2.20.3 @@ -19544,10 +19100,6 @@ snapshots: globalthis: 1.0.3 which-builtin-type: 1.1.3 - regenerate-unicode-properties@10.1.1: - dependencies: - regenerate: 1.4.2 - regenerate-unicode-properties@10.2.0: dependencies: regenerate: 1.4.2 @@ -19569,15 +19121,6 @@ snapshots: es-errors: 1.3.0 set-function-name: 2.0.2 - regexpu-core@5.3.2: - dependencies: - '@babel/regjsgen': 0.8.0 - regenerate: 1.4.2 - regenerate-unicode-properties: 10.1.1 - regjsparser: 0.9.1 - unicode-match-property-ecmascript: 2.0.0 - unicode-match-property-value-ecmascript: 2.1.0 - regexpu-core@6.1.1: dependencies: regenerate: 1.4.2 @@ -19602,10 +19145,6 @@ snapshots: dependencies: jsesc: 3.0.2 - regjsparser@0.9.1: - dependencies: - jsesc: 0.5.0 - relateurl@0.2.7: {} release-zalgo@1.0.0: @@ -20032,8 +19571,6 @@ snapshots: dependencies: is-plain-obj: 1.1.0 - source-map-js@1.2.0: {} - source-map-js@1.2.1: {} source-map-support@0.5.21: @@ -20090,7 +19627,7 @@ snapshots: ssri@10.0.6: dependencies: - minipass: 7.0.4 + minipass: 7.1.2 stackback@0.0.2: {} @@ -20125,7 +19662,7 @@ snapshots: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) string-width@4.2.3: dependencies: @@ -20324,17 +19861,6 @@ snapshots: mkdirp: 0.5.6 rimraf: 2.6.3 - terser-webpack-plugin@5.3.10(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack@5.94.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4)): - dependencies: - '@jridgewell/trace-mapping': 0.3.25 - jest-worker: 27.5.1 - schema-utils: 3.3.0 - serialize-javascript: 6.0.2 - terser: 5.27.0 - webpack: 5.94.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) - optionalDependencies: - '@swc/core': 1.6.13(@swc/helpers@0.5.5) - terser-webpack-plugin@5.3.10(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack@5.95.0): dependencies: '@jridgewell/trace-mapping': 0.3.25 @@ -20342,7 +19868,7 @@ snapshots: schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.27.0 - webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) optionalDependencies: '@swc/core': 1.6.13(@swc/helpers@0.5.5) @@ -20660,17 +20186,11 @@ snapshots: upath@2.0.1: {} - update-browserslist-db@1.1.0(browserslist@4.23.3): - dependencies: - browserslist: 4.23.3 - escalade: 3.1.2 - picocolors: 1.0.1 - update-browserslist-db@1.1.0(browserslist@4.24.0): dependencies: browserslist: 4.24.0 escalade: 3.1.2 - picocolors: 1.0.1 + picocolors: 1.1.0 update-check@1.5.4: dependencies: @@ -20835,7 +20355,7 @@ snapshots: gzip-size: 6.0.0 html-escaper: 2.0.2 opener: 1.5.2 - picocolors: 1.0.1 + picocolors: 1.1.0 sirv: 2.0.4 ws: 7.5.9 transitivePeerDependencies: @@ -20845,9 +20365,9 @@ snapshots: webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0): dependencies: '@discoveryjs/json-ext': 0.5.7 - '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4)(webpack@5.95.0) - '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4)(webpack@5.95.0) - '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4)(webpack@5.95.0) + '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0) + '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0) + '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0) colorette: 2.0.20 commander: 10.0.1 cross-spawn: 7.0.3 @@ -20856,7 +20376,7 @@ snapshots: import-local: 3.1.0 interpret: 3.1.1 rechoir: 0.8.0 - webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) webpack-merge: 5.10.0 optionalDependencies: webpack-bundle-analyzer: 4.10.2 @@ -20873,7 +20393,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack@5.94.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4): + webpack@5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)): dependencies: '@types/estree': 1.0.5 '@webassemblyjs/ast': 1.12.1 @@ -20881,39 +20401,7 @@ snapshots: '@webassemblyjs/wasm-parser': 1.12.1 acorn: 8.12.1 acorn-import-attributes: 1.9.5(acorn@8.12.1) - browserslist: 4.23.3 - chrome-trace-event: 1.0.3 - enhanced-resolve: 5.17.1 - es-module-lexer: 1.5.4 - eslint-scope: 5.1.1 - events: 3.3.0 - glob-to-regexp: 0.4.1 - graceful-fs: 4.2.11 - json-parse-even-better-errors: 2.3.1 - loader-runner: 4.3.0 - mime-types: 2.1.35 - neo-async: 2.6.2 - schema-utils: 3.3.0 - tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack@5.94.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4)) - watchpack: 2.4.1 - webpack-sources: 3.2.3 - optionalDependencies: - webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0) - transitivePeerDependencies: - - '@swc/core' - - esbuild - - uglify-js - - webpack@5.95.0(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4): - dependencies: - '@types/estree': 1.0.5 - '@webassemblyjs/ast': 1.12.1 - '@webassemblyjs/wasm-edit': 1.12.1 - '@webassemblyjs/wasm-parser': 1.12.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - browserslist: 4.23.3 + browserslist: 4.24.0 chrome-trace-event: 1.0.3 enhanced-resolve: 5.17.1 es-module-lexer: 1.5.4 From 66c410ec6457edca277c69485399438f5247ccc1 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 8 Oct 2024 15:28:34 +0200 Subject: [PATCH 058/119] try fixing babelconfig --- babel.config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/babel.config.js b/babel.config.js index c5948a3c53c0..6f80f40876ba 100644 --- a/babel.config.js +++ b/babel.config.js @@ -110,8 +110,8 @@ module.exports = function getBabelConfig(api) { plugins.push([ 'babel-plugin-replace-imports', { - test: /date-fns/i, - replacer: 'date-fns-v4', + test: /date-fns\//i, + replacer: 'date-fns-v4/', // This option is provided by the `patches/babel-plugin-replace-imports@1.0.2.patch` patch filenameIncludes: 'src/AdapterDateFnsV3/', }, @@ -119,8 +119,8 @@ module.exports = function getBabelConfig(api) { plugins.push([ 'babel-plugin-replace-imports', { - test: /date-fns-jalali/i, - replacer: 'date-fns-jalali-v3', + test: /date-fns-jalali\//i, + replacer: 'date-fns-jalali-v3/', // This option is provided by the `patches/babel-plugin-replace-imports@1.0.2.patch` patch filenameIncludes: 'src/AdapterDateFnsJalaliV3/', }, From 94b444350709e0763acef112fc56020c2df38b66 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 8 Oct 2024 16:03:34 +0200 Subject: [PATCH 059/119] fix typescript --- .../src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx | 7 +++++++ packages/x-date-pickers/tsconfig.build.json | 1 - packages/x-date-pickers/tsconfig.json | 1 - test/utils/pickers/createPickerRenderer.tsx | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx b/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx index 6277d9d46d63..1140863221fe 100644 --- a/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx +++ b/packages/x-date-pickers/src/AdapterDateFnsV3/AdapterDateFnsV3.test.tsx @@ -3,6 +3,13 @@ import { fr } from 'date-fns-v4/locale'; import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3'; +// TODO: remove when we migrate to vitest +declare global { + const vi: { + mock: any; + }; +} + vi.mock('date-fns/addSeconds', () => import('date-fns-v4/addSeconds')); vi.mock('date-fns/addMinutes', () => import('date-fns-v4/addMinutes')); vi.mock('date-fns/addHours', () => import('date-fns-v4/addHours')); diff --git a/packages/x-date-pickers/tsconfig.build.json b/packages/x-date-pickers/tsconfig.build.json index 25e983d655eb..308d2110b536 100644 --- a/packages/x-date-pickers/tsconfig.build.json +++ b/packages/x-date-pickers/tsconfig.build.json @@ -10,7 +10,6 @@ "outDir": "build", "rootDir": "./src", "types": [ - "vitest/globals", "node", "@mui/material/themeCssVarsAugmentation", "dayjs/plugin/utc.d.ts", diff --git a/packages/x-date-pickers/tsconfig.json b/packages/x-date-pickers/tsconfig.json index 4664bab602d7..5f862d31ec2b 100644 --- a/packages/x-date-pickers/tsconfig.json +++ b/packages/x-date-pickers/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.json", "compilerOptions": { "types": [ - "vitest/globals", "@mui/internal-test-utils/initMatchers", "@mui/material/themeCssVarsAugmentation", "chai-dom", diff --git a/test/utils/pickers/createPickerRenderer.tsx b/test/utils/pickers/createPickerRenderer.tsx index 880110e4048a..e094bb63beb9 100644 --- a/test/utils/pickers/createPickerRenderer.tsx +++ b/test/utils/pickers/createPickerRenderer.tsx @@ -18,6 +18,7 @@ export function createPickerRenderer({ }: CreatePickerRendererOptions = {}) { const { clock, render: clientRender } = createRenderer({ ...createRendererOptions, + // @ts-ignore vi: globalThis.vi ?? undefined, }); From 43ce018b76092d10c6305feddcce8984b84dfc80 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 8 Oct 2024 17:28:29 +0200 Subject: [PATCH 060/119] add license and pro packages --- package.json | 2 +- .../DateRangeCalendar.test.tsx | 24 ++++++--- .../tests/DesktopDateRangePicker.test.tsx | 6 ++- pnpm-lock.yaml | 54 +++++++++---------- test/setup.ts | 11 ++++ vitest.config.mts | 12 +++++ vitest.workspace.ts | 2 +- 7 files changed, 72 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 2fabdfbdcbde..74d3c3871efa 100644 --- a/package.json +++ b/package.json @@ -206,7 +206,7 @@ "@types/node": "^20.16.10", "@playwright/test": "1.44.1", "playwright": "1.44.1", - "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils" + "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils" }, "packageManager": "pnpm@9.12.0", "engines": { diff --git a/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.test.tsx b/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.test.tsx index 085f45fcde1b..87c4e9aa2f01 100644 --- a/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.test.tsx +++ b/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.test.tsx @@ -177,9 +177,11 @@ describe('', () => { expect(onChange.callCount).to.equal(0); }); - it('should not emit "onChange" when touch dragging is ended where it was started', function test() { + it('should not emit "onChange" when touch dragging is ended where it was started', function test(t = {}) { if (!document.elementFromPoint) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onChange = spy(); render( @@ -245,9 +247,11 @@ describe('', () => { expect(document.activeElement).toHaveAccessibleName('2'); }); - it('should emit "onChange" when touch dragging end date', function test() { + it('should emit "onChange" when touch dragging end date', function test(t = {}) { if (!document.elementFromPoint) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onChange = spy(); const initialValue: [any, any] = [ @@ -323,9 +327,11 @@ describe('', () => { expect(document.activeElement).toHaveAccessibleName('22'); }); - it('should emit "onChange" when touch dragging start date', function test() { + it('should emit "onChange" when touch dragging start date', function test(t = {}) { if (!document.elementFromPoint) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onChange = spy(); const initialValue: [any, any] = [ @@ -398,9 +404,11 @@ describe('', () => { ).to.have.lengthOf(10); }); - it('should dynamically update "shouldDisableDate" when flip touch dragging', function test() { + it('should dynamically update "shouldDisableDate" when flip touch dragging', function test(t = {}) { if (!document.elementFromPoint) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const initialValue: [any, any] = [ adapterToUse.date('2018-01-01'), diff --git a/packages/x-date-pickers-pro/src/DesktopDateRangePicker/tests/DesktopDateRangePicker.test.tsx b/packages/x-date-pickers-pro/src/DesktopDateRangePicker/tests/DesktopDateRangePicker.test.tsx index 8ec961707343..8d2c2913e7fe 100644 --- a/packages/x-date-pickers-pro/src/DesktopDateRangePicker/tests/DesktopDateRangePicker.test.tsx +++ b/packages/x-date-pickers-pro/src/DesktopDateRangePicker/tests/DesktopDateRangePicker.test.tsx @@ -459,10 +459,12 @@ describe('', () => { expect(onClose.callCount).to.equal(0); }); - it('should call onClose when blur the current field without prior change', function test() { + it('should call onClose when blur the current field without prior change', function test(t = {}) { // test:unit does not call `blur` when focusing another element. if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const onChange = spy(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index db4d09856ae1..7eed1ee1a094 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,7 +9,7 @@ overrides: '@types/node': ^20.16.10 '@playwright/test': 1.44.1 playwright: 1.44.1 - '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils + '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils patchedDependencies: babel-plugin-replace-imports@1.0.2: @@ -96,8 +96,8 @@ importers: specifier: ^1.0.15 version: 1.0.15 '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -780,8 +780,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1024,8 +1024,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1136,8 +1136,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1198,8 +1198,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1251,8 +1251,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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1346,8 +1346,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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1393,8 +1393,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: ^6.0.1 version: 6.0.1 @@ -1413,8 +1413,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: ^6.0.1 version: 6.0.1 @@ -1457,8 +1457,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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1516,8 +1516,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: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -3123,7 +3123,7 @@ packages: resolution: {integrity: sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==} engines: {node: '>=12.0.0'} peerDependencies: - '@types/react': ^18.3.4 + '@types/react': ^17.0.0 || ^18.0.0 react: ^17.0.0 || ^18.0.0 react-dom: ^17.0.0 || ^18.0.0 peerDependenciesMeta: @@ -3175,8 +3175,8 @@ packages: '@mui/internal-scripts@1.0.22': resolution: {integrity: sha512-+GEmp73U9o2touhiMRNO+hv8AlYWwVpu6ZjKLnZ3OLoYq5kg0e2p8GMpHTBTmalNKXXM3kOchgs0NYoYJwsX4g==} - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils': - resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils} + '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils': + resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils} version: 1.0.15 peerDependencies: react: ^18.2.0 @@ -12167,7 +12167,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/0648e94b/@mui/internal-test-utils(@babel/core@7.25.7)(@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@https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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.25.7(@babel/core@7.25.7) '@babel/preset-typescript': 7.25.7(@babel/core@7.25.7) diff --git a/test/setup.ts b/test/setup.ts index 58e22ef960a4..3df2109ece64 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -2,6 +2,7 @@ import { beforeAll, afterAll, vi } from 'vitest'; import 'test/utils/addChaiAssertions'; import 'test/utils/setupPickers'; import 'test/utils/licenseRelease'; +import { generateTestLicenseKey, setupTestLicenseKey } from 'test/utils/testLicense'; // @ts-ignore globalThis.before = beforeAll; @@ -13,6 +14,16 @@ globalThis.vi = vi; const isVitestJsdom = process.env.MUI_JSDOM === 'true'; +let licenseKey: string = ''; + +beforeAll(() => { + licenseKey = generateTestLicenseKey(); +}); + +beforeEach(() => { + setupTestLicenseKey(licenseKey); +}); + // Only necessary when not in browser mode. if (isVitestJsdom) { class Touch { diff --git a/vitest.config.mts b/vitest.config.mts index 456ad1884344..754a15987c87 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -7,10 +7,18 @@ export default defineConfig({ find: '@mui/x-charts', replacement: new URL('./packages/x-charts/src', import.meta.url).pathname, }, + { + find: '@mui/x-charts-pro', + replacement: new URL('./packages/x-charts-pro/src', import.meta.url).pathname, + }, { find: '@mui/x-date-pickers', replacement: new URL('./packages/x-date-pickers/src', import.meta.url).pathname, }, + { + find: '@mui/x-date-pickers-pro', + replacement: new URL('./packages/x-date-pickers-pro/src', import.meta.url).pathname, + }, { find: 'test/utils', replacement: new URL('./test/utils', import.meta.url).pathname, @@ -19,6 +27,10 @@ export default defineConfig({ find: '@mui/x-internals', replacement: new URL('./packages/x-internals/src', import.meta.url).pathname, }, + { + find: '@mui/x-license', + replacement: new URL('./packages/x-license/src', import.meta.url).pathname, + }, { find: 'moment/locale', replacement: 'moment/dist/locale', diff --git a/vitest.workspace.ts b/vitest.workspace.ts index db0ef5779c78..7398c6ecdc73 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -1,7 +1,7 @@ import react from '@vitejs/plugin-react'; import { defineWorkspace } from 'vitest/config'; -const packages = ['x-charts', 'x-date-pickers']; +const packages = ['x-charts', 'x-charts-pro', 'x-date-pickers', 'x-date-pickers-pro']; // Ideally we move the configuration to each package. // Currently it doesn't work because vitest doesn't detect two different configurations in the same package. From b2192635d8f5282c478f49e90790fd654f4a26f7 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 8 Oct 2024 19:00:21 +0200 Subject: [PATCH 061/119] add license and internals tests --- vitest.workspace.ts | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 7398c6ecdc73..d5e453b17be7 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -1,14 +1,20 @@ import react from '@vitejs/plugin-react'; import { defineWorkspace } from 'vitest/config'; -const packages = ['x-charts', 'x-charts-pro', 'x-date-pickers', 'x-date-pickers-pro']; +const packages = [ + 'x-charts', + 'x-charts-pro', + 'x-date-pickers', + 'x-date-pickers-pro', + 'x-internals', +]; // Ideally we move the configuration to each package. // Currently it doesn't work because vitest doesn't detect two different configurations in the same package. // We could bypass this limitation by having a folder per configuration. Eg: `packages/x-charts/browser` & `packages/x-charts/jsdom`. -export default defineWorkspace( - packages.flatMap( +export default defineWorkspace([ + ...packages.flatMap( (name): ReturnType => [ { extends: './vitest.config.mts', @@ -46,4 +52,17 @@ export default defineWorkspace( }, ], ), -); + { + extends: './vitest.config.mts', + plugins: [react()], + test: { + include: [`packages/x-license/src/**/*.test.?(c|m)[jt]s?(x)`], + exclude: [`packages/x-license/src/**/*.browser.test.?(c|m)[jt]s?(x)`], + name: `jsdom/x-license`, + environment: 'jsdom', + env: { + MUI_JSDOM: 'true', + }, + }, + }, +]); From f530667a28f84199fb6941e7f0ef33f000ecebc1 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 8 Oct 2024 19:20:27 +0200 Subject: [PATCH 062/119] add todo --- vitest.workspace.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vitest.workspace.ts b/vitest.workspace.ts index d5e453b17be7..0925caf21404 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -52,6 +52,10 @@ export default defineWorkspace([ }, ], ), + // TODO: Decide on + // Manually changing the process.env in browser tests doesn't work. + // And alternative is to use `const {NODE_ENV} = process.env` in the code instead. + // x-license relies on `process.env.NODE_ENV` to determine the environment. { extends: './vitest.config.mts', plugins: [react()], From 4fd6d33c6d71af73c51de89034172272307bfe70 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 8 Oct 2024 19:58:15 +0200 Subject: [PATCH 063/119] run test without mocking timers --- .../src/DateCalendar/tests/DateCalendar.test.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx index f70a4332e5a6..a6dfb5fa45a1 100644 --- a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx +++ b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx @@ -128,10 +128,8 @@ describe('', () => { }); describe('with fake timers', () => { - clock.withFakeTimers(); - // test: https://github.com/mui/mui-x/issues/12373 - it('should not reset day to `startOfDay` if value already exists when finding the closest enabled date', () => { + it('should not reset day to `startOfDay` if value already exists when finding the closest enabled date', async () => { const onChange = spy(); const defaultDate = adapterToUse.date('2019-01-02T11:12:13.550Z'); render(); @@ -140,8 +138,8 @@ describe('', () => { screen.getByRole('button', { name: 'calendar view is open, switch to year view' }), ); fireEvent.click(screen.getByRole('radio', { name: '2020' })); - // Finish the transition to the day view - clock.runToLast(); + + await screen.findByRole('gridcell', { name: '1' }); fireEvent.click(screen.getByRole('gridcell', { name: '1' })); fireEvent.click( From 8d3601cbcc437589f8842c3070c6351c82e6c711 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 9 Oct 2024 10:26:38 +0200 Subject: [PATCH 064/119] update internals --- package.json | 2 +- pnpm-lock.yaml | 52 +++++++++++++++++++++++++------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 74d3c3871efa..68a06b213a49 100644 --- a/package.json +++ b/package.json @@ -206,7 +206,7 @@ "@types/node": "^20.16.10", "@playwright/test": "1.44.1", "playwright": "1.44.1", - "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils" + "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils" }, "packageManager": "pnpm@9.12.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7eed1ee1a094..e1cc7169d6ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,7 +9,7 @@ overrides: '@types/node': ^20.16.10 '@playwright/test': 1.44.1 playwright: 1.44.1 - '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils + '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils patchedDependencies: babel-plugin-replace-imports@1.0.2: @@ -96,8 +96,8 @@ importers: specifier: ^1.0.15 version: 1.0.15 '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -780,8 +780,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1024,8 +1024,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1136,8 +1136,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1198,8 +1198,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1251,8 +1251,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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1346,8 +1346,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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1393,8 +1393,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: ^6.0.1 version: 6.0.1 @@ -1413,8 +1413,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: ^6.0.1 version: 6.0.1 @@ -1457,8 +1457,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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1516,8 +1516,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: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -3175,8 +3175,8 @@ packages: '@mui/internal-scripts@1.0.22': resolution: {integrity: sha512-+GEmp73U9o2touhiMRNO+hv8AlYWwVpu6ZjKLnZ3OLoYq5kg0e2p8GMpHTBTmalNKXXM3kOchgs0NYoYJwsX4g==} - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils': - resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils} + '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils': + resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils} version: 1.0.15 peerDependencies: react: ^18.2.0 @@ -12167,7 +12167,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/ccb3dd51/@mui/internal-test-utils(@babel/core@7.25.7)(@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@https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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.25.7(@babel/core@7.25.7) '@babel/preset-typescript': 7.25.7(@babel/core@7.25.7) From 4497dd87bd70e2902c879b641364924e4db9cc39 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 9 Oct 2024 10:38:41 +0200 Subject: [PATCH 065/119] remove unused clock var --- .../x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx index c307c2d6a82c..2a3dd88a7f5b 100644 --- a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx +++ b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx @@ -9,7 +9,7 @@ import { createPickerRenderer, adapterToUse } from 'test/utils/pickers'; const isJSDOM = /jsdom/.test(window.navigator.userAgent); describe('', () => { - const { render, clock } = createPickerRenderer({ clockConfig: new Date(2019, 0, 2) }); + const { render } = createPickerRenderer({ clockConfig: new Date(2019, 0, 2) }); it('switches between views uncontrolled', async () => { const handleViewChange = spy(); From 65397591a6dfae838e176cf22673da93420d351f Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 9 Oct 2024 11:29:52 +0200 Subject: [PATCH 066/119] make test work in vitest and mocha --- .../src/DateCalendar/tests/DateCalendar.test.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx index 2a3dd88a7f5b..993e51ab21bd 100644 --- a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx +++ b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx @@ -9,7 +9,7 @@ import { createPickerRenderer, adapterToUse } from 'test/utils/pickers'; const isJSDOM = /jsdom/.test(window.navigator.userAgent); describe('', () => { - const { render } = createPickerRenderer({ clockConfig: new Date(2019, 0, 2) }); + const { render, clock } = createPickerRenderer({ clockConfig: new Date(2019, 0, 2) }); it('switches between views uncontrolled', async () => { const handleViewChange = spy(); @@ -128,6 +128,11 @@ describe('', () => { }); describe('with fake timers', () => { + // TODO: remove when migrated to vitest + if (process.env.MUI_VITEST !== 'true') { + clock.withFakeTimers(); + } + // test: https://github.com/mui/mui-x/issues/12373 it('should not reset day to `startOfDay` if value already exists when finding the closest enabled date', async () => { const onChange = spy(); @@ -139,7 +144,12 @@ describe('', () => { ); fireEvent.click(screen.getByRole('radio', { name: '2020' })); - await screen.findByRole('gridcell', { name: '1' }); + if (process.env.MUI_VITEST !== 'true') { + // Finish the transition to the day view + clock.runToLast(); + } else { + await screen.findByRole('gridcell', { name: '1' }); + } fireEvent.click(screen.getByRole('gridcell', { name: '1' })); fireEvent.click( From b20b1bb0df505036464f8b965c0b4facceddf7be Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 09:46:32 +0200 Subject: [PATCH 067/119] sequence.hooks = list --- package.json | 2 +- pnpm-lock.yaml | 52 +++++++++++++++++++++++------------------------ vitest.config.mts | 3 +++ 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index eaa7028bf43c..dc853d1000ca 100644 --- a/package.json +++ b/package.json @@ -206,7 +206,7 @@ "@types/node": "^20.16.10", "@playwright/test": "1.44.1", "playwright": "1.44.1", - "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils" + "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils" }, "packageManager": "pnpm@9.12.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e1cc7169d6ee..45ebbc1557b7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,7 +9,7 @@ overrides: '@types/node': ^20.16.10 '@playwright/test': 1.44.1 playwright: 1.44.1 - '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils + '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils patchedDependencies: babel-plugin-replace-imports@1.0.2: @@ -96,8 +96,8 @@ importers: specifier: ^1.0.15 version: 1.0.15 '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -780,8 +780,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1024,8 +1024,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1136,8 +1136,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1198,8 +1198,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1251,8 +1251,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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1346,8 +1346,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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1393,8 +1393,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: ^6.0.1 version: 6.0.1 @@ -1413,8 +1413,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: ^6.0.1 version: 6.0.1 @@ -1457,8 +1457,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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1516,8 +1516,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: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -3175,8 +3175,8 @@ packages: '@mui/internal-scripts@1.0.22': resolution: {integrity: sha512-+GEmp73U9o2touhiMRNO+hv8AlYWwVpu6ZjKLnZ3OLoYq5kg0e2p8GMpHTBTmalNKXXM3kOchgs0NYoYJwsX4g==} - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils': - resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils} + '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils': + resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils} version: 1.0.15 peerDependencies: react: ^18.2.0 @@ -12167,7 +12167,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/9e3c2847/@mui/internal-test-utils(@babel/core@7.25.7)(@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@https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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.25.7(@babel/core@7.25.7) '@babel/preset-typescript': 7.25.7(@babel/core@7.25.7) diff --git a/vitest.config.mts b/vitest.config.mts index 754a15987c87..66a3ddb307ae 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -42,6 +42,9 @@ export default defineConfig({ setupFiles: ['test/setup.ts'], // Required for some datepickers tests that contain early returns. passWithNoTests: true, + sequence: { + hooks: 'list', + }, env: { MUI_VITEST: 'true', }, From 840c4b61e933f09be94d8b300018c4c503d12cb2 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 10:41:40 +0200 Subject: [PATCH 068/119] Fix datepickes pro test --- .../testTextFieldKeyboardRangeValidation.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/utils/pickers/describeRangeValidation/testTextFieldKeyboardRangeValidation.tsx b/test/utils/pickers/describeRangeValidation/testTextFieldKeyboardRangeValidation.tsx index c25c09224a9a..4b9a71b585b2 100644 --- a/test/utils/pickers/describeRangeValidation/testTextFieldKeyboardRangeValidation.tsx +++ b/test/utils/pickers/describeRangeValidation/testTextFieldKeyboardRangeValidation.tsx @@ -55,7 +55,9 @@ export const testTextFieldKeyboardRangeValidation: DescribeRangeValidationTestSu adapterToUse.isAfter(date, adapterToUse.date('2018-03-11'))} + shouldDisableDate={(date: any) => + adapterToUse.isAfter(date, adapterToUse.date('2018-03-11')) + } />, ); act(() => { @@ -89,7 +91,8 @@ export const testTextFieldKeyboardRangeValidation: DescribeRangeValidationTestSu testInvalidStatus([true, true], isSingleInput); setProps({ - shouldDisableDate: (date) => adapterToUse.isBefore(date, adapterToUse.date('2018-03-13')), + shouldDisableDate: (date: any) => + adapterToUse.isBefore(date, adapterToUse.date('2018-03-13')), }); expect(onErrorMock.callCount).to.equal(3); @@ -114,7 +117,7 @@ export const testTextFieldKeyboardRangeValidation: DescribeRangeValidationTestSu } act(() => { - setValue(adapterToUse.date(past)); + setValue(past); }); expect(onErrorMock.callCount).to.equal(1); @@ -122,7 +125,7 @@ export const testTextFieldKeyboardRangeValidation: DescribeRangeValidationTestSu testInvalidStatus([true, false], isSingleInput); act(() => { - setValue(adapterToUse.date(past), { setEndDate: true }); + setValue(past, { setEndDate: true }); }); expect(onErrorMock.callCount).to.equal(2); @@ -130,8 +133,9 @@ export const testTextFieldKeyboardRangeValidation: DescribeRangeValidationTestSu testInvalidStatus([true, true], isSingleInput); act(() => { - setValue(adapterToUse.date(now)); + setValue(adapterToUse.addHours(now, 1)); }); + expect(onErrorMock.callCount).to.equal(3); expect(onErrorMock.lastCall.args[0]).to.deep.equal([null, 'disablePast']); testInvalidStatus([false, true], isSingleInput); From 6db68b847cc18e25367f48610faf2871086d6225 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 12:12:19 +0200 Subject: [PATCH 069/119] ignore failing browser tests --- .../AdapterMomentHijri.test.tsx | 16 ++++++++++++++-- .../pickers/describeHijriAdapter/testFormat.ts | 7 ++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx b/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx index bd86f319abe6..bcad494172d0 100644 --- a/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx +++ b/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx @@ -22,7 +22,13 @@ describe('', () => { }); describe('Adapter localization', () => { - it('Formatting', () => { + it('Formatting', (t = {}) => { + if (process.env.MUI_BROWSER === 'true') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + t?.skip(); + } + const adapter = new AdapterMomentHijri(); const expectDate = (format: keyof AdapterFormats, expectedWithArSA: string) => { @@ -80,7 +86,13 @@ describe('', () => { expectFieldValueV7(view.getSectionsContainer(), localizedTexts[localeKey].placeholder); }); - it('should have well formatted value', () => { + it('should have well formatted value', (t = {}) => { + if (process.env.MUI_BROWSER === 'true') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + t?.skip(); + } + const view = renderWithProps({ enableAccessibleFieldDOMStructure: true, value: adapter.date(testDate), diff --git a/test/utils/pickers/describeHijriAdapter/testFormat.ts b/test/utils/pickers/describeHijriAdapter/testFormat.ts index 6a22c488298f..4cadf934ccfa 100644 --- a/test/utils/pickers/describeHijriAdapter/testFormat.ts +++ b/test/utils/pickers/describeHijriAdapter/testFormat.ts @@ -2,7 +2,12 @@ import { expect } from 'chai'; import { DescribeHijriAdapterTestSuite } from './describeHijriAdapter.types'; export const testFormat: DescribeHijriAdapterTestSuite = ({ adapter }) => { - it('should format the seconds without leading zeroes for format "s"', () => { + it('should format the seconds without leading zeroes for format "s"', (t = {}) => { + if (process.env.MUI_BROWSER === 'true') { + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + t?.skip(); + } const date = adapter.date('2020-01-01T23:44:09.000Z')!; expect(adapter.formatByString(date, 's')).to.equal('٩'); }); From 9f6f828d8e95b1af48a0c3ea474d29711d0ab216 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 12:19:01 +0200 Subject: [PATCH 070/119] add lib alias config --- vitest.config.mts | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/vitest.config.mts b/vitest.config.mts index 66a3ddb307ae..65661a9cc1ee 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -3,34 +3,27 @@ import { defineConfig } from 'vitest/config'; export default defineConfig({ resolve: { alias: [ - { - find: '@mui/x-charts', - replacement: new URL('./packages/x-charts/src', import.meta.url).pathname, - }, - { - find: '@mui/x-charts-pro', - replacement: new URL('./packages/x-charts-pro/src', import.meta.url).pathname, - }, - { - find: '@mui/x-date-pickers', - replacement: new URL('./packages/x-date-pickers/src', import.meta.url).pathname, - }, - { - find: '@mui/x-date-pickers-pro', - replacement: new URL('./packages/x-date-pickers-pro/src', import.meta.url).pathname, - }, + ...[ + { lib: 'charts', plans: ['pro'] }, + { lib: 'date-pickers', plans: ['pro'] }, + { lib: 'internals' }, + { lib: 'license' }, + ].flatMap((v) => { + return [ + { + find: `@mui/x-${v.lib}`, + replacement: new URL(`./packages/x-${v.lib}/src`, import.meta.url).pathname, + }, + ...(v.plans ?? []).map((plan) => ({ + find: `@mui/x-${v.lib}-${plan}`, + replacement: new URL(`./packages/x-${v.lib}-${plan}/src`, import.meta.url).pathname, + })), + ]; + }), { find: 'test/utils', replacement: new URL('./test/utils', import.meta.url).pathname, }, - { - find: '@mui/x-internals', - replacement: new URL('./packages/x-internals/src', import.meta.url).pathname, - }, - { - find: '@mui/x-license', - replacement: new URL('./packages/x-license/src', import.meta.url).pathname, - }, { find: 'moment/locale', replacement: 'moment/dist/locale', From a353cb60a7c88cec978b7016938db0169e1de761 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 12:54:40 +0200 Subject: [PATCH 071/119] init data-grid and replace skips --- .../utils/useGridApiEventHandler.test.tsx | 6 +- .../src/tests/cells.DataGrid.test.tsx | 25 ++++-- .../tests/columnSpanning.DataGrid.test.tsx | 38 +++++--- .../src/tests/columns.DataGrid.test.tsx | 7 +- .../src/tests/density.DataGrid.test.tsx | 86 ++++++++++++++---- .../src/tests/export.DataGrid.test.tsx | 14 ++- .../src/tests/keyboard.DataGrid.test.tsx | 66 +++++++++----- .../src/tests/layout.DataGrid.test.tsx | 88 ++++++++++++------- .../src/tests/pagination.DataGrid.test.tsx | 29 +++--- .../tests/quickFiltering.DataGrid.test.tsx | 6 +- .../src/tests/rowSelection.DataGrid.test.tsx | 19 ++-- .../src/tests/rowSpanning.DataGrid.test.tsx | 36 +++++--- .../src/tests/rows.DataGrid.test.tsx | 36 +++++--- .../src/tests/slots.DataGrid.test.tsx | 6 +- vitest.config.mts | 1 + vitest.workspace.ts | 1 + 16 files changed, 307 insertions(+), 157 deletions(-) diff --git a/packages/x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx b/packages/x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx index 1ee0bd2c105f..b8927764fb0d 100644 --- a/packages/x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx +++ b/packages/x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx @@ -13,14 +13,16 @@ describe('useGridApiEventHandler', () => { const { render } = createRenderer(); describe('FinalizationRegistry-based implementation', () => { - it('should unsubscribe event listeners registered by uncommitted components', async function test() { + it('should unsubscribe event listeners registered by uncommitted components', async function test(t = {}) { if ( !/jsdom/.test(window.navigator.userAgent) || typeof FinalizationRegistry === 'undefined' || typeof global.gc === 'undefined' ) { // Needs ability to trigger the garbage collector and support for FinalizationRegistry (added in node 14) - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const useGridApiEventHandler = createUseGridApiEventHandler({ diff --git a/packages/x-data-grid/src/tests/cells.DataGrid.test.tsx b/packages/x-data-grid/src/tests/cells.DataGrid.test.tsx index 61c3a5b0f72d..89017b5b55d7 100644 --- a/packages/x-data-grid/src/tests/cells.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/cells.DataGrid.test.tsx @@ -64,10 +64,12 @@ describe(' - Cells', () => { expect(color).not.to.equal('rgba(0, 0, 0, 0)'); } - it('should add right border to cells', function test() { + it('should add right border to cells', function test(t = {}) { if (isJSDOM) { // Doesn't work with mocked window.getComputedStyle - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -86,10 +88,12 @@ describe(' - Cells', () => { }); // See https://github.com/mui/mui-x/issues/4122 - it('should add right border to cells in the last row', function test() { + it('should add right border to cells in the last row', function test(t = {}) { if (isJSDOM) { // Doesn't work with mocked window.getComputedStyle - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -188,9 +192,11 @@ describe(' - Cells', () => { }).toWarnDev(['MUI X: The cell with id=1 and field=brand received focus.']); }); - it('should keep the focused cell/row rendered in the DOM if it scrolls outside the viewport', function test() { + it('should keep the focused cell/row rendered in the DOM if it scrolls outside the viewport', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const rowHeight = 50; const defaultData = getBasicGridData(20, 20); @@ -220,9 +226,12 @@ describe(' - Cells', () => { }); // See https://github.com/mui/mui-x/issues/6378 - it('should not cause scroll jump when focused cell mounts in the render zone', async function test() { + it('should not cause scroll jump when focused cell mounts in the render zone', async function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const rowHeight = 50; diff --git a/packages/x-data-grid/src/tests/columnSpanning.DataGrid.test.tsx b/packages/x-data-grid/src/tests/columnSpanning.DataGrid.test.tsx index b326949ee1d7..d4c70f94fc25 100644 --- a/packages/x-data-grid/src/tests/columnSpanning.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/columnSpanning.DataGrid.test.tsx @@ -268,10 +268,12 @@ describe(' - Column spanning', () => { expect(getActiveCell()).to.equal('0-0'); }); - it('should work with row virtualization', function test() { + it('should work with row virtualization', function test(t = {}) { if (isJSDOM) { // needs virtualization - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const rows = [ @@ -333,9 +335,12 @@ describe(' - Column spanning', () => { expect(activeCell).to.equal('3-0'); }); - it('should work with column virtualization', function test() { + it('should work with column virtualization', function test(t = {}) { if (isJSDOM) { - this.skip(); // needs layout + // needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -439,9 +444,12 @@ describe(' - Column spanning', () => { expect(getActiveCell()).to.equal('1-2'); }); - it('should scroll the whole cell into view when `colSpan` > 1', function test() { + it('should scroll the whole cell into view when `colSpan` > 1', function test(t = {}) { if (isJSDOM) { - this.skip(); // needs layout + // needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -720,10 +728,12 @@ describe(' - Column spanning', () => { checkRows(2, ['Adidas', 'Puma']); }); - it('should work with column virtualization', function test() { + it('should work with column virtualization', function test(t = {}) { if (isJSDOM) { // Need layouting for column virtualization - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -772,10 +782,12 @@ describe(' - Column spanning', () => { ); }); - it('should work with both column and row virtualization', function test() { + it('should work with both column and row virtualization', function test(t = {}) { if (isJSDOM) { // Need layouting for column virtualization - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const rowHeight = 50; @@ -836,10 +848,12 @@ describe(' - Column spanning', () => { ); }); - it('should work with pagination and column virtualization', function test() { + it('should work with pagination and column virtualization', function test(t = {}) { if (isJSDOM) { // Need layouting for column virtualization - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const rowHeight = 50; diff --git a/packages/x-data-grid/src/tests/columns.DataGrid.test.tsx b/packages/x-data-grid/src/tests/columns.DataGrid.test.tsx index 652d3e9bf153..54e680f9a81b 100644 --- a/packages/x-data-grid/src/tests/columns.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/columns.DataGrid.test.tsx @@ -123,9 +123,12 @@ describe(' - Columns', () => { }); // https://github.com/mui/mui-x/issues/13719 - it('should not crash when updating columns immediately after scrolling', function test() { + it('should not crash when updating columns immediately after scrolling', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const data = [ diff --git a/packages/x-data-grid/src/tests/density.DataGrid.test.tsx b/packages/x-data-grid/src/tests/density.DataGrid.test.tsx index aaad84e1c4fe..6d77b5743a34 100644 --- a/packages/x-data-grid/src/tests/density.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/density.DataGrid.test.tsx @@ -50,15 +50,15 @@ describe(' - Density', () => { ); } - before(function beforeHook() { - if (isJSDOM) { - // JSDOM seem to not support CSS variables properly and `height: var(--height)` ends up being `height: ''` - this.skip(); - } - }); - describe('prop: `initialState.density`', () => { - it('should set the density to the value of initialState.density', () => { + it('should set the density to the value of initialState.density', function test(t = {}) { + if (isJSDOM) { + // JSDOM seem to not support CSS variables properly and `height: var(--height)` ends up being `height: ''` + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const rowHeight = 30; render(
@@ -78,7 +78,14 @@ describe(' - Density', () => { }); describe('prop: `density`', () => { - it('should set the density value using density prop', () => { + it('should set the density value using density prop', function test(t = {}) { + if (isJSDOM) { + // JSDOM seem to not support CSS variables properly and `height: var(--height)` ends up being `height: ''` + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const rowHeight = 30; render(
@@ -89,7 +96,13 @@ describe(' - Density', () => { expectHeight(rowHeight * COMPACT_DENSITY_FACTOR); }); - it('should allow to control the density from the prop using state', () => { + it('should allow to control the density from the prop using state', function test(t = {}) { + if (isJSDOM) { + // JSDOM seem to not support CSS variables properly and `height: var(--height)` ends up being `height: ''` + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } const rowHeight = 30; function Grid(props: Partial) { @@ -123,7 +136,13 @@ describe(' - Density', () => { expectHeight(rowHeight * COMPACT_DENSITY_FACTOR); }); - it('should call `onDensityChange` prop when density gets updated', () => { + it('should call `onDensityChange` prop when density gets updated', function test(t = {}) { + if (isJSDOM) { + // JSDOM seem to not support CSS variables properly and `height: var(--height)` ends up being `height: ''` + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } const onDensityChange = spy(); function Test() { return ( @@ -147,7 +166,14 @@ describe(' - Density', () => { }); describe('density selection menu', () => { - it('should increase grid density when selecting compact density', () => { + it('should increase grid density when selecting compact density', function test(t = {}) { + if (isJSDOM) { + // JSDOM seem to not support CSS variables properly and `height: var(--height)` ends up being `height: ''` + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const rowHeight = 30; render(
@@ -168,7 +194,14 @@ describe(' - Density', () => { expectHeight(rowHeight * COMPACT_DENSITY_FACTOR); }); - it('should decrease grid density when selecting comfortable density', () => { + it('should decrease grid density when selecting comfortable density', function test(t = {}) { + if (isJSDOM) { + // JSDOM seem to not support CSS variables properly and `height: var(--height)` ends up being `height: ''` + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const rowHeight = 30; render(
@@ -188,7 +221,14 @@ describe(' - Density', () => { expectHeight(rowHeight * COMFORTABLE_DENSITY_FACTOR); }); - it('should increase grid density even if toolbar is not enabled', () => { + it('should increase grid density even if toolbar is not enabled', function test(t = {}) { + if (isJSDOM) { + // JSDOM seem to not support CSS variables properly and `height: var(--height)` ends up being `height: ''` + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const rowHeight = 30; render(
@@ -199,7 +239,14 @@ describe(' - Density', () => { expectHeight(rowHeight * COMPACT_DENSITY_FACTOR); }); - it('should decrease grid density even if toolbar is not enabled', () => { + it('should decrease grid density even if toolbar is not enabled', function test(t = {}) { + if (isJSDOM) { + // JSDOM seem to not support CSS variables properly and `height: var(--height)` ends up being `height: ''` + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + const rowHeight = 30; render(
@@ -210,7 +257,14 @@ describe(' - Density', () => { expectHeight(rowHeight * COMFORTABLE_DENSITY_FACTOR); }); - it('should apply to the root element a class corresponding to the current density', () => { + it('should apply to the root element a class corresponding to the current density', function test(t = {}) { + if (isJSDOM) { + // JSDOM seem to not support CSS variables properly and `height: var(--height)` ends up being `height: ''` + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); + } + function Test(props: Partial) { return (
diff --git a/packages/x-data-grid/src/tests/export.DataGrid.test.tsx b/packages/x-data-grid/src/tests/export.DataGrid.test.tsx index fd39af7dd1ad..d4e686bea24b 100644 --- a/packages/x-data-grid/src/tests/export.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/export.DataGrid.test.tsx @@ -6,6 +6,12 @@ import { useBasicDemoData } from '@mui/x-data-grid-generator'; import { createRenderer, screen, fireEvent } from '@mui/internal-test-utils'; describe(' - Export', () => { + // We need `createObjectURL` to test the downloaded value + if (/jsdom/.test(window.navigator.userAgent)) { + // Need layouting + return; + } + const { render, clock } = createRenderer({ clock: 'fake' }); function TestCase(props: Omit) { @@ -18,14 +24,6 @@ describe(' - Export', () => { ); } - // We need `createObjectURL` to test the downloaded value - before(function beforeHook() { - if (/jsdom/.test(window.navigator.userAgent)) { - // Need layouting - this.skip(); - } - }); - let spyCreateObjectURL: SinonSpy; beforeEach(() => { diff --git a/packages/x-data-grid/src/tests/keyboard.DataGrid.test.tsx b/packages/x-data-grid/src/tests/keyboard.DataGrid.test.tsx index a83f17033416..7781a68768d9 100644 --- a/packages/x-data-grid/src/tests/keyboard.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/keyboard.DataGrid.test.tsx @@ -158,10 +158,12 @@ describe(' - Keyboard', () => { expect(getActiveCell()).to.equal('1-0'); // Already on the 1st cell }); - it('should move down by the amount of rows visible on screen when pressing "PageDown"', function test() { + it('should move down by the amount of rows visible on screen when pressing "PageDown"', function test(t = {}) { if (isJSDOM) { // This test is not relevant if we can't choose the actual height - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); @@ -174,10 +176,12 @@ describe(' - Keyboard', () => { expect(getActiveCell()).to.equal(`9-1`); }); - it('should move down by the amount of rows visible on screen when pressing Space key', function test() { + it('should move down by the amount of rows visible on screen when pressing Space key', function test(t = {}) { if (isJSDOM) { // This test is not relevant if we can't choose the actual height - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); @@ -190,10 +194,12 @@ describe(' - Keyboard', () => { expect(getActiveCell()).to.equal(`9-1`); }); - it('should move up by the amount of rows visible on screen when pressing "PageUp"', function test() { + it('should move up by the amount of rows visible on screen when pressing "PageUp"', function test(t = {}) { if (isJSDOM) { // This test is not relevant if we can't choose the actual height - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); @@ -204,10 +210,12 @@ describe(' - Keyboard', () => { expect(getActiveCell()).to.equal(`3-1`); }); - it('should move to the first row before moving to column header when pressing "PageUp"', function test() { + it('should move to the first row before moving to column header when pressing "PageUp"', function test(t = {}) { if (isJSDOM) { // This test is not relevant if we can't choose the actual height - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); @@ -223,10 +231,12 @@ describe(' - Keyboard', () => { expect(getActiveColumnHeader()).to.equal(`1`); }); - it('should move to the first row before moving to column header when pressing "PageUp" on page > 0', function test() { + it('should move to the first row before moving to column header when pressing "PageUp" on page > 0', function test(t = {}) { if (isJSDOM) { // This test is not relevant if we can't choose the actual height - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); @@ -309,10 +319,12 @@ describe(' - Keyboard', () => { }); describe('column header navigation', () => { - it('should scroll horizontally when navigating between column headers with arrows', function test() { + it('should scroll horizontally when navigating between column headers with arrows', function test(t = {}) { if (isJSDOM) { // Need layouting for column virtualization - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(
@@ -326,10 +338,12 @@ describe(' - Keyboard', () => { expect(virtualScroller.scrollLeft).not.to.equal(0); }); - it('should scroll horizontally when navigating between column headers with arrows even if rows are empty', function test() { + it('should scroll horizontally when navigating between column headers with arrows even if rows are empty', function test(t = {}) { if (isJSDOM) { // Need layouting for column virtualization - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(
@@ -379,10 +393,12 @@ describe(' - Keyboard', () => { expect(getActiveColumnHeader()).to.equal('0'); }); - it('should move down by the amount of rows visible on screen when pressing "PageDown"', function test() { + it('should move down by the amount of rows visible on screen when pressing "PageDown"', function test(t = {}) { if (isJSDOM) { // This test is not relevant if we can't choose the actual height - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); @@ -392,10 +408,12 @@ describe(' - Keyboard', () => { expect(getActiveCell()).to.equal(`5-1`); }); - it('should move focus when the focus is on a column header button', function test() { + it('should move focus when the focus is on a column header button', function test(t = {}) { if (isJSDOM) { // This test is not relevant if we can't choose the actual height - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); @@ -499,10 +517,12 @@ describe(' - Keyboard', () => { ); } - it('should scroll horizontally when navigating between column group headers with arrows', function test() { + it('should scroll horizontally when navigating between column group headers with arrows', function test(t = {}) { if (isJSDOM) { // Need layouting for column virtualization - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(
@@ -520,10 +540,12 @@ describe(' - Keyboard', () => { expect(virtualScroller.scrollLeft).not.to.equal(0); }); - it('should scroll horizontally when navigating between column headers with arrows even if rows are empty', function test() { + it('should scroll horizontally when navigating between column headers with arrows even if rows are empty', function test(t = {}) { if (isJSDOM) { // Need layouting for column virtualization - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(
diff --git a/packages/x-data-grid/src/tests/layout.DataGrid.test.tsx b/packages/x-data-grid/src/tests/layout.DataGrid.test.tsx index aee37da9c508..1a5d6733a2a0 100644 --- a/packages/x-data-grid/src/tests/layout.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/layout.DataGrid.test.tsx @@ -74,12 +74,10 @@ describe(' - Layout & warnings', () => { }); describe('Layout', () => { - before(function beforeHook() { - if (/jsdom/.test(window.navigator.userAgent)) { - // Need layouting - this.skip(); - } - }); + if (/jsdom/.test(window.navigator.userAgent)) { + // Need layouting + return; + } it('should resize the width of the columns', async () => { interface TestCaseProps { @@ -693,10 +691,12 @@ describe(' - Layout & warnings', () => { ); }); - it('should include the scrollbar in the intrinsic height when there are more columns to show', function test() { + it('should include the scrollbar in the intrinsic height when there are more columns to show', function test(t = {}) { // On MacOS the scrollbar has zero width if (/macintosh/i.test(window.navigator.userAgent)) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const columnHeaderHeight = 40; const rowHeight = 30; @@ -789,10 +789,12 @@ describe(' - Layout & warnings', () => { expect(gridVar('--DataGrid-hasScrollX')).to.equal('0'); }); - it('should have a horizontal scrollbar when there are more columns to show and no rows', function test() { + it('should have a horizontal scrollbar when there are more columns to show and no rows', function test(t = {}) { // On MacOS the scrollbar has zero width if (/macintosh/i.test(window.navigator.userAgent)) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(
@@ -937,12 +939,14 @@ describe(' - Layout & warnings', () => { }).toErrorDev('MUI X: `` is not a valid prop.'); }); - it('should throw if the rows has no id', function test() { + it('should throw if the rows has no id', function test(t = {}) { // TODO is this fixed? if (!/jsdom/.test(window.navigator.userAgent)) { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const rows = [ @@ -1022,9 +1026,11 @@ describe(' - Layout & warnings', () => { describe('non-strict mode', () => { const { render: innerRender } = createRenderer({ strict: false }); - it('should render in JSDOM', function test() { + it('should render in JSDOM', function test(t = {}) { if (!/jsdom/.test(window.navigator.userAgent)) { - this.skip(); // Only run in JSDOM + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } innerRender(
@@ -1036,9 +1042,12 @@ describe(' - Layout & warnings', () => { }); }); - it('should allow style customization using the theme', function test() { + it('should allow style customization using the theme', function test(t = {}) { if (/jsdom/.test(window.navigator.userAgent)) { - this.skip(); // Doesn't work with mocked window.getComputedStyle + // Doesn't work with mocked window.getComputedStyle + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const theme = createTheme({ @@ -1078,9 +1087,12 @@ describe(' - Layout & warnings', () => { expect(window.getComputedStyle(getCell(0, 0)).backgroundColor).to.equal('rgb(0, 128, 0)'); }); - it('should support the sx prop', function test() { + it('should support the sx prop', function test(t = {}) { if (/jsdom/.test(window.navigator.userAgent)) { - this.skip(); // Doesn't work with mocked window.getComputedStyle + // Doesn't work with mocked window.getComputedStyle + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const theme = createTheme({ @@ -1161,11 +1173,11 @@ describe(' - Layout & warnings', () => { }); describe('should not overflow parent', () => { - before(function beforeHook() { - if (/jsdom/.test(window.navigator.userAgent)) { - this.skip(); // Doesn't work with mocked window.getComputedStyle - } - }); + if (/jsdom/.test(window.navigator.userAgent)) { + // Doesn't work with mocked window.getComputedStyle + + return; + } const rows = [{ id: 1, username: '@MUI', age: 20 }]; const columns = [ @@ -1203,10 +1215,12 @@ describe(' - Layout & warnings', () => { }); // See https://github.com/mui/mui-x/issues/8737 - it('should not add horizontal scrollbar when .MuiDataGrid-main has border', async function test() { + it('should not add horizontal scrollbar when .MuiDataGrid-main has border', async function test(t = {}) { if (/jsdom/.test(window.navigator.userAgent)) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -1231,10 +1245,12 @@ describe(' - Layout & warnings', () => { }); // See https://github.com/mui/mui-x/issues/8689#issuecomment-1582616570 - it('should not add scrollbars when the parent container has fractional size', async function test() { + it('should not add scrollbars when the parent container has fractional size', async function test(t = {}) { if (/jsdom/.test(window.navigator.userAgent)) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -1250,10 +1266,12 @@ describe(' - Layout & warnings', () => { }); // See https://github.com/mui/mui-x/issues/9510 - it('should not exceed maximum call stack size when the parent container has fractional width', function test() { + it('should not exceed maximum call stack size when the parent container has fractional width', function test(t = {}) { if (/jsdom/.test(window.navigator.userAgent)) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -1264,10 +1282,12 @@ describe(' - Layout & warnings', () => { }); // See https://github.com/mui/mui-x/issues/9550 - it('should not exceed maximum call stack size with duplicated flex fields', function test() { + it('should not exceed maximum call stack size with duplicated flex fields', function test(t = {}) { if (/jsdom/.test(window.navigator.userAgent)) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } expect(() => { @@ -1289,10 +1309,12 @@ describe(' - Layout & warnings', () => { }); // See https://github.com/mui/mui-x/issues/9550#issuecomment-1619020477 - it('should not exceed maximum call stack size caused by floating point precision error', function test() { + it('should not exceed maximum call stack size caused by floating point precision error', function test(t = {}) { if (/jsdom/.test(window.navigator.userAgent)) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( diff --git a/packages/x-data-grid/src/tests/pagination.DataGrid.test.tsx b/packages/x-data-grid/src/tests/pagination.DataGrid.test.tsx index 94421d70f768..e6f5e579bf35 100644 --- a/packages/x-data-grid/src/tests/pagination.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/pagination.DataGrid.test.tsx @@ -33,12 +33,9 @@ describe(' - Pagination', () => { } describe('prop: paginationModel and onPaginationModelChange', () => { - before(function beforeHook() { - if (isJSDOM) { - // Need layouting - this.skip(); - } - }); + if (isJSDOM) { + return; + } it('should display the rows of page given in props', () => { render(); @@ -391,12 +388,10 @@ describe(' - Pagination', () => { }); describe('prop: autoPageSize', () => { - before(function beforeHook() { - if (isJSDOM) { - // Need layouting - this.skip(); - } - }); + if (isJSDOM) { + // Need layouting + return; + } function TestCaseAutoPageSize( props: Omit & { height: number; nbRows: number }, @@ -638,12 +633,10 @@ describe(' - Pagination', () => { }); describe('prop: initialState.pagination', () => { - before(function beforeHook() { - if (isJSDOM) { - // Need layouting - this.skip(); - } - }); + if (isJSDOM) { + // Need layouting + return; + } it('should allow to initialize the paginationModel', () => { render( diff --git a/packages/x-data-grid/src/tests/quickFiltering.DataGrid.test.tsx b/packages/x-data-grid/src/tests/quickFiltering.DataGrid.test.tsx index 44d608d5602f..3c14dcf31bab 100644 --- a/packages/x-data-grid/src/tests/quickFiltering.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/quickFiltering.DataGrid.test.tsx @@ -639,9 +639,11 @@ describe(' - Quick filter', () => { }); // https://github.com/mui/mui-x/issues/6783 - it('should not override user input when typing', async function test() { + it('should not override user input when typing', async function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } // Warning: this test doesn't fail consistently as it is timing-sensitive. const debounceMs = 50; diff --git a/packages/x-data-grid/src/tests/rowSelection.DataGrid.test.tsx b/packages/x-data-grid/src/tests/rowSelection.DataGrid.test.tsx index 78d613915b14..75b79a8243d4 100644 --- a/packages/x-data-grid/src/tests/rowSelection.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/rowSelection.DataGrid.test.tsx @@ -365,9 +365,11 @@ describe(' - Row selection', () => { expect(input2.checked).to.equal(true); }); - it('should remove the selection from rows that are filtered out', async function test() { + it('should remove the selection from rows that are filtered out', async function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( - Row selection', () => { expect(getSelectedRowIds()).to.deep.equal([1, 2]); }); - it('should not jump during scroll while the focus is on the checkbox', function test() { + it('should not jump during scroll while the focus is on the checkbox', function test(t = {}) { if (isJSDOM) { - this.skip(); // HTMLElement.focus() only scrolls to the element on a real browser + // HTMLElement.focus() only scrolls to the element on a real browser + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const data = getBasicGridData(20, 1); render(); @@ -584,11 +589,13 @@ describe(' - Row selection', () => { describe('ripple', () => { clock.withFakeTimers(); - it('should keep only one ripple visible when navigating between checkboxes', async function test() { + it('should keep only one ripple visible when navigating between checkboxes', async function test(t = {}) { if (isJSDOM) { // JSDOM doesn't fire "blur" when .focus is called in another element // FIXME Firefox doesn't show any ripple - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); const cell = getCell(1, 1); diff --git a/packages/x-data-grid/src/tests/rowSpanning.DataGrid.test.tsx b/packages/x-data-grid/src/tests/rowSpanning.DataGrid.test.tsx index c3875d9b3889..0f6d078d7f1c 100644 --- a/packages/x-data-grid/src/tests/rowSpanning.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/rowSpanning.DataGrid.test.tsx @@ -112,9 +112,11 @@ describe(' - Row spanning', () => { const rowHeight = 52; - it('should span the repeating row values', function test() { + it('should span the repeating row values', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); const rowsWithSpannedCells = Object.keys(apiRef.current.state.rowSpanning.spannedCells); @@ -128,9 +130,11 @@ describe(' - Row spanning', () => { }); describe('sorting', () => { - it('should work with sorting when initializing sorting', function test() { + it('should work with sorting when initializing sorting', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( - Row spanning', () => { expect(spannedCell).to.have.style('height', `${rowHeight * spanValue.code}px`); }); - it('should work with sorting when controlling sorting', function test() { + it('should work with sorting when controlling sorting', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); const rowsWithSpannedCells = Object.keys(apiRef.current.state.rowSpanning.spannedCells); @@ -164,9 +170,11 @@ describe(' - Row spanning', () => { }); describe('filtering', () => { - it('should work with filtering when initializing filter', function test() { + it('should work with filtering when initializing filter', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( - Row spanning', () => { expect(spannedCell).to.have.style('height', `${rowHeight * spanValue.code}px`); }); - it('should work with filtering when controlling filter', function test() { + it('should work with filtering when controlling filter', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( - Row spanning', () => { }); describe('pagination', () => { - it('should only compute the row spanning state for current page', async function test() { + it('should only compute the row spanning state for current page', async function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( - Rows', () => { ); } - it('should throw an error if getActions is missing', function test() { + it('should throw an error if getActions is missing', function test(t = {}) { if (!isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } expect(() => { render( @@ -494,12 +496,10 @@ describe(' - Rows', () => { }); describe('prop: getRowHeight', () => { - before(function beforeHook() { - if (isJSDOM) { - // Need layouting - this.skip(); - } - }); + if (isJSDOM) { + // Need layouting + return; + } describe('static row height', () => { const ROW_HEIGHT = 52; @@ -820,10 +820,13 @@ describe(' - Rows', () => { }); }); - it('should position correctly the render zone when the 2nd page has less rows than the 1st page', async function test() { + it('should position correctly the render zone when the 2nd page has less rows than the 1st page', async function test(t = {}) { const { userAgent } = window.navigator; if (!userAgent.includes('Headless') || /edg/i.test(userAgent)) { - this.skip(); // FIXME: We need a waitFor that works with fake clock + // FIXME: We need a waitFor that works with fake clock + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const data = getBasicGridData(120, 3); const columnHeaderHeight = 50; @@ -874,10 +877,13 @@ describe(' - Rows', () => { expect(gridOffsetTop()).to.equal(0); }); - it('should position correctly the render zone when changing pageSize to a lower value and moving to next page', async function test() { + it('should position correctly the render zone when changing pageSize to a lower value and moving to next page', async function test(t = {}) { const { userAgent } = window.navigator; if (!userAgent.includes('Headless') || /edg/i.test(userAgent)) { - this.skip(); // In Chrome non-headless and Edge this test is flacky + // In Chrome non-headless and Edge this test is flacky + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const data = getBasicGridData(120, 3); const columnHeaderHeight = 50; @@ -1120,10 +1126,12 @@ describe(' - Rows', () => { }); // https://github.com/mui/mui-x/issues/10373 - it('should set proper `data-rowindex` and `aria-rowindex` when focused row is out of the viewport', async function test() { + it('should set proper `data-rowindex` and `aria-rowindex` when focused row is out of the viewport', async function test(t = {}) { if (isJSDOM) { // needs virtualization - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(
diff --git a/packages/x-data-grid/src/tests/slots.DataGrid.test.tsx b/packages/x-data-grid/src/tests/slots.DataGrid.test.tsx index 9059c02653f7..dcf10c48f00a 100644 --- a/packages/x-data-grid/src/tests/slots.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/slots.DataGrid.test.tsx @@ -155,12 +155,14 @@ describe(' - Slots', () => { }); }); - it('should throw if a component is used without providing the context', function test() { + it('should throw if a component is used without providing the context', function test(t = {}) { // TODO is this fixed? if (!/jsdom/.test(window.navigator.userAgent)) { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } expect(() => { diff --git a/vitest.config.mts b/vitest.config.mts index 65661a9cc1ee..335524fb3d26 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -6,6 +6,7 @@ export default defineConfig({ ...[ { lib: 'charts', plans: ['pro'] }, { lib: 'date-pickers', plans: ['pro'] }, + { lib: 'data-grid', plans: ['pro', 'premium', 'generator'] }, { lib: 'internals' }, { lib: 'license' }, ].flatMap((v) => { diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 0925caf21404..8ed855b12776 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -6,6 +6,7 @@ const packages = [ 'x-charts-pro', 'x-date-pickers', 'x-date-pickers-pro', + 'x-data-grid', 'x-internals', ]; From 188522223c040f69d4141d6749493ef44f901d8f Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 13:25:39 +0200 Subject: [PATCH 072/119] fix toerror --- packages/x-data-grid/src/tests/layout.DataGrid.test.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/x-data-grid/src/tests/layout.DataGrid.test.tsx b/packages/x-data-grid/src/tests/layout.DataGrid.test.tsx index 1a5d6733a2a0..f438dea45af9 100644 --- a/packages/x-data-grid/src/tests/layout.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/layout.DataGrid.test.tsx @@ -965,7 +965,8 @@ describe(' - Layout & warnings', () => { }).toErrorDev([ 'The data grid component requires all rows to have a unique `id` property', 'The data grid component requires all rows to have a unique `id` property', - 'The above error occurred in the component', + // Cut off the end of the phrase as vitest seems to rename DataGrid into DataGrid2 + 'The above error occurred in the Date: Fri, 11 Oct 2024 13:33:20 +0200 Subject: [PATCH 073/119] datagrid cleanup --- test/setup.ts | 9 +++++++++ vitest.config.mts | 1 + 2 files changed, 10 insertions(+) diff --git a/test/setup.ts b/test/setup.ts index 3df2109ece64..5ef087e6ff99 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -3,6 +3,9 @@ import 'test/utils/addChaiAssertions'; import 'test/utils/setupPickers'; import 'test/utils/licenseRelease'; import { generateTestLicenseKey, setupTestLicenseKey } from 'test/utils/testLicense'; +import { unstable_resetCleanupTracking as unstable_resetCleanupTrackingDataGrid } from '@mui/x-data-grid'; +import { unstable_resetCleanupTracking as unstable_resetCleanupTrackingDataGridPro } from '@mui/x-data-grid-pro'; +// import { unstable_resetCleanupTracking as unstable_resetCleanupTrackingTreeView } from '@mui/x-tree-view'; // @ts-ignore globalThis.before = beforeAll; @@ -24,6 +27,12 @@ beforeEach(() => { setupTestLicenseKey(licenseKey); }); +afterEach(() => { + unstable_resetCleanupTrackingDataGrid(); + unstable_resetCleanupTrackingDataGridPro(); + // unstable_resetCleanupTrackingTreeView(); +}); + // Only necessary when not in browser mode. if (isVitestJsdom) { class Touch { diff --git a/vitest.config.mts b/vitest.config.mts index 335524fb3d26..839c1e24df4d 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -6,6 +6,7 @@ export default defineConfig({ ...[ { lib: 'charts', plans: ['pro'] }, { lib: 'date-pickers', plans: ['pro'] }, + { lib: 'tree-view', plans: ['pro'] }, { lib: 'data-grid', plans: ['pro', 'premium', 'generator'] }, { lib: 'internals' }, { lib: 'license' }, From b869545589f6b6562e5666f22438791526f30a87 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 13:53:42 +0200 Subject: [PATCH 074/119] fix jsdom issues --- .../x-data-grid/src/tests/layout.DataGrid.test.tsx | 2 +- .../x-data-grid/src/tests/slots.DataGrid.test.tsx | 12 ++++++++++-- test/setup.ts | 8 ++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/x-data-grid/src/tests/layout.DataGrid.test.tsx b/packages/x-data-grid/src/tests/layout.DataGrid.test.tsx index f438dea45af9..5365215a038b 100644 --- a/packages/x-data-grid/src/tests/layout.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/layout.DataGrid.test.tsx @@ -965,7 +965,7 @@ describe(' - Layout & warnings', () => { }).toErrorDev([ 'The data grid component requires all rows to have a unique `id` property', 'The data grid component requires all rows to have a unique `id` property', - // Cut off the end of the phrase as vitest seems to rename DataGrid into DataGrid2 + // Cut off the end of the phrase as vitest seems to 2 at the end of the component name 'The above error occurred in the - Slots', () => {
, ); expect(onClick.callCount).to.equal(0); - const button = screen.getByRole('button', { name: /show filters/i }); + + let button; + // I can see the button in the debug, but it's not found by the test... + if (process.env.MUI_JSDOM) { + button = screen.getByTestId('FilterAltIcon'); + } else { + button = screen.getByRole('button', { name: /show filters/i }); + } fireEvent.click(button); expect(onClick.lastCall.args[0]).to.have.property('field', 'brand'); expect(onClick.lastCall.args[1]).to.have.property('target', button); @@ -174,7 +181,8 @@ describe(' - Slots', () => { }).toErrorDev([ 'MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.', 'MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.', - 'The above error occurred in the component', + // Cut off the end of the phrase as vitest seems to 2 at the end of the component name + 'The above error occurred in the { }); afterEach(() => { - unstable_resetCleanupTrackingDataGrid(); - unstable_resetCleanupTrackingDataGridPro(); + // unstable_resetCleanupTrackingDataGrid(); + // unstable_resetCleanupTrackingDataGridPro(); // unstable_resetCleanupTrackingTreeView(); }); From 739c2d40762cef5bd54b68e654289e77646fa86a Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 13:55:03 +0200 Subject: [PATCH 075/119] fix browser tests datagrid --- packages/x-data-grid/src/tests/export.DataGrid.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/x-data-grid/src/tests/export.DataGrid.test.tsx b/packages/x-data-grid/src/tests/export.DataGrid.test.tsx index d4e686bea24b..b08b5c85ff45 100644 --- a/packages/x-data-grid/src/tests/export.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/export.DataGrid.test.tsx @@ -27,7 +27,7 @@ describe(' - Export', () => { let spyCreateObjectURL: SinonSpy; beforeEach(() => { - spyCreateObjectURL = spy(global.URL, 'createObjectURL'); + spyCreateObjectURL = spy(globalThis.URL, 'createObjectURL'); }); afterEach(() => { From 8b38fd95bfb92aa0a203b57610b3c83bbd410107 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 14:06:30 +0200 Subject: [PATCH 076/119] datagrid pro skips --- .../tests/accessibility.DataGridPro.test.tsx | 10 +-- .../tests/columnHeaders.DataGridPro.test.tsx | 7 +- .../tests/columnPinning.DataGridPro.test.tsx | 36 ++++++--- .../tests/columnSpanning.DataGridPro.test.tsx | 12 ++- .../src/tests/columns.DataGridPro.test.tsx | 36 ++++----- .../tests/detailPanel.DataGridPro.test.tsx | 74 +++++++++++++------ .../src/tests/events.DataGridPro.test.tsx | 7 +- .../src/tests/filtering.DataGridPro.test.tsx | 21 ++++-- .../tests/infiniteLoader.DataGridPro.test.tsx | 21 ++++-- .../src/tests/layout.DataGridPro.test.tsx | 17 +++-- .../src/tests/lazyLoader.DataGridPro.test.tsx | 21 ++++-- .../src/tests/rowPinning.DataGridPro.test.tsx | 48 ++++++++---- .../src/tests/rows.DataGridPro.test.tsx | 20 ++--- .../src/tests/sorting.DataGridPro.test.tsx | 6 +- vitest.workspace.ts | 1 + 15 files changed, 213 insertions(+), 124 deletions(-) diff --git a/packages/x-data-grid-pro/src/tests/accessibility.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/accessibility.DataGridPro.test.tsx index 474026c577d0..301dfad85789 100644 --- a/packages/x-data-grid-pro/src/tests/accessibility.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/accessibility.DataGridPro.test.tsx @@ -15,12 +15,10 @@ function logViolations(violations: any) { } describe(' - Accessibility', () => { - before(function beforeHook() { - if (!/chrome/i.test(window.navigator.userAgent)) { - // Only run accessibility tests in Chrome, since it should behave the same in all browsers - this.skip(); - } - }); + if (!/chrome/i.test(window.navigator.userAgent)) { + // Only run accessibility tests in Chrome, since it should behave the same in all browsers + return; + } const { render } = createRenderer(); diff --git a/packages/x-data-grid-pro/src/tests/columnHeaders.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/columnHeaders.DataGridPro.test.tsx index 90830ac40578..39d2c0191c29 100644 --- a/packages/x-data-grid-pro/src/tests/columnHeaders.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/columnHeaders.DataGridPro.test.tsx @@ -31,9 +31,12 @@ describe(' - Column headers', () => { ], }; - it('should not scroll the column headers when a column is focused', function test() { + it('should not scroll the column headers when a column is focused', function test(t = {}) { if (isJSDOM) { - this.skip(); // JSDOM version of .focus() doesn't scroll + // JSDOM version of .focus() doesn't scroll + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(
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 448aa1d0c63c..c82f5d59c3a3 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 @@ -89,10 +89,12 @@ describe(' - Column pinning', () => { window.ResizeObserver = originalResizeObserver; }); - it('should scroll when the next cell to focus is covered by the left pinned columns', function test() { + it('should scroll when the next cell to focus is covered by the left pinned columns', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); const virtualScroller = document.querySelector(`.${gridClasses.virtualScroller}`)!; @@ -104,10 +106,12 @@ describe(' - Column pinning', () => { expect(virtualScroller.scrollLeft).to.equal(0); }); - it('should scroll when the next cell to focus is covered by the right pinned columns', function test() { + it('should scroll when the next cell to focus is covered by the right pinned columns', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); const virtualScroller = document.querySelector(`.${gridClasses.virtualScroller}`)!; @@ -118,10 +122,12 @@ describe(' - Column pinning', () => { expect(virtualScroller.scrollLeft).to.equal(100); }); - it('should increase the width of right pinned columns by resizing to the left', function test() { + it('should increase the width of right pinned columns by resizing to the left', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); const columnHeader = getColumnHeaderCell(2); @@ -136,10 +142,12 @@ describe(' - Column pinning', () => { expect(separator).to.have.class(gridClasses['columnSeparator--sideLeft']); }); - it('should reduce the width of right pinned columns by resizing to the right', function test() { + it('should reduce the width of right pinned columns by resizing to the right', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); const columnHeader = getColumnHeaderCell(2); @@ -204,10 +212,12 @@ describe(' - Column pinning', () => { expect(getColumnHeadersTextContent()).to.deep.equal(['id', '', 'Currency Pair']); }); - it('should add border to right pinned columns section when `showCellVerticalBorder={true}`', function test() { + it('should add border to right pinned columns section when `showCellVerticalBorder={true}`', function test(t = {}) { if (isJSDOM) { // Doesn't work with mocked window.getComputedStyle - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -227,10 +237,12 @@ describe(' - Column pinning', () => { }); // https://github.com/mui/mui-x/issues/12431 - it('should not render unnecessary filler after the last row', function test() { + it('should not render unnecessary filler after the last row', function test(t = {}) { if (isJSDOM) { // Needs layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const rowHeight = 50; diff --git a/packages/x-data-grid-pro/src/tests/columnSpanning.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/columnSpanning.DataGridPro.test.tsx index 5c3bd5c7c0cc..60110a3db7c6 100644 --- a/packages/x-data-grid-pro/src/tests/columnSpanning.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/columnSpanning.DataGridPro.test.tsx @@ -36,10 +36,12 @@ describe(' - Column spanning', () => { ], }; - it('should not apply `colSpan` in pinned columns section if there is only one column there', function test() { + it('should not apply `colSpan` in pinned columns section if there is only one column there', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -155,10 +157,12 @@ describe(' - Column spanning', () => { expect(() => getCell(2, 3)).to.throw(/not found/); }); - it('should work with column resizing', function test() { + it('should work with column resizing', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const columns = [{ field: 'brand', colSpan: 2 }, { field: 'category' }, { field: 'price' }]; diff --git a/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx index 3d6e0567771d..4eb6d41310e6 100644 --- a/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx @@ -83,12 +83,10 @@ describe(' - Columns', () => { }); describe('resizing', () => { - before(function beforeHook() { - if (isJSDOM) { - // Need layouting - this.skip(); - } - }); + if (isJSDOM) { + // Need layouting + return; + } const columns = [{ field: 'brand', width: 100 }]; @@ -102,10 +100,12 @@ describe(' - Columns', () => { expect(getCell(1, 0).getBoundingClientRect().width).to.equal(110); }); - it('should allow to resize columns with the touch', function test() { + it('should allow to resize columns with the touch', function test(t = {}) { // Only run in supported browsers if (typeof Touch === 'undefined') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); const separator = document.querySelector(`.${gridClasses['columnSeparator--resizable']}`)!; @@ -238,12 +238,10 @@ describe(' - Columns', () => { }); describe('flex resizing', () => { - before(function beforeHook() { - if (isJSDOM) { - // Need layouting - this.skip(); - } - }); + if (isJSDOM) { + // Need layouting + return; + } it('should resize the flex width after resizing another column with api', () => { const twoColumns = [ @@ -435,12 +433,10 @@ describe(' - Columns', () => { }); describe('autosizing', () => { - before(function beforeHook() { - if (isJSDOM) { - // Need layouting - this.skip(); - } - }); + if (isJSDOM) { + // Need layouting + return; + } const rows = [ { diff --git a/packages/x-data-grid-pro/src/tests/detailPanel.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/detailPanel.DataGridPro.test.tsx index 1f71824e507f..e2becfae021d 100644 --- a/packages/x-data-grid-pro/src/tests/detailPanel.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/detailPanel.DataGridPro.test.tsx @@ -32,9 +32,12 @@ describe(' - Detail panel', () => { ); } - it('should not allow to expand rows that do not specify a detail element', function test() { + it('should not allow to expand rows that do not specify a detail element', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( (Number(id) === 0 ? null :
)} />); const cell = getCell(0, 0); @@ -43,9 +46,11 @@ describe(' - Detail panel', () => { expect(getRow(0)).toHaveComputedStyle({ marginBottom: '0px' }); }); - it('should not consider the height of the detail panels when rendering new rows during scroll', function test() { + it('should not consider the height of the detail panels when rendering new rows during scroll', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const rowHeight = 50; render( @@ -68,9 +73,11 @@ describe(' - Detail panel', () => { expect(getColumnValues(1)[0]).to.equal('2'); // If there was no expanded row, the first rendered would be 5 }); - it('should derive the height from the content if getDetailPanelHeight returns "auto"', async function test() { + it('should derive the height from the content if getDetailPanelHeight returns "auto"', async function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const rowHeight = 50; const detailPanelHeight = 100; @@ -97,9 +104,11 @@ describe(' - Detail panel', () => { }); }); - it('should update the detail panel height if the content height changes when getDetailPanelHeight returns "auto"', async function test() { + it('should update the detail panel height if the content height changes when getDetailPanelHeight returns "auto"', async function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } function ExpandableCell() { const [expanded, setExpanded] = React.useState(false); @@ -153,9 +162,12 @@ describe(' - Detail panel', () => { }); }); - it('should position correctly the detail panels', function test() { + it('should position correctly the detail panels', function test(t = {}) { if (isJSDOM) { - this.skip(); // Doesn't work with mocked window.getComputedStyle + // Doesn't work with mocked window.getComputedStyle + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const rowHeight = 50; @@ -201,9 +213,12 @@ describe(' - Detail panel', () => { expect(screen.queryByText('Row 0')).to.equal(null); }); - it('should consider the height of the detail panel when scrolling to a cell', function test() { + it('should consider the height of the detail panel when scrolling to a cell', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const rowHeight = 50; const columnHeaderHeight = 50; @@ -229,9 +244,12 @@ describe(' - Detail panel', () => { expect(virtualScroller.scrollTop).to.equal(50); }); - it('should not scroll vertically when navigating expanded row cells', function test() { + it('should not scroll vertically when navigating expanded row cells', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } function Component() { const data = useBasicDemoData(10, 4); @@ -365,9 +383,12 @@ describe(' - Detail panel', () => { expect(getDetailPanelHeight2.callCount).to.equal(2); }); - it('should update the panel height if getDetailPanelHeight is changed while the panel is open', function test() { + it('should update the panel height if getDetailPanelHeight is changed while the panel is open', function test(t = {}) { if (isJSDOM) { - this.skip(); // Doesn't work with mocked window.getComputedStyle + // Doesn't work with mocked window.getComputedStyle + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const getDetailPanelHeight = spy(() => 100); @@ -437,9 +458,12 @@ describe(' - Detail panel', () => { }); // See https://github.com/mui/mui-x/issues/4607 - it('should make detail panel to take full width of the content', function test() { + it('should make detail panel to take full width of the content', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( - Detail panel', () => { }); // See https://github.com/mui/mui-x/issues/6694 - it('should add a bottom margin to the expanded row when using `getRowSpacing`', function test() { + it('should add a bottom margin to the expanded row when using `getRowSpacing`', function test(t = {}) { if (isJSDOM) { - this.skip(); // Doesn't work with mocked window.getComputedStyle + // Doesn't work with mocked window.getComputedStyle + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -493,9 +520,12 @@ describe(' - Detail panel', () => { expect(screen.getByTestId(`detail-panel-content`).textContent).to.equal(`${counter}`); }); - it("should not render detail panel for the focused row if it's outside of the viewport", function test() { + it("should not render detail panel for the focused row if it's outside of the viewport", function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( - Events params', () => { }); }); - it('publishing GRID_ROWS_SCROLL should call onFetchRows callback when rows lazy loading is enabled', function test() { + it('publishing GRID_ROWS_SCROLL should call onFetchRows callback when rows lazy loading is enabled', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const handleFetchRows = spy(); render( diff --git a/packages/x-data-grid-pro/src/tests/filtering.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/filtering.DataGridPro.test.tsx index 0f52a5973d60..d50cbfd4982d 100644 --- a/packages/x-data-grid-pro/src/tests/filtering.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/filtering.DataGridPro.test.tsx @@ -659,9 +659,12 @@ describe(' - Filter', () => { }); }); - it('should not scroll the page when a filter is removed from the panel', function test() { + it('should not scroll the page when a filter is removed from the panel', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(
@@ -693,9 +696,12 @@ describe(' - Filter', () => { expect(window.scrollY).to.equal(initialScrollPosition); }); - it('should not scroll the page when opening the filter panel and the operator=isAnyOf', function test() { + it('should not scroll the page when opening the filter panel and the operator=isAnyOf', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -911,9 +917,12 @@ describe(' - Filter', () => { }); }); - it('should give a stable ID to the filter item used as placeholder', function test() { + it('should give a stable ID to the filter item used as placeholder', function test(t = {}) { if (isJSDOM) { - this.skip(); // It's not re-rendering the filter panel correctly + // It's not re-rendering the filter panel correctly + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const { rerender } = render(); diff --git a/packages/x-data-grid-pro/src/tests/infiniteLoader.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/infiniteLoader.DataGridPro.test.tsx index 131bc7fc6668..ce570569b23c 100644 --- a/packages/x-data-grid-pro/src/tests/infiniteLoader.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/infiniteLoader.DataGridPro.test.tsx @@ -14,9 +14,12 @@ describe(' - Infnite loader', () => { const { render } = createRenderer(); - it('should call `onRowsScrollEnd` when viewport scroll reaches the bottom', async function test() { + it('should call `onRowsScrollEnd` when viewport scroll reaches the bottom', async function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const baseRows = [ { id: 0, brand: 'Nike' }, @@ -63,9 +66,12 @@ describe(' - Infnite loader', () => { }); }); - it('should call `onRowsScrollEnd` when there is not enough rows to cover the viewport height', async function test() { + it('should call `onRowsScrollEnd` when there is not enough rows to cover the viewport height', async function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const allRows = [ @@ -165,9 +171,12 @@ describe(' - Infnite loader', () => { expect(getRow.callCount).to.equal(5); }); - it('should not observe intersections with the rows pinned to the bottom', async function test() { + it('should not observe intersections with the rows pinned to the bottom', async function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const baseRows = [ { id: 0, brand: 'Nike' }, diff --git a/packages/x-data-grid-pro/src/tests/layout.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/layout.DataGridPro.test.tsx index 34c8e9ded21f..9b01204e8847 100644 --- a/packages/x-data-grid-pro/src/tests/layout.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/layout.DataGridPro.test.tsx @@ -27,12 +27,10 @@ describe(' - Layout', () => { columns: [{ field: 'brand', width: 100 }], }; - before(function beforeHook() { - if (/jsdom/.test(window.navigator.userAgent)) { - // Need layouting - this.skip(); - } - }); + if (/jsdom/.test(window.navigator.userAgent)) { + // Need layouting + return; + } // Adaptation of describeConformance() describe('MUI component API', () => { @@ -170,9 +168,12 @@ describe(' - Layout', () => { expect(document.querySelector('[title="Ordenar"]')).not.to.equal(null); }); - it('should support the sx prop', function test() { + it('should support the sx prop', function test(t = {}) { if (/jsdom/.test(window.navigator.userAgent)) { - this.skip(); // Doesn't work with mocked window.getComputedStyle + // Doesn't work with mocked window.getComputedStyle + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const theme = createTheme({ diff --git a/packages/x-data-grid-pro/src/tests/lazyLoader.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/lazyLoader.DataGridPro.test.tsx index 1f2dbac26b93..6ec102058f4a 100644 --- a/packages/x-data-grid-pro/src/tests/lazyLoader.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/lazyLoader.DataGridPro.test.tsx @@ -57,9 +57,12 @@ describe(' - Lazy loader', () => { ); } - it('should not call onFetchRows if the viewport is fully loaded', function test() { + it('should not call onFetchRows if the viewport is fully loaded', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const handleFetchRows = spy(); const rows = [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }, { id: 6 }, { id: 7 }]; @@ -67,9 +70,12 @@ describe(' - Lazy loader', () => { expect(handleFetchRows.callCount).to.equal(0); }); - it('should call onFetchRows when sorting is applied', function test() { + it('should call onFetchRows when sorting is applied', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const handleFetchRows = spy(); render(); @@ -80,9 +86,12 @@ describe(' - Lazy loader', () => { expect(handleFetchRows.callCount).to.equal(2); }); - it('should render skeleton cell if rowCount is bigger than the number of rows', function test() { + it('should render skeleton cell if rowCount is bigger than the number of rows', function test(t = {}) { if (isJSDOM) { - this.skip(); // Needs layout + // Needs layout + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); diff --git a/packages/x-data-grid-pro/src/tests/rowPinning.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/rowPinning.DataGridPro.test.tsx index 15f787bfdc45..9c5f8b7a73c6 100644 --- a/packages/x-data-grid-pro/src/tests/rowPinning.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/rowPinning.DataGridPro.test.tsx @@ -122,10 +122,12 @@ describe(' - Row pinning', () => { expect(screen.getByText(`Total Rows: ${rowCount - 2}`)).not.to.equal(null); }); - it('should keep rows pinned on rows scroll', function test() { + it('should keep rows pinned on rows scroll', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render(); @@ -420,10 +422,12 @@ describe(' - Row pinning', () => { expect(getActiveCellRowId()).to.equal('1'); }); - it('should work with pinned columns', function test() { + it('should work with pinned columns', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } function TestCase() { @@ -489,10 +493,12 @@ describe(' - Row pinning', () => { }); }); - it('should work with variable row height', function test() { + it('should work with variable row height', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } let apiRef!: React.MutableRefObject; @@ -522,10 +528,12 @@ describe(' - Row pinning', () => { expect(getRowById(1)?.clientHeight).to.equal(20); }); - it('should always update on `rowHeight` change', async function test() { + it('should always update on `rowHeight` change', async function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const defaultRowHeight = 52; @@ -559,10 +567,12 @@ describe(' - Row pinning', () => { expect(grid('pinnedRows--bottom')!.offsetHeight).to.equal(36); }); - it('should work with `autoHeight`', function test() { + it('should work with `autoHeight`', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const columnHeaderHeight = 56; @@ -583,10 +593,12 @@ describe(' - Row pinning', () => { expect(grid('main')!.clientHeight).to.equal(columnHeaderHeight + rowHeight * rowCount); }); - it('should work with `autoPageSize`', function test() { + it('should work with `autoPageSize`', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( @@ -765,10 +777,12 @@ describe(' - Row pinning', () => { expect(getRowById(1)!).to.have.class(className); }); - it('should support cell editing', async function test() { + it('should support cell editing', async function test(t = {}) { if (isJSDOM) { // flaky in JSDOM - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const processRowUpdate = spy((row) => ({ ...row, currencyPair: 'USD-GBP' })); const columns: GridColDef[] = [{ field: 'id' }, { field: 'name', editable: true }]; @@ -804,10 +818,12 @@ describe(' - Row pinning', () => { expect(processRowUpdate.lastCall.args[0]).to.deep.equal({ id: 3, name: 'Marcus' }); }); - it('should support row editing', async function test() { + it('should support row editing', async function test(t = {}) { if (isJSDOM) { // flaky in JSDOM - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const processRowUpdate = spy((row) => ({ ...row, currencyPair: 'USD-GBP' })); const columns: GridColDef[] = [{ field: 'id' }, { field: 'name', editable: true }]; diff --git a/packages/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx index 3acb545b4ed5..2bbc7629fa0f 100644 --- a/packages/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx @@ -397,12 +397,10 @@ describe(' - Rows', () => { }); describe('virtualization', () => { - before(function beforeHook() { - if (isJSDOM) { - // Need layouting - this.skip(); - } - }); + if (isJSDOM) { + // Need layouting + return; + } let apiRef: React.MutableRefObject; function TestCaseVirtualization( @@ -890,12 +888,10 @@ describe(' - Rows', () => { describe('apiRef: setRowHeight', () => { const ROW_HEIGHT = 52; - before(function beforeHook() { - if (isJSDOM) { - // Need layouting - this.skip(); - } - }); + if (isJSDOM) { + // Need layouting + return; + } beforeEach(() => { baselineProps = { diff --git a/packages/x-data-grid-pro/src/tests/sorting.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/sorting.DataGridPro.test.tsx index f2778ad7cd93..ea12377adb2c 100644 --- a/packages/x-data-grid-pro/src/tests/sorting.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/sorting.DataGridPro.test.tsx @@ -170,10 +170,12 @@ describe(' - Sorting', () => { }); }); - it('should prune rendering on cells', function test() { + it('should prune rendering on cells', function test(t = {}) { // The number of renders depends on the user-agent if (!/HeadlessChrome/.test(window.navigator.userAgent) || !isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } let renderCellCount: number = 0; diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 8ed855b12776..53c662187039 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -7,6 +7,7 @@ const packages = [ 'x-date-pickers', 'x-date-pickers-pro', 'x-data-grid', + 'x-data-grid-pro', 'x-internals', ]; From f5493b86309488630990c012a3e5e82d7fa42fdb Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 14:37:58 +0200 Subject: [PATCH 077/119] Fix weird prop logic --- .../tests/cellEditing.DataGridPro.test.tsx | 131 +++++++++--------- 1 file changed, 66 insertions(+), 65 deletions(-) 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 61eb25906561..bd1f453e8ee6 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 @@ -28,9 +28,7 @@ describe(' - Cell editing', () => { props: GridRenderEditCellParams, ) => React.ReactNode); - let columnProps: any = {}; - - function TestCase(props: Partial) { + function TestCase(props: Partial & { columnProps?: Record }) { apiRef = useGridApiRef(); return (
@@ -39,7 +37,7 @@ describe(' - Cell editing', () => { {...defaultData} columns={defaultData.columns.map((column) => column.field === 'currencyPair' - ? { ...column, renderEditCell, editable: true, ...columnProps } + ? { ...column, renderEditCell, editable: true, ...(props.columnProps ?? {}) } : column, )} {...props} @@ -50,7 +48,6 @@ describe(' - Cell editing', () => { afterEach(() => { renderEditCell.resetHistory(); - columnProps = {}; }); describe('apiRef', () => { @@ -112,8 +109,7 @@ describe(' - Cell editing', () => { ...row, currencyPair: value.trim(), }); - columnProps.valueSetter = valueSetter; - render(); + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect(renderEditCell.lastCall.args[0].row).to.deep.equal(defaultData.rows[0]); await act(() => @@ -126,14 +122,14 @@ describe(' - Cell editing', () => { }); it('should pass the new value through the value parser if defined', async () => { - columnProps.valueParser = spy((value) => value.toLowerCase()); - render(); + const valueParser = spy((value) => value.toLowerCase()); + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); - expect(columnProps.valueParser.callCount).to.equal(0); + expect(valueParser.callCount).to.equal(0); await act(() => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), ); - expect(columnProps.valueParser.callCount).to.equal(1); + expect(valueParser.callCount).to.equal(1); expect(renderEditCell.lastCall.args[0].value).to.equal('usd gbp'); }); @@ -148,10 +144,8 @@ describe(' - Cell editing', () => { }); it('should set isProcessingProps to true before calling preProcessEditCellProps', async () => { - columnProps.preProcessEditCellProps = spy( - ({ props }: GridPreProcessEditCellProps) => props, - ); - render(); + const preProcessEditCellProps = spy(({ props }: GridPreProcessEditCellProps) => props); + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); let promise: Promise | null = null; // We want to flush updates before preProcessEditCellProps resolves @@ -167,10 +161,8 @@ describe(' - Cell editing', () => { }); it('should call preProcessEditCellProps with the correct params', async () => { - columnProps.preProcessEditCellProps = spy( - ({ props }: GridPreProcessEditCellProps) => props, - ); - render(); + const preProcessEditCellProps = spy(({ props }: GridPreProcessEditCellProps) => props); + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); await act(() => apiRef.current.setEditCellValue({ @@ -179,7 +171,7 @@ describe(' - Cell editing', () => { value: 'USD GBP', }), ); - const args = columnProps.preProcessEditCellProps.lastCall.args[0]; + const args = preProcessEditCellProps.lastCall.args[0]; expect(args.id).to.equal(0); expect(args.row).to.deep.equal(defaultData.rows[0]); expect(args.hasChanged).to.equal(true); @@ -192,14 +184,19 @@ describe(' - Cell editing', () => { }); it('should not publish onCellEditStop if field has error', async () => { - columnProps.preProcessEditCellProps = spy(({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = spy(({ props }: GridPreProcessEditCellProps) => ({ ...props, error: true, })); const handleEditCellStop = spy(); - render(); + render( + , + ); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); await act(() => apiRef.current.setEditCellValue({ @@ -217,11 +214,11 @@ describe(' - Cell editing', () => { }); it('should pass to renderEditCell the props returned by preProcessEditCellProps', async () => { - columnProps.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, foo: 'bar', }); - render(); + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect(renderEditCell.lastCall.args[0].foo).to.equal(undefined); await act(() => @@ -231,11 +228,11 @@ describe(' - Cell editing', () => { }); it('should not pass to renderEditCell the value returned by preProcessEditCellProps', async () => { - columnProps.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, value: 'foobar', }); - render(); + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect(renderEditCell.lastCall.args[0].value).to.equal('USDGBP'); await act(() => @@ -245,8 +242,8 @@ describe(' - Cell editing', () => { }); it('should set isProcessingProps to false after calling preProcessEditCellProps', async () => { - columnProps.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => props; - render(); + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => props; + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); let promise: Promise | null = null; // We want to flush updates before preProcessEditCellProps resolves @@ -263,11 +260,11 @@ describe(' - Cell editing', () => { }); it('should return false if preProcessEditCellProps sets an error', async () => { - columnProps.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: true, }); - render(); + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect( await act(() => @@ -280,13 +277,13 @@ describe(' - Cell editing', () => { ).to.equal(false); }); - it('should return false if the cell left the edit mode while calling preProcessEditCellProps', (done) => { + it('should return false if the cell left the edit mode while calling preProcessEditCellProps', async () => { let resolveCallback: () => void; - columnProps.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => new Promise((resolve) => { resolveCallback = () => resolve(props); }); - render(); + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); let promise: Promise; @@ -298,11 +295,6 @@ describe(' - Cell editing', () => { }) as Promise; }); - promise!.then((result) => { - expect(result).to.equal(false); - done(); - }); - act(() => apiRef.current.stopCellEditMode({ id: 0, @@ -312,6 +304,8 @@ describe(' - Cell editing', () => { ); resolveCallback!(); + + expect(await act(async () => promise)).to.equal(false); }); describe('with debounceMs > 0', () => { @@ -363,11 +357,11 @@ describe(' - Cell editing', () => { it('should update the row with the new value stored', async () => { render(); - act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); - await act(() => + await act(async () => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); + await act(async () => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), ); - act(() => apiRef.current.stopCellEditMode({ id: 0, field: 'currencyPair' })); + await act(async () => apiRef.current.stopCellEditMode({ id: 0, field: 'currencyPair' })); expect(getCell(0, 1).textContent).to.equal('USD GBP'); }); @@ -389,11 +383,11 @@ describe(' - Cell editing', () => { it('should do nothing if props are still being processed and ignoreModifications=false', async () => { let resolveCallback: () => void; - columnProps.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => new Promise((resolve) => { resolveCallback = () => resolve(props); }); - render(); + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); let promise: Promise; @@ -415,11 +409,11 @@ describe(' - Cell editing', () => { }); it('should do nothing if props contain error=true', async () => { - columnProps.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: true, }); - render(); + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); await act(() => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), @@ -429,12 +423,17 @@ describe(' - Cell editing', () => { }); it('should keep mode=edit if props of any column contains error=true', async () => { - columnProps.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: true, }); const onCellModesModelChange = spy(); - render(); + render( + , + ); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); await act(() => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), @@ -446,11 +445,11 @@ describe(' - Cell editing', () => { }); it('should allow a 2nd call if the first call was when error=true', async () => { - columnProps.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: props.value.length === 0, }); - render(); + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); await act(() => @@ -580,12 +579,12 @@ describe(' - Cell editing', () => { }); it('should pass the new value through the value setter before calling processRowUpdate', async () => { - columnProps.valueSetter = spy((value, row) => ({ + const valueSetter = spy((value, row) => ({ ...row, _currencyPair: value, })); const processRowUpdate = spy(() => new Promise(() => {})); - render(); + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); await act(() => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), @@ -596,13 +595,13 @@ describe(' - Cell editing', () => { currencyPair: 'USDGBP', _currencyPair: 'USD GBP', }); - expect(columnProps.valueSetter.lastCall.args[0]).to.equal('USD GBP'); - expect(columnProps.valueSetter.lastCall.args[1]).to.deep.equal(defaultData.rows[0]); + expect(valueSetter.lastCall.args[0]).to.equal('USD GBP'); + expect(valueSetter.lastCall.args[1]).to.deep.equal(defaultData.rows[0]); }); it('should move focus to the cell below when cellToFocusAfter=below', async () => { - columnProps.renderEditCell = (props: GridCellProps) => ; - render(); + const renderEditCellProp = (props: GridCellProps) => ; + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect(getCell(0, 1).querySelector('input')).toHaveFocus(); @@ -617,7 +616,7 @@ describe(' - Cell editing', () => { }); it('should move focus to the cell on the right when cellToFocusAfter=right', async () => { - columnProps.renderEditCell = (props: GridCellProps) => ; + const renderEditCellProp = (props: GridCellProps) => ; render( - Cell editing', () => { { field: 'currencyPair', editable: true }, { field: 'price1M', editable: true }, ]} + columnProps={{ renderEditCell: renderEditCellProp }} />, ); @@ -642,7 +642,7 @@ describe(' - Cell editing', () => { }); it('should move focus to the cell on the left when cellToFocusAfter=left', async () => { - columnProps.renderEditCell = (props: GridCellProps) => ; + const renderEditCellProp = (props: GridCellProps) => ; render( - Cell editing', () => { { field: 'currencyPair', editable: true }, { field: 'price1M', editable: true }, ]} + columnProps={{ renderEditCell: renderEditCellProp }} />, ); @@ -1011,8 +1012,8 @@ describe(' - Cell editing', () => { }); it('should call stopCellEditMode with ignoreModifications=false if the props are being processed', async () => { - columnProps.preProcessEditCellProps = () => new Promise(() => {}); - render(); + const preProcessEditCellProps = () => new Promise(() => {}); + render(); const spiedStopCellEditMode = spyApi(apiRef.current, 'stopCellEditMode'); fireEvent.doubleClick(getCell(0, 1)); await act( @@ -1088,8 +1089,8 @@ describe(' - Cell editing', () => { }); it('should call stopCellEditMode with ignoreModifications=false if the props are being processed', async () => { - columnProps.preProcessEditCellProps = () => new Promise(() => {}); - render(); + const preProcessEditCellProps = () => new Promise(() => {}); + render(); const spiedStopCellEditMode = spyApi(apiRef.current, 'stopCellEditMode'); const cell = getCell(0, 1); fireUserEvent.mousePress(cell); @@ -1137,8 +1138,8 @@ describe(' - Cell editing', () => { }); it('should call stopCellEditMode with ignoreModifications=false if the props are being processed', async () => { - columnProps.preProcessEditCellProps = () => new Promise(() => {}); - render(); + const preProcessEditCellProps = () => new Promise(() => {}); + render(); const spiedStopCellEditMode = spyApi(apiRef.current, 'stopCellEditMode'); const cell = getCell(0, 1); fireUserEvent.mousePress(cell); @@ -1240,11 +1241,11 @@ describe(' - Cell editing', () => { }); it('should not mutate the cellModesModel prop if props of any column contains error=true', async () => { - columnProps.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: true, }); - const { setProps } = render(); + const { setProps } = render(); const cell = getCell(0, 1); fireEvent.mouseUp(cell); fireEvent.click(cell); From 820bbd58d23161595e65283a014eee3a2a4b52c4 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 14:45:54 +0200 Subject: [PATCH 078/119] Also change rendereditcell --- .../tests/cellEditing.DataGridPro.test.tsx | 73 ++++++++++++++----- 1 file changed, 53 insertions(+), 20 deletions(-) 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 bd1f453e8ee6..3fa98b164baa 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 @@ -24,12 +24,13 @@ describe(' - Cell editing', () => { const defaultData = getBasicGridData(4, 2); - const renderEditCell = spy((() => ) as ( + const defaultRenderEditCell = (() => ) as ( props: GridRenderEditCellParams, - ) => React.ReactNode); + ) => React.ReactNode; function TestCase(props: Partial & { columnProps?: Record }) { apiRef = useGridApiRef(); + const { columnProps = {}, ...rest } = props; return (
- Cell editing', () => { {...defaultData} columns={defaultData.columns.map((column) => column.field === 'currencyPair' - ? { ...column, renderEditCell, editable: true, ...(props.columnProps ?? {}) } + ? { + ...column, + renderEditCell: defaultRenderEditCell, + editable: true, + ...columnProps, + } : column, )} - {...props} + {...rest} />
); } - afterEach(() => { - renderEditCell.resetHistory(); - }); - describe('apiRef', () => { describe('startCellEditMode', () => { it('should throw when the cell is already in edit mode', () => { @@ -68,14 +70,19 @@ describe(' - Cell editing', () => { }); it('should render the component given in renderEditCell', () => { - render(); + const renderEditCell = spy(defaultRenderEditCell); + + render(); expect(renderEditCell.callCount).to.equal(0); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect(renderEditCell.callCount).not.to.equal(0); }); it('should pass props to renderEditCell', () => { - render(); + const renderEditCell = spy(defaultRenderEditCell); + + render(); + act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect(renderEditCell.lastCall.args[0].value).to.equal('USDGBP'); expect(renderEditCell.lastCall.args[0].error).to.equal(false); @@ -83,7 +90,10 @@ describe(' - Cell editing', () => { }); it('should empty the value if deleteValue is true', () => { - render(); + const renderEditCell = spy(defaultRenderEditCell); + + render(); + act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair', deleteValue: true }), ); @@ -95,7 +105,10 @@ describe(' - Cell editing', () => { describe('setEditCellValue', () => { it('should update the value prop given to renderEditCell', async () => { - render(); + const renderEditCell = spy(defaultRenderEditCell); + + render(); + act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect(renderEditCell.lastCall.args[0].value).to.equal('USDGBP'); await act(() => @@ -109,7 +122,10 @@ describe(' - Cell editing', () => { ...row, currencyPair: value.trim(), }); - render(); + + const renderEditCell = spy(defaultRenderEditCell); + + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect(renderEditCell.lastCall.args[0].row).to.deep.equal(defaultData.rows[0]); await act(() => @@ -123,7 +139,10 @@ describe(' - Cell editing', () => { it('should pass the new value through the value parser if defined', async () => { const valueParser = spy((value) => value.toLowerCase()); - render(); + const renderEditCell = spy(defaultRenderEditCell); + + render(); + act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect(valueParser.callCount).to.equal(0); await act(() => @@ -145,7 +164,9 @@ describe(' - Cell editing', () => { it('should set isProcessingProps to true before calling preProcessEditCellProps', async () => { const preProcessEditCellProps = spy(({ props }: GridPreProcessEditCellProps) => props); - render(); + const renderEditCell = spy(defaultRenderEditCell); + + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); let promise: Promise | null = null; // We want to flush updates before preProcessEditCellProps resolves @@ -218,7 +239,9 @@ describe(' - Cell editing', () => { ...props, foo: 'bar', }); - render(); + const renderEditCell = spy(defaultRenderEditCell); + + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect(renderEditCell.lastCall.args[0].foo).to.equal(undefined); await act(() => @@ -232,7 +255,9 @@ describe(' - Cell editing', () => { ...props, value: 'foobar', }); - render(); + const renderEditCell = spy(defaultRenderEditCell); + + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect(renderEditCell.lastCall.args[0].value).to.equal('USDGBP'); await act(() => @@ -243,7 +268,9 @@ describe(' - Cell editing', () => { it('should set isProcessingProps to false after calling preProcessEditCellProps', async () => { const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => props; - render(); + const renderEditCell = spy(defaultRenderEditCell); + + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); let promise: Promise | null = null; // We want to flush updates before preProcessEditCellProps resolves @@ -312,7 +339,11 @@ describe(' - Cell editing', () => { clock.withFakeTimers(); it('should debounce multiple changes if debounceMs > 0', () => { - render(); + const renderEditCell = spy((() => ) as ( + props: GridRenderEditCellParams, + ) => React.ReactNode); + + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); expect(renderEditCell.lastCall.args[0].value).to.equal('USDGBP'); renderEditCell.resetHistory(); @@ -669,7 +700,9 @@ describe(' - Cell editing', () => { it('should run all pending value mutations before calling processRowUpdate', async () => { const processRowUpdate = spy(() => new Promise(() => {})); - render(); + const renderEditCell = spy(defaultRenderEditCell); + + render(); act(() => apiRef.current.startCellEditMode({ id: 0, field: 'currencyPair' })); await act( () => From 834249920ef8a21b42b43bef86d4fd2802220dbf Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 16:48:48 +0200 Subject: [PATCH 079/119] refactor row editing --- .../src/tests/rowEditing.DataGridPro.test.tsx | 278 +++++++++++------- 1 file changed, 170 insertions(+), 108 deletions(-) diff --git a/packages/x-data-grid-pro/src/tests/rowEditing.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/rowEditing.DataGridPro.test.tsx index fa95887bf430..599de9fe4af4 100644 --- a/packages/x-data-grid-pro/src/tests/rowEditing.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/rowEditing.DataGridPro.test.tsx @@ -34,19 +34,13 @@ describe(' - Row editing', () => { return ; } - const renderEditCell1 = spy((props: GridRenderEditCellParams) => ( + const defaultRenderEditCell = (props: GridRenderEditCellParams) => ( - )); + ); - const renderEditCell2 = spy((props: GridRenderEditCellParams) => ( - - )); - - let column1Props: any = {}; - let column2Props: any = {}; - - function TestCase(props: Partial) { + function TestCase(props: Partial & { column1Props?: any; column2Props?: any }) { apiRef = useGridApiRef(); + const { column1Props = {}, column2Props = {}, ...rest } = props; return (
- Row editing', () => { if (column.field === 'currencyPair') { return { ...column, - renderEditCell: renderEditCell1, + renderEditCell: defaultRenderEditCell, editable: true, ...column1Props, }; @@ -66,26 +60,19 @@ describe(' - Row editing', () => { if (column.field === 'price1M') { return { ...column, - renderEditCell: renderEditCell2, + renderEditCell: defaultRenderEditCell, editable: true, ...column2Props, }; } return column; })} - {...props} + {...rest} />
); } - afterEach(() => { - renderEditCell1.resetHistory(); - renderEditCell2.resetHistory(); - column1Props = {}; - column2Props = {}; - }); - describe('apiRef', () => { describe('startRowEditMode', () => { it('should throw when the row is already in edit mode', () => { @@ -113,7 +100,15 @@ describe(' - Row editing', () => { }); it('should render the components given in renderEditCell', () => { - render(); + const renderEditCell1 = spy(defaultRenderEditCell); + const renderEditCell2 = spy(defaultRenderEditCell); + + render( + , + ); expect(renderEditCell1.callCount).to.equal(0); expect(renderEditCell2.callCount).to.equal(0); act(() => apiRef.current.startRowEditMode({ id: 0 })); @@ -122,7 +117,15 @@ describe(' - Row editing', () => { }); it('should pass props to renderEditCell', () => { - render(); + const renderEditCell1 = spy(defaultRenderEditCell); + const renderEditCell2 = spy(defaultRenderEditCell); + + render( + , + ); act(() => apiRef.current.startRowEditMode({ id: 0 })); expect(renderEditCell1.lastCall.args[0].value).to.equal('USDGBP'); expect(renderEditCell1.lastCall.args[0].error).to.equal(false); @@ -133,7 +136,16 @@ describe(' - Row editing', () => { }); it('should empty the value if deleteValue is true', () => { - render(); + const renderEditCell1 = spy(defaultRenderEditCell); + const renderEditCell2 = spy(defaultRenderEditCell); + + render( + , + ); + act(() => apiRef.current.startRowEditMode({ id: 0, @@ -148,7 +160,16 @@ describe(' - Row editing', () => { describe('setEditCellValue', () => { it('should update the value prop given to renderEditCell', async () => { - render(); + const renderEditCell1 = spy(defaultRenderEditCell); + const renderEditCell2 = spy(defaultRenderEditCell); + + render( + , + ); + act(() => apiRef.current.startRowEditMode({ id: 0 })); expect(renderEditCell1.lastCall.args[0].value).to.equal('USDGBP'); await act(() => @@ -162,8 +183,15 @@ describe(' - Row editing', () => { ...row, currencyPair: value.trim(), }); - column1Props.valueSetter = valueSetter; - render(); + const renderEditCell1 = spy(defaultRenderEditCell); + const renderEditCell2 = spy(defaultRenderEditCell); + + render( + , + ); act(() => apiRef.current.startRowEditMode({ id: 0 })); expect(renderEditCell1.lastCall.args[0].row).to.deep.equal(defaultData.rows[0]); await act(() => @@ -178,15 +206,17 @@ describe(' - Row editing', () => { }); it('should pass the new value through the value parser if defined', async () => { - column1Props.valueParser = spy((value) => value.toLowerCase()); - render(); + const valueParser = spy((value) => value.toLowerCase()); + const renderEditCell = spy(defaultRenderEditCell); + + render(); act(() => apiRef.current.startRowEditMode({ id: 0 })); - expect(column1Props.valueParser.callCount).to.equal(0); + expect(valueParser.callCount).to.equal(0); await act(() => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), ); - expect(column1Props.valueParser.callCount).to.equal(1); - expect(renderEditCell1.lastCall.args[0].value).to.equal('usd gbp'); + expect(valueParser.callCount).to.equal(1); + expect(renderEditCell.lastCall.args[0].value).to.equal('usd gbp'); }); it('should return true if no preProcessEditCellProps is defined', async () => { @@ -200,8 +230,9 @@ describe(' - Row editing', () => { }); it('should set isProcessingProps to true before calling preProcessEditCellProps', async () => { - column1Props.preProcessEditCellProps = () => new Promise(() => {}); - render(); + const preProcessEditCellProps = () => new Promise(() => {}); + const renderEditCell = spy(defaultRenderEditCell); + render(); act(() => apiRef.current.startRowEditMode({ id: 0 })); await act( () => @@ -210,23 +241,24 @@ describe(' - Row editing', () => { resolve(); }), ); - expect(renderEditCell1.lastCall.args[0].isProcessingProps).to.equal(true); + expect(renderEditCell.lastCall.args[0].isProcessingProps).to.equal(true); }); it('should call all preProcessEditCellProps with the correct params', async () => { - column1Props.preProcessEditCellProps = spy( - ({ props }: GridPreProcessEditCellProps) => props, - ); - column2Props.preProcessEditCellProps = spy( - ({ props }: GridPreProcessEditCellProps) => props, + const preProcessEditCellProps1 = spy(({ props }: GridPreProcessEditCellProps) => props); + const preProcessEditCellProps2 = spy(({ props }: GridPreProcessEditCellProps) => props); + render( + , ); - render(); act(() => apiRef.current.startRowEditMode({ id: 0 })); await act(() => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), ); - const args1 = column1Props.preProcessEditCellProps.lastCall.args[0]; + const args1 = preProcessEditCellProps1.lastCall.args[0]; expect(args1.id).to.equal(0); expect(args1.row).to.deep.equal(defaultData.rows[0]); expect(args1.hasChanged).to.equal(true); @@ -237,7 +269,7 @@ describe(' - Row editing', () => { changeReason: 'setEditCellValue', }); - const args2 = column2Props.preProcessEditCellProps.lastCall.args[0]; + const args2 = preProcessEditCellProps2.lastCall.args[0]; expect(args2.id).to.equal(0); expect(args2.row).to.deep.equal(defaultData.rows[0]); expect(args2.hasChanged).to.equal(false); @@ -249,46 +281,62 @@ describe(' - Row editing', () => { }); it('should pass to renderEditCell the props returned by preProcessEditCellProps', async () => { - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const renderEditCell = spy(defaultRenderEditCell); + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, foo: 'bar', }); - render(); + render(); act(() => apiRef.current.startRowEditMode({ id: 0 })); - expect(renderEditCell1.lastCall.args[0].foo).to.equal(undefined); + expect(renderEditCell.lastCall.args[0].foo).to.equal(undefined); await act(() => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), ); - expect(renderEditCell1.lastCall.args[0].foo).to.equal('bar'); + expect(renderEditCell.lastCall.args[0].foo).to.equal('bar'); }); it('should not pass to renderEditCell the value returned by preProcessEditCellProps', async () => { - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const renderEditCell = spy(defaultRenderEditCell); + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, value: 'foobar', }); - render(); + render(); act(() => apiRef.current.startRowEditMode({ id: 0 })); - expect(renderEditCell1.lastCall.args[0].value).to.equal('USDGBP'); + expect(renderEditCell.lastCall.args[0].value).to.equal('USDGBP'); await act(() => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), ); - expect(renderEditCell1.lastCall.args[0].value).to.equal('USD GBP'); + expect(renderEditCell.lastCall.args[0].value).to.equal('USD GBP'); }); it('should set isProcessingProps to false after calling preProcessEditCellProps', async () => { let resolve1: () => void; let resolve2: () => void; - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => + const renderEditCell1 = spy(defaultRenderEditCell); + const renderEditCell2 = spy(defaultRenderEditCell); + + const preProcessEditCellProps1 = ({ props }: GridPreProcessEditCellProps) => new Promise((resolve) => { resolve1 = () => resolve(props); }); - column2Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => + const preProcessEditCellProps2 = ({ props }: GridPreProcessEditCellProps) => new Promise((resolve) => { resolve2 = () => resolve(props); }); - render(); + render( + , + ); act(() => apiRef.current.startRowEditMode({ id: 0 })); let promise: Promise; await act( @@ -312,11 +360,11 @@ describe(' - Row editing', () => { }); it('should return false if preProcessEditCellProps sets an error', async () => { - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: true, }); - render(); + render(); act(() => apiRef.current.startRowEditMode({ id: 0 })); expect( await act(() => @@ -329,13 +377,13 @@ describe(' - Row editing', () => { ).to.equal(false); }); - it('should return false if the cell left the edit mode while calling preProcessEditCellProps', (done) => { + it('should return false if the cell left the edit mode while calling preProcessEditCellProps', async () => { let resolveCallback: () => void; - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => new Promise((resolve) => { resolveCallback = () => resolve(props); }); - render(); + render(); act(() => apiRef.current.startRowEditMode({ id: 0 })); let promise: Promise; @@ -347,11 +395,6 @@ describe(' - Row editing', () => { }) as Promise; }); - promise!.then((result) => { - expect(result).to.equal(false); - done(); - }); - act(() => apiRef.current.stopRowEditMode({ id: 0, @@ -360,16 +403,20 @@ describe(' - Row editing', () => { ); resolveCallback!(); + + expect(await act(async () => promise)).to.equal(false); }); describe('with debounceMs > 0', () => { clock.withFakeTimers(); it('should debounce multiple changes if debounceMs > 0', () => { - render(); + const renderEditCell = spy(defaultRenderEditCell); + + render(); act(() => apiRef.current.startRowEditMode({ id: 0 })); - expect(renderEditCell1.lastCall.args[0].value).to.equal('USDGBP'); - renderEditCell1.resetHistory(); + expect(renderEditCell.lastCall.args[0].value).to.equal('USDGBP'); + renderEditCell.resetHistory(); act(() => { apiRef.current.setEditCellValue({ id: 0, @@ -378,7 +425,7 @@ describe(' - Row editing', () => { debounceMs: 100, }); }); - expect(renderEditCell1.callCount).to.equal(0); + expect(renderEditCell.callCount).to.equal(0); act(() => { apiRef.current.setEditCellValue({ id: 0, @@ -387,10 +434,10 @@ describe(' - Row editing', () => { debounceMs: 100, }); }); - expect(renderEditCell1.callCount).to.equal(0); + expect(renderEditCell.callCount).to.equal(0); clock.tick(100); - expect(renderEditCell1.callCount).not.to.equal(0); - expect(renderEditCell1.lastCall.args[0].value).to.equal('USD GBP'); + expect(renderEditCell.callCount).not.to.equal(0); + expect(renderEditCell.lastCall.args[0].value).to.equal('USD GBP'); }); }); }); @@ -405,11 +452,11 @@ describe(' - Row editing', () => { it('should update the row with the new value stored', async () => { render(); - act(() => apiRef.current.startRowEditMode({ id: 0 })); - await act(() => + await act(async () => apiRef.current.startRowEditMode({ id: 0 })); + await act(async () => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), ); - act(() => apiRef.current.stopRowEditMode({ id: 0 })); + await act(async () => apiRef.current.stopRowEditMode({ id: 0 })); expect(getCell(0, 1).textContent).to.equal('USD GBP'); }); @@ -425,12 +472,12 @@ describe(' - Row editing', () => { it('should do nothing if props are still being processed and ignoreModifications=false', async () => { let resolveCallback: () => void; - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => new Promise((resolve) => { resolveCallback = () => resolve(props); }); - render(); + render(); act(() => apiRef.current.startRowEditMode({ id: 0 })); let promise: Promise; @@ -453,11 +500,11 @@ describe(' - Row editing', () => { }); it('should do nothing if props of any column contains error=true', async () => { - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: true, }); - render(); + render(); act(() => apiRef.current.startRowEditMode({ id: 0 })); await act(() => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), @@ -467,12 +514,17 @@ describe(' - Row editing', () => { }); it('should keep mode=edit if props of any column contains error=true', async () => { - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: true, }); const onRowModesModelChange = spy(); - render(); + render( + , + ); act(() => apiRef.current.startRowEditMode({ id: 0 })); await act(() => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), @@ -482,11 +534,11 @@ describe(' - Row editing', () => { }); it('should allow a 2nd call if the first call was when error=true', async () => { - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: props.value.length === 0, }); - render(); + render(); act(() => apiRef.current.startRowEditMode({ id: 0 })); await act(() => @@ -612,16 +664,22 @@ describe(' - Row editing', () => { }); it('should pass the new value through all value setters before calling processRowUpdate', async () => { - column1Props.valueSetter = spy((value, row) => ({ + const valueSetter1 = spy((value, row) => ({ ...row, _currencyPair: value, })); - column2Props.valueSetter = spy((value, row) => ({ + const valueSetter2 = spy((value, row) => ({ ...row, _price1M: value, })); const processRowUpdate = spy((newRow) => newRow); - render(); + render( + , + ); act(() => apiRef.current.startRowEditMode({ id: 0 })); await act(() => apiRef.current.setEditCellValue({ id: 0, field: 'currencyPair', value: 'USD GBP' }), @@ -635,11 +693,11 @@ describe(' - Row editing', () => { price1M: 1, _price1M: 1, }); - expect(column1Props.valueSetter.lastCall.args[0]).to.equal('USD GBP'); - expect(column1Props.valueSetter.lastCall.args[1]).to.deep.equal(defaultData.rows[0]); + expect(valueSetter1.lastCall.args[0]).to.equal('USD GBP'); + expect(valueSetter1.lastCall.args[1]).to.deep.equal(defaultData.rows[0]); - expect(column2Props.valueSetter.lastCall.args[0]).to.equal(1); - expect(column2Props.valueSetter.lastCall.args[1]).to.deep.equal({ + expect(valueSetter2.lastCall.args[0]).to.equal(1); + expect(valueSetter2.lastCall.args[1]).to.deep.equal({ // Ensure that the row contains the values from the previous setter); ...defaultData.rows[0], currencyPair: 'USDGBP', @@ -727,7 +785,11 @@ describe(' - Row editing', () => { it('should run all pending value mutations before calling processRowUpdate', async () => { const processRowUpdate = spy((newRow) => newRow); - render(); + const renderEditCell = spy(defaultRenderEditCell); + + render( + , + ); act(() => apiRef.current.startRowEditMode({ id: 0 })); await act(async () => { apiRef.current.setEditCellValue({ @@ -739,7 +801,7 @@ describe(' - Row editing', () => { }); act(() => apiRef.current.stopRowEditMode({ id: 0 })); await act(() => Promise.resolve()); - expect(renderEditCell1.lastCall.args[0].value).to.equal('USD GBP'); + expect(renderEditCell.lastCall.args[0].value).to.equal('USD GBP'); expect(processRowUpdate.lastCall.args[0].currencyPair).to.equal('USD GBP'); }); }); @@ -973,11 +1035,11 @@ describe(' - Row editing', () => { }); it(`should not publish 'rowEditStop' if field has error`, async () => { - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: true, }); - render(); + render(); const listener = spy(); apiRef.current.subscribeEvent('rowEditStop', listener); const cell = getCell(0, 1); @@ -1008,8 +1070,8 @@ describe(' - Row editing', () => { }); it('should call stopRowEditMode with ignoreModifications=false if the props are being processed', async () => { - column1Props.preProcessEditCellProps = () => new Promise(() => {}); - render(); + const preProcessEditCellProps = () => new Promise(() => {}); + render(); const spiedStopRowEditMode = spyApi(apiRef.current, 'stopRowEditMode'); fireEvent.doubleClick(getCell(0, 1)); act(() => { @@ -1036,11 +1098,11 @@ describe(' - Row editing', () => { }); it(`should publish 'rowEditStop' even if field has error`, async () => { - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: true, }); - render(); + render(); const listener = spy(); apiRef.current.subscribeEvent('rowEditStop', listener); const cell = getCell(0, 1); @@ -1085,11 +1147,11 @@ describe(' - Row editing', () => { }); it(`should not publish 'rowEditStop' if field has error`, async () => { - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: true, }); - render(); + render(); const listener = spy(); apiRef.current.subscribeEvent('rowEditStop', listener); const cell = getCell(0, 1); @@ -1120,8 +1182,8 @@ describe(' - Row editing', () => { }); it('should call stopRowEditMode with ignoreModifications=false if the props are being processed', async () => { - column1Props.preProcessEditCellProps = () => new Promise(() => {}); - render(); + const preProcessEditCellProps = () => new Promise(() => {}); + render(); const spiedStopRowEditMode = spyApi(apiRef.current, 'stopRowEditMode'); const cell = getCell(0, 1); fireUserEvent.mousePress(cell); @@ -1193,8 +1255,8 @@ describe(' - Row editing', () => { }); it('should call stopRowEditMode with ignoreModifications=false if the props are being processed', async () => { - column1Props.preProcessEditCellProps = () => new Promise(() => {}); - render(); + const preProcessEditCellProps = () => new Promise(() => {}); + render(); const spiedStopRowEditMode = spyApi(apiRef.current, 'stopRowEditMode'); const cell = getCell(0, 2); fireUserEvent.mousePress(cell); @@ -1329,11 +1391,11 @@ describe(' - Row editing', () => { }); it('should not mutate the rowModesModel prop if props of any column contains error=true', async () => { - column1Props.preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ + const preProcessEditCellProps = ({ props }: GridPreProcessEditCellProps) => ({ ...props, error: true, }); - const { setProps } = render(); + const { setProps } = render(); const cell = getCell(0, 1); fireEvent.mouseUp(cell); fireEvent.click(cell); @@ -1398,10 +1460,10 @@ describe(' - Row editing', () => { ); } - column1Props.renderEditCell = (props: GridRenderEditCellParams) => ( + const renderEditCell = (props: GridRenderEditCellParams) => ( ); - render(); + render(); fireEvent.doubleClick(getCell(0, 1)); const input = screen.getByTestId('input'); expect(input).toHaveFocus(); @@ -1423,10 +1485,10 @@ describe(' - Row editing', () => { ); } - column2Props.renderEditCell = (props: GridRenderEditCellParams) => ( + const renderEditCell = (props: GridRenderEditCellParams) => ( ); - render(); + render(); fireEvent.doubleClick(getCell(0, 2)); const input = screen.getByTestId('input'); expect(input).toHaveFocus(); From 163ed7ec864f81e4bbe4081bb965c638ac94002a Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 11 Oct 2024 16:49:03 +0200 Subject: [PATCH 080/119] fix jsdom specific logic for vitest --- .../src/tests/filtering.DataGridPro.test.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/x-data-grid-pro/src/tests/filtering.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/filtering.DataGridPro.test.tsx index d50cbfd4982d..9704267dcf3c 100644 --- a/packages/x-data-grid-pro/src/tests/filtering.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/filtering.DataGridPro.test.tsx @@ -499,7 +499,9 @@ describe(' - Filter', () => { // https://github.com/testing-library/dom-testing-library/issues/820#issuecomment-726936225 const input = getSelectInput( screen.queryAllByRole('combobox', { name: 'Logic operator', hidden: true })[ - isJSDOM ? 1 : 0 // https://github.com/testing-library/dom-testing-library/issues/846 + // https://github.com/testing-library/dom-testing-library/issues/846 + // This error doesn't happen in vitest + isJSDOM && process.env.MUI_JSDOM !== 'true' ? 1 : 0 ], ); fireEvent.change(input!, { target: { value: 'or' } }); @@ -1191,8 +1193,11 @@ describe(' - Filter', () => { }, }; render(); - // For JSDom, the first hidden combo is also found which we are not interested in - const select = screen.getAllByRole('combobox', { name: 'Logic operator' })[isJSDOM ? 1 : 0]; + const select = screen.getAllByRole('combobox', { name: 'Logic operator' })[ + // For JSDom, the first hidden combo is also found which we are not interested in + // This error doesn't happen in vitest + isJSDOM && process.env.MUI_JSDOM !== 'true' ? 1 : 0 + ]; expect(select).not.to.have.class('Mui-disabled'); }); From 953059d307b7e6ccacfc352c552737eff151b91b Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Sat, 12 Oct 2024 00:14:23 +0200 Subject: [PATCH 081/119] fix issues with playwright scrollbar --- .../src/tests/columns.DataGridPro.test.tsx | 57 +++++++++++-------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx index 4eb6d41310e6..5a8c06ee402b 100644 --- a/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx @@ -165,12 +165,13 @@ describe(' - Columns', () => { fireEvent.doubleClick(separator); await microtasks(); expect(onColumnWidthChange.callCount).to.be.at.least(2); - const widthArgs = onColumnWidthChange.args.map((arg) => arg[0].width); - const isWidth114Present = widthArgs.some((width) => width === 114); - expect(isWidth114Present).to.equal(true); - const colDefWidthArgs = onColumnWidthChange.args.map((arg) => arg[0].colDef.width); - const isColDefWidth114Present = colDefWidthArgs.some((width) => width === 114); - expect(isColDefWidth114Present).to.equal(true); + const widthArgs = onColumnWidthChange.args.map((arg) => Math.round(arg[0].width)); + expect(widthArgs).to.deep.equal([120, 64]); + const colDefWidthArgs = onColumnWidthChange.args.map((arg) => + Math.round(arg[0].colDef.width), + ); + const isColDefWidth64Present = colDefWidthArgs.some((width) => width === 64); + expect(isColDefWidth64Present).to.equal(true); }); it('should not affect other cell elements that are not part of the main DataGrid instance', () => { @@ -445,52 +446,57 @@ describe(' - Columns', () => { }, { id: 1, - brand: 'Adidas', - }, - { - id: 2, brand: 'Puma', }, { - id: 3, + id: 2, brand: 'Lululemon Athletica', }, ]; - const columns = [ - { field: 'id', headerName: 'This is the ID column' }, - { field: 'brand', headerName: 'This is the brand column' }, - ]; - - const getWidths = () => { - return columns.map((_, i) => parseInt(getColumnHeaderCell(i).style.width, 10)); + const buildColumns = () => { + const columns = [ + { field: 'id', headerName: 'This is the ID column' }, + { field: 'brand', headerName: 'This is the brand column' }, + ]; + const getWidths = () => { + return columns.map((_, i) => parseInt(getColumnHeaderCell(i).style.width, 10)); + }; + return { + columns, + getWidths, + }; }; it('should work through the API', async () => { + const { columns, getWidths } = buildColumns(); render(); await apiRef.current.autosizeColumns(); await microtasks(); - expect(getWidths()).to.deep.equal([211, 233]); + expect(getWidths()).to.deep.equal([155, 177]); }); it('should work through double-clicking the separator', async () => { + const { columns, getWidths } = buildColumns(); render(); const separator = document.querySelectorAll( `.${gridClasses['columnSeparator--resizable']}`, )[1]; fireEvent.doubleClick(separator); await microtasks(); - expect(getWidths()).to.deep.equal([100, 233]); + expect(getWidths()).to.deep.equal([100, 177]); }); it('should work on mount', async () => { + const { columns, getWidths } = buildColumns(); render(); await microtasks(); /* first effect after render */ await microtasks(); /* async autosize operation */ - expect(getWidths()).to.deep.equal([211, 233]); + expect(getWidths()).to.deep.equal([155, 177]); }); describe('options', () => { const autosize = async (options: GridAutosizeOptions | undefined, widths: number[]) => { + const { columns, getWidths } = buildColumns(); render(); await apiRef.current.autosizeColumns({ includeHeaders: false, ...options }); await microtasks(); @@ -498,11 +504,11 @@ describe(' - Columns', () => { }; it('.columns works', async () => { - await autosize({ columns: [columns[0].field] }, [50, 100]); + await autosize({ columns: ['id'] }, [50, 100]); }); it('.includeHeaders works', async () => { - await autosize({ includeHeaders: true }, [211, 233]); + await autosize({ includeHeaders: true }, [155, 177]); }); it('.includeOutliers works', async () => { @@ -514,7 +520,7 @@ describe(' - Columns', () => { }); it('.expand works', async () => { - await autosize({ expand: true }, [134, 148]); + await autosize({ expand: true }, [101, 196]); }); }); }); @@ -532,6 +538,7 @@ describe(' - Columns', () => { act(() => apiRef.current.setColumnWidth('brand', 300)); expect(gridColumnLookupSelector(apiRef).brand.computedWidth).to.equal(300); + // @ts-expect-error privateApi is not defined act(() => privateApi.current.requestPipeProcessorsApplication('hydrateColumns')); expect(gridColumnLookupSelector(apiRef).brand.computedWidth).to.equal(300); }); @@ -553,6 +560,7 @@ describe(' - Columns', () => { expect(gridColumnFieldsSelector(apiRef).indexOf('brand')).to.equal(2); act(() => apiRef.current.setColumnIndex('brand', 1)); expect(gridColumnFieldsSelector(apiRef).indexOf('brand')).to.equal(1); + // @ts-expect-error privateApi is not defined act(() => privateApi.current.requestPipeProcessorsApplication('hydrateColumns')); expect(gridColumnFieldsSelector(apiRef).indexOf('brand')).to.equal(1); }); @@ -567,6 +575,7 @@ describe(' - Columns', () => { act(() => apiRef.current.updateColumns([{ field: 'id' }])); expect(gridColumnFieldsSelector(apiRef)).to.deep.equal(['__check__', 'brand', 'id']); + // @ts-expect-error privateApi is not defined act(() => privateApi.current.requestPipeProcessorsApplication('hydrateColumns')); expect(gridColumnFieldsSelector(apiRef)).to.deep.equal(['__check__', 'brand', 'id']); }); From dac3923970b165635400bd12a62b00e342e20d04 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 11:10:31 +0200 Subject: [PATCH 082/119] Revert "fix issues with playwright scrollbar" This reverts commit 953059d307b7e6ccacfc352c552737eff151b91b. --- .../src/tests/columns.DataGridPro.test.tsx | 57 ++++++++----------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx index 5a8c06ee402b..4eb6d41310e6 100644 --- a/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx @@ -165,13 +165,12 @@ describe(' - Columns', () => { fireEvent.doubleClick(separator); await microtasks(); expect(onColumnWidthChange.callCount).to.be.at.least(2); - const widthArgs = onColumnWidthChange.args.map((arg) => Math.round(arg[0].width)); - expect(widthArgs).to.deep.equal([120, 64]); - const colDefWidthArgs = onColumnWidthChange.args.map((arg) => - Math.round(arg[0].colDef.width), - ); - const isColDefWidth64Present = colDefWidthArgs.some((width) => width === 64); - expect(isColDefWidth64Present).to.equal(true); + const widthArgs = onColumnWidthChange.args.map((arg) => arg[0].width); + const isWidth114Present = widthArgs.some((width) => width === 114); + expect(isWidth114Present).to.equal(true); + const colDefWidthArgs = onColumnWidthChange.args.map((arg) => arg[0].colDef.width); + const isColDefWidth114Present = colDefWidthArgs.some((width) => width === 114); + expect(isColDefWidth114Present).to.equal(true); }); it('should not affect other cell elements that are not part of the main DataGrid instance', () => { @@ -446,57 +445,52 @@ describe(' - Columns', () => { }, { id: 1, - brand: 'Puma', + brand: 'Adidas', }, { id: 2, + brand: 'Puma', + }, + { + id: 3, brand: 'Lululemon Athletica', }, ]; - const buildColumns = () => { - const columns = [ - { field: 'id', headerName: 'This is the ID column' }, - { field: 'brand', headerName: 'This is the brand column' }, - ]; - const getWidths = () => { - return columns.map((_, i) => parseInt(getColumnHeaderCell(i).style.width, 10)); - }; - return { - columns, - getWidths, - }; + const columns = [ + { field: 'id', headerName: 'This is the ID column' }, + { field: 'brand', headerName: 'This is the brand column' }, + ]; + + const getWidths = () => { + return columns.map((_, i) => parseInt(getColumnHeaderCell(i).style.width, 10)); }; it('should work through the API', async () => { - const { columns, getWidths } = buildColumns(); render(); await apiRef.current.autosizeColumns(); await microtasks(); - expect(getWidths()).to.deep.equal([155, 177]); + expect(getWidths()).to.deep.equal([211, 233]); }); it('should work through double-clicking the separator', async () => { - const { columns, getWidths } = buildColumns(); render(); const separator = document.querySelectorAll( `.${gridClasses['columnSeparator--resizable']}`, )[1]; fireEvent.doubleClick(separator); await microtasks(); - expect(getWidths()).to.deep.equal([100, 177]); + expect(getWidths()).to.deep.equal([100, 233]); }); it('should work on mount', async () => { - const { columns, getWidths } = buildColumns(); render(); await microtasks(); /* first effect after render */ await microtasks(); /* async autosize operation */ - expect(getWidths()).to.deep.equal([155, 177]); + expect(getWidths()).to.deep.equal([211, 233]); }); describe('options', () => { const autosize = async (options: GridAutosizeOptions | undefined, widths: number[]) => { - const { columns, getWidths } = buildColumns(); render(); await apiRef.current.autosizeColumns({ includeHeaders: false, ...options }); await microtasks(); @@ -504,11 +498,11 @@ describe(' - Columns', () => { }; it('.columns works', async () => { - await autosize({ columns: ['id'] }, [50, 100]); + await autosize({ columns: [columns[0].field] }, [50, 100]); }); it('.includeHeaders works', async () => { - await autosize({ includeHeaders: true }, [155, 177]); + await autosize({ includeHeaders: true }, [211, 233]); }); it('.includeOutliers works', async () => { @@ -520,7 +514,7 @@ describe(' - Columns', () => { }); it('.expand works', async () => { - await autosize({ expand: true }, [101, 196]); + await autosize({ expand: true }, [134, 148]); }); }); }); @@ -538,7 +532,6 @@ describe(' - Columns', () => { act(() => apiRef.current.setColumnWidth('brand', 300)); expect(gridColumnLookupSelector(apiRef).brand.computedWidth).to.equal(300); - // @ts-expect-error privateApi is not defined act(() => privateApi.current.requestPipeProcessorsApplication('hydrateColumns')); expect(gridColumnLookupSelector(apiRef).brand.computedWidth).to.equal(300); }); @@ -560,7 +553,6 @@ describe(' - Columns', () => { expect(gridColumnFieldsSelector(apiRef).indexOf('brand')).to.equal(2); act(() => apiRef.current.setColumnIndex('brand', 1)); expect(gridColumnFieldsSelector(apiRef).indexOf('brand')).to.equal(1); - // @ts-expect-error privateApi is not defined act(() => privateApi.current.requestPipeProcessorsApplication('hydrateColumns')); expect(gridColumnFieldsSelector(apiRef).indexOf('brand')).to.equal(1); }); @@ -575,7 +567,6 @@ describe(' - Columns', () => { act(() => apiRef.current.updateColumns([{ field: 'id' }])); expect(gridColumnFieldsSelector(apiRef)).to.deep.equal(['__check__', 'brand', 'id']); - // @ts-expect-error privateApi is not defined act(() => privateApi.current.requestPipeProcessorsApplication('hydrateColumns')); expect(gridColumnFieldsSelector(apiRef)).to.deep.equal(['__check__', 'brand', 'id']); }); From ddc252d521e3caa6c06c14f5fd4dd2c7cf85fb9b Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 11:17:52 +0200 Subject: [PATCH 083/119] update headless config to show scrollbar --- tsconfig.json | 3 ++- vitest.workspace.ts | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index a83b65a5e4b7..3a404c675965 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -47,7 +47,8 @@ "test/*": ["./test/*"], "docs/*": ["./node_modules/@mui/monorepo/docs/*"], "docsx/*": ["./docs/*"] - } + }, + "types": ["@vitest/browser/providers/playwright"] }, "exclude": ["**/node_modules/!(@mui)/**", "**/build/**/*", "docs/export/**/*"] } diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 53c662187039..ccaccb143a96 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -34,7 +34,16 @@ export default defineWorkspace([ provider: 'playwright', headless: true, // https://playwright.dev - providerOptions: {}, + providerOptions: { + // https://playwright.dev/docs/api/class-browsertype#browsertypelaunchoptions + use: { + launchOptions: { + // Required for x-data-grid-pro tests. + // packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx + ignoreDefaultArgs: ['--hide-scrollbars'], + }, + }, + }, screenshotFailures: false, }, }, From 8d28a7b3e2c435a008d9052daa10b73c9b1b0262 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 11:31:40 +0200 Subject: [PATCH 084/119] fix static analysis --- .../x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx | 1 + .../src/AdapterMomentHijri/AdapterMomentHijri.test.tsx | 2 -- test/utils/pickers/describeHijriAdapter/testFormat.ts | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx b/packages/x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx index b8927764fb0d..a951eae3cd51 100644 --- a/packages/x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx +++ b/packages/x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx @@ -47,6 +47,7 @@ describe('useGridApiEventHandler', () => { expect(apiRef.current.subscribeEvent.callCount).to.equal(3); unmount(); + // @ts-expect-error to support mocha and vitest global.gc(); // Triggers garbage collector await sleep(50); diff --git a/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx b/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx index bcad494172d0..21961ec0146a 100644 --- a/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx +++ b/packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx @@ -25,7 +25,6 @@ describe('', () => { it('Formatting', (t = {}) => { if (process.env.MUI_BROWSER === 'true') { // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions t?.skip(); } @@ -89,7 +88,6 @@ describe('', () => { it('should have well formatted value', (t = {}) => { if (process.env.MUI_BROWSER === 'true') { // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions t?.skip(); } diff --git a/test/utils/pickers/describeHijriAdapter/testFormat.ts b/test/utils/pickers/describeHijriAdapter/testFormat.ts index 4cadf934ccfa..a3b55113dd79 100644 --- a/test/utils/pickers/describeHijriAdapter/testFormat.ts +++ b/test/utils/pickers/describeHijriAdapter/testFormat.ts @@ -5,7 +5,6 @@ export const testFormat: DescribeHijriAdapterTestSuite = ({ adapter }) => { it('should format the seconds without leading zeroes for format "s"', (t = {}) => { if (process.env.MUI_BROWSER === 'true') { // @ts-expect-error to support mocha and vitest - // eslint-disable-next-line @typescript-eslint/no-unused-expressions t?.skip(); } const date = adapter.date('2020-01-01T23:44:09.000Z')!; From 0e13811211d1a3489146bf700ee8cbb58a34bd6a Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 14:36:32 +0200 Subject: [PATCH 085/119] try different config --- vitest.workspace.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/vitest.workspace.ts b/vitest.workspace.ts index ccaccb143a96..658799170689 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -36,12 +36,10 @@ export default defineWorkspace([ // https://playwright.dev providerOptions: { // https://playwright.dev/docs/api/class-browsertype#browsertypelaunchoptions - use: { - launchOptions: { - // Required for x-data-grid-pro tests. - // packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx - ignoreDefaultArgs: ['--hide-scrollbars'], - }, + launch: { + // Required for x-data-grid-pro tests. + // packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx + ignoreDefaultArgs: ['--hide-scrollbars'], }, }, screenshotFailures: false, From d32bfe5f7ee8eeea7d502cb0eab19f59e8b9f9eb Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 16:49:34 +0200 Subject: [PATCH 086/119] use different values for vitest and karma --- .../src/tests/columns.DataGridPro.test.tsx | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx index 4eb6d41310e6..9b0b0fe9856b 100644 --- a/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx @@ -165,12 +165,14 @@ describe(' - Columns', () => { fireEvent.doubleClick(separator); await microtasks(); expect(onColumnWidthChange.callCount).to.be.at.least(2); - const widthArgs = onColumnWidthChange.args.map((arg) => arg[0].width); - const isWidth114Present = widthArgs.some((width) => width === 114); - expect(isWidth114Present).to.equal(true); + const expectedWidth = process.env.MUI_BROWSER === 'true' ? 63.71875 : 114; + expect(onColumnWidthChange.args.map((arg) => arg[0].width)).to.deep.equal([ + 120, + expectedWidth, + ]); const colDefWidthArgs = onColumnWidthChange.args.map((arg) => arg[0].colDef.width); - const isColDefWidth114Present = colDefWidthArgs.some((width) => width === 114); - expect(isColDefWidth114Present).to.equal(true); + const isCorrectColDefWidthPresent = colDefWidthArgs.some((width) => width === expectedWidth); + expect(isCorrectColDefWidthPresent).to.equal(true); }); it('should not affect other cell elements that are not part of the main DataGrid instance', () => { @@ -469,7 +471,11 @@ describe(' - Columns', () => { render(); await apiRef.current.autosizeColumns(); await microtasks(); - expect(getWidths()).to.deep.equal([211, 233]); + if (process.env.MUI_BROWSER === 'true') { + expect(getWidths()).to.deep.equal([155, 177]); + } else { + expect(getWidths()).to.deep.equal([211, 233]); + } }); it('should work through double-clicking the separator', async () => { @@ -479,14 +485,22 @@ describe(' - Columns', () => { )[1]; fireEvent.doubleClick(separator); await microtasks(); - expect(getWidths()).to.deep.equal([100, 233]); + if (process.env.MUI_BROWSER === 'true') { + expect(getWidths()).to.deep.equal([100, 177]); + } else { + expect(getWidths()).to.deep.equal([100, 233]); + } }); it('should work on mount', async () => { render(); await microtasks(); /* first effect after render */ await microtasks(); /* async autosize operation */ - expect(getWidths()).to.deep.equal([211, 233]); + if (process.env.MUI_BROWSER === 'true') { + expect(getWidths()).to.deep.equal([155, 177]); + } else { + expect(getWidths()).to.deep.equal([211, 233]); + } }); describe('options', () => { @@ -502,7 +516,10 @@ describe(' - Columns', () => { }); it('.includeHeaders works', async () => { - await autosize({ includeHeaders: true }, [211, 233]); + await autosize( + { includeHeaders: true }, + process.env.MUI_BROWSER === 'true' ? [155, 177] : [211, 233], + ); }); it('.includeOutliers works', async () => { @@ -532,6 +549,7 @@ describe(' - Columns', () => { act(() => apiRef.current.setColumnWidth('brand', 300)); expect(gridColumnLookupSelector(apiRef).brand.computedWidth).to.equal(300); + // @ts-ignore act(() => privateApi.current.requestPipeProcessorsApplication('hydrateColumns')); expect(gridColumnLookupSelector(apiRef).brand.computedWidth).to.equal(300); }); @@ -553,6 +571,7 @@ describe(' - Columns', () => { expect(gridColumnFieldsSelector(apiRef).indexOf('brand')).to.equal(2); act(() => apiRef.current.setColumnIndex('brand', 1)); expect(gridColumnFieldsSelector(apiRef).indexOf('brand')).to.equal(1); + // @ts-ignore act(() => privateApi.current.requestPipeProcessorsApplication('hydrateColumns')); expect(gridColumnFieldsSelector(apiRef).indexOf('brand')).to.equal(1); }); @@ -567,6 +586,7 @@ describe(' - Columns', () => { act(() => apiRef.current.updateColumns([{ field: 'id' }])); expect(gridColumnFieldsSelector(apiRef)).to.deep.equal(['__check__', 'brand', 'id']); + // @ts-ignore act(() => privateApi.current.requestPipeProcessorsApplication('hydrateColumns')); expect(gridColumnFieldsSelector(apiRef)).to.deep.equal(['__check__', 'brand', 'id']); }); From dd40b0efb1f0b68ee334cf08c12ff0426cc8eb1f Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 18:26:23 +0200 Subject: [PATCH 087/119] initial data-grid-premium --- .../src/tests/cellSelection.DataGridPremium.test.tsx | 10 ++++------ .../src/tests/clipboard.DataGridPremium.test.tsx | 10 ++++------ .../src/tests/columns.DataGridPremium.test.tsx | 6 ++++-- .../src/tests/rowSpanning.DataGridPremium.test.tsx | 6 ++++-- vitest.workspace.ts | 1 + 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx b/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx index 1918719266a1..debafe72ff9e 100644 --- a/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx +++ b/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx @@ -362,12 +362,10 @@ describe(' - Cell selection', () => { }); describe('Auto-scroll', () => { - before(function beforeHook() { - if (/jsdom/.test(window.navigator.userAgent)) { - // Need layouting - this.skip(); - } - }); + if (/jsdom/.test(window.navigator.userAgent)) { + // Need layouting + return; + } it('should auto-scroll when the mouse approaches the bottom edge', () => { stub(window, 'requestAnimationFrame').callsFake(() => 0); diff --git a/packages/x-data-grid-premium/src/tests/clipboard.DataGridPremium.test.tsx b/packages/x-data-grid-premium/src/tests/clipboard.DataGridPremium.test.tsx index b0c31797af37..e2f97b3594df 100644 --- a/packages/x-data-grid-premium/src/tests/clipboard.DataGridPremium.test.tsx +++ b/packages/x-data-grid-premium/src/tests/clipboard.DataGridPremium.test.tsx @@ -169,12 +169,10 @@ describe(' - Clipboard', () => { }); describe('paste', () => { - before(function beforeHook() { - if (/jsdom/.test(window.navigator.userAgent)) { - // These test are flaky in JSDOM - this.skip(); - } - }); + if (/jsdom/.test(window.navigator.userAgent)) { + // These test are flaky in JSDOM + return; + } function paste(cell: HTMLElement, pasteText: string) { const pasteEvent = new Event('paste'); diff --git a/packages/x-data-grid-premium/src/tests/columns.DataGridPremium.test.tsx b/packages/x-data-grid-premium/src/tests/columns.DataGridPremium.test.tsx index 979136dc5e7e..dea6b98750a5 100644 --- a/packages/x-data-grid-premium/src/tests/columns.DataGridPremium.test.tsx +++ b/packages/x-data-grid-premium/src/tests/columns.DataGridPremium.test.tsx @@ -11,10 +11,12 @@ describe(' - Columns', () => { describe('resizing', () => { // https://github.com/mui/mui-x/issues/10078 - it('should properly resize aggregated column', function test() { + it('should properly resize aggregated column', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } render( diff --git a/packages/x-data-grid-premium/src/tests/rowSpanning.DataGridPremium.test.tsx b/packages/x-data-grid-premium/src/tests/rowSpanning.DataGridPremium.test.tsx index 13b9eb840946..e94cf81f0627 100644 --- a/packages/x-data-grid-premium/src/tests/rowSpanning.DataGridPremium.test.tsx +++ b/packages/x-data-grid-premium/src/tests/rowSpanning.DataGridPremium.test.tsx @@ -109,9 +109,11 @@ describe(' - Row spanning', () => { } // See https://github.com/mui/mui-x/issues/14691 - it('should not throw when initializing an aggregation model', function test() { + it('should not throw when initializing an aggregation model', function test(t = {}) { if (isJSDOM) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } expect(() => render( diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 658799170689..2496eff56d3c 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -8,6 +8,7 @@ const packages = [ 'x-date-pickers-pro', 'x-data-grid', 'x-data-grid-pro', + 'x-data-grid-premium', 'x-internals', ]; From 0bba87018b7e1448be26d9e9b013b9fc3ce442f2 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 18:28:06 +0200 Subject: [PATCH 088/119] remove unnecessary cleanup --- test/setup.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/setup.ts b/test/setup.ts index 92382713464e..18c94fabce60 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -3,8 +3,6 @@ import 'test/utils/addChaiAssertions'; import 'test/utils/setupPickers'; import 'test/utils/licenseRelease'; import { generateTestLicenseKey, setupTestLicenseKey } from 'test/utils/testLicense'; -// import { unstable_resetCleanupTracking as unstable_resetCleanupTrackingDataGrid } from '@mui/x-data-grid'; -// import { unstable_resetCleanupTracking as unstable_resetCleanupTrackingDataGridPro } from '@mui/x-data-grid-pro'; // import { unstable_resetCleanupTracking as unstable_resetCleanupTrackingTreeView } from '@mui/x-tree-view'; // @ts-ignore @@ -28,8 +26,6 @@ beforeEach(() => { }); afterEach(() => { - // unstable_resetCleanupTrackingDataGrid(); - // unstable_resetCleanupTrackingDataGridPro(); // unstable_resetCleanupTrackingTreeView(); }); From f06ff48daa7e5a61b9f5a2f25e94e88c763d29fb Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 20:41:38 +0200 Subject: [PATCH 089/119] use user events --- .../cellSelection.DataGridPremium.test.tsx | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx b/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx index debafe72ff9e..482bcc7143f3 100644 --- a/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx +++ b/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx @@ -256,9 +256,9 @@ describe(' - Cell selection', () => { }); // Context: https://github.com/mui/mui-x/issues/14184 - it('should add the new cell selection range to the existing state', () => { + it('should add the new cell selection range to the existing state', async () => { const onCellSelectionModelChange = spy(); - render( + const { user } = render( - Cell selection', () => { ); // Add a new cell range to the selection - fireEvent.mouseDown(getCell(2, 0), { ctrlKey: true }); - fireEvent.mouseOver(getCell(3, 0), { ctrlKey: true }); + // fireEvent.mouseDown(getCell(2, 0), { ctrlKey: true }); + // fireEvent.mouseOver(getCell(3, 0), { ctrlKey: true }); + const isMac = window.navigator.platform.toUpperCase().indexOf('MAC') >= 0; + + await user.keyboard(isMac ? '{Meta>}' : '{Control>'); + await user.pointer([ + // touch the screen at element1 + { keys: '[MouseLeft>]', target: getCell(2, 0) }, + // move the touch pointer to element2 + { target: getCell(3, 0) }, + // release the touch pointer at the last position (element2) + { keys: '[/MouseLeft]' }, + ]); + await user.keyboard(isMac ? '{/Meta}' : '{/Control}'); expect(onCellSelectionModelChange.lastCall.args[0]).to.deep.equal({ '0': { id: true }, From 5c57167a31ce10b51a569903a08f969a04a8aeac Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 21:49:25 +0200 Subject: [PATCH 090/119] fix access --- .../src/tests/rowGrouping.DataGridPremium.test.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx b/packages/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx index 9f60eb3694cf..bc9720eaba17 100644 --- a/packages/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx +++ b/packages/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx @@ -667,7 +667,9 @@ describe(' - Row grouping', () => { />, ); expect(isGroupExpandedByDefault.callCount).to.equal(12); // Should not be called on leaves - const { childrenExpanded, ...node } = apiRef.current.state.rows.tree.A as GridGroupNode; + const { childrenExpanded, ...node } = apiRef.current.state.rows.tree[ + 'auto-generated-row-category1/Cat A' + ] as GridGroupNode; const callForNodeA = isGroupExpandedByDefault .getCalls() .find( From c264163bf5d2497bd238bcde12b3daa84f900052 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 21:53:29 +0200 Subject: [PATCH 091/119] enable treeview and skips --- .../src/TreeItem/TreeItem.test.tsx | 6 +- .../useTreeViewExpansion.test.tsx | 6 +- .../useTreeViewItems.test.tsx | 30 +++++--- .../useTreeViewKeyboardNavigation.test.tsx | 6 +- .../useTreeViewLabel.test.tsx | 72 ++++++++++++------- vitest.workspace.ts | 1 + 6 files changed, 81 insertions(+), 40 deletions(-) diff --git a/packages/x-tree-view/src/TreeItem/TreeItem.test.tsx b/packages/x-tree-view/src/TreeItem/TreeItem.test.tsx index ff89ba1e4f88..0f0bca9db64b 100644 --- a/packages/x-tree-view/src/TreeItem/TreeItem.test.tsx +++ b/packages/x-tree-view/src/TreeItem/TreeItem.test.tsx @@ -10,9 +10,11 @@ import { getFakeContextValue } from 'test/utils/tree-view/fakeContextValue'; describeTreeView<[]>('TreeItem component', ({ render, treeItemComponentName }) => { describe('ContentComponent / ContentProps props (TreeItem only)', () => { - it('should render TreeItem when itemId prop is escaping characters without throwing an error', function test() { + it('should render TreeItem when itemId prop is escaping characters without throwing an error', function test(t = {}) { if (treeItemComponentName === 'TreeItem2') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ diff --git a/packages/x-tree-view/src/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.test.tsx b/packages/x-tree-view/src/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.test.tsx index 8019dcba99bb..2d1a3145a770 100644 --- a/packages/x-tree-view/src/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.test.tsx +++ b/packages/x-tree-view/src/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.test.tsx @@ -207,12 +207,14 @@ describeTreeView<[UseTreeViewExpansionSignature]>( expect(view.isItemExpanded('1')).to.equal(true); }); - it('should be able to limit the expansion to the icon', function test() { + it('should be able to limit the expansion to the icon', function test(t = {}) { // This test is not relevant for the TreeItem component. // We could create the equivalent test for it, // but it's not worth the effort given the complexity of the old behavior override. if (!setup.includes('TreeItem2')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const CustomTreeItem = React.forwardRef(function MyTreeItem( diff --git a/packages/x-tree-view/src/internals/plugins/useTreeViewItems/useTreeViewItems.test.tsx b/packages/x-tree-view/src/internals/plugins/useTreeViewItems/useTreeViewItems.test.tsx index 1fda8500521e..4e94f276478d 100644 --- a/packages/x-tree-view/src/internals/plugins/useTreeViewItems/useTreeViewItems.test.tsx +++ b/packages/x-tree-view/src/internals/plugins/useTreeViewItems/useTreeViewItems.test.tsx @@ -14,12 +14,14 @@ describeTreeView< >( 'useTreeViewItems plugin', ({ render, renderFromJSX, treeViewComponentName, TreeViewComponent, TreeItemComponent }) => { - it('should throw an error when two items have the same ID', function test() { + it('should throw an error when two items have the same ID', function test(t = {}) { // TODO is this fixed? if (!/jsdom/.test(window.navigator.userAgent)) { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } expect(() => @@ -34,10 +36,12 @@ describeTreeView< ]); }); - it('should be able to use a custom id attribute', function test() { + it('should be able to use a custom id attribute', function test(t = {}) { // For now, only SimpleTreeView can use custom id attributes if (treeViewComponentName.startsWith('RichTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ @@ -107,9 +111,11 @@ describeTreeView< expect(view.getItemRoot('1')).not.to.have.attribute('aria-expanded'); }); - it('should mark an item as not expandable if it has only empty conditional arrays', function test() { + it('should mark an item as not expandable if it has only empty conditional arrays', function test(t = {}) { if (treeViewComponentName.startsWith('RichTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = renderFromJSX( @@ -124,9 +130,11 @@ describeTreeView< expect(view.isItemExpanded('1')).to.equal(false); }); - it('should mark an item as expandable if it has two array as children, one of which is empty (SimpleTreeView only)', function test() { + it('should mark an item as expandable if it has two array as children, one of which is empty (SimpleTreeView only)', function test(t = {}) { if (treeViewComponentName.startsWith('RichTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = renderFromJSX( @@ -141,9 +149,11 @@ describeTreeView< expect(view.isItemExpanded('1')).to.equal(true); }); - it('should mark an item as not expandable if it has one array containing an empty array as a children (SimpleTreeView only)', function test() { + it('should mark an item as not expandable if it has one array containing an empty array as a children (SimpleTreeView only)', function test(t = {}) { if (treeViewComponentName.startsWith('RichTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = renderFromJSX( diff --git a/packages/x-tree-view/src/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.test.tsx b/packages/x-tree-view/src/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.test.tsx index 7dab02bcf8b2..a6b957c6df48 100644 --- a/packages/x-tree-view/src/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.test.tsx +++ b/packages/x-tree-view/src/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.test.tsx @@ -1157,10 +1157,12 @@ describeTreeView< expect(view.getFocusedItemId()).to.equal('1'); }); - it('should work with ReactElement label', function test() { + it('should work with ReactElement label', function test(t = {}) { // Only the SimpleTreeView can have React Element labels. if (treeViewComponentName !== 'SimpleTreeView') { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ diff --git a/packages/x-tree-view/src/internals/plugins/useTreeViewLabel/useTreeViewLabel.test.tsx b/packages/x-tree-view/src/internals/plugins/useTreeViewLabel/useTreeViewLabel.test.tsx index 375cc7a066a1..7b0e03dd5be3 100644 --- a/packages/x-tree-view/src/internals/plugins/useTreeViewLabel/useTreeViewLabel.test.tsx +++ b/packages/x-tree-view/src/internals/plugins/useTreeViewLabel/useTreeViewLabel.test.tsx @@ -8,10 +8,12 @@ describeTreeView<[UseTreeViewLabelSignature]>( ({ render, treeViewComponentName }) => { describe('interaction', () => { describe('render labelInput when needed', () => { - it('should not render labelInput when double clicked if item is not editable', function test() { + it('should not render labelInput when double clicked if item is not editable', function test(t = {}) { // This test is not relevant for the TreeItem component or the SimpleTreeView. if (treeViewComponentName.startsWith('SimpleTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ experimentalFeatures: { labelEditing: true }, @@ -26,10 +28,12 @@ describeTreeView<[UseTreeViewLabelSignature]>( expect(view.getItemLabelInput('1')).to.equal(null); }); - it('should render labelInput when double clicked if item is editable', function test() { + it('should render labelInput when double clicked if item is editable', function test(t = {}) { // This test is not relevant for the TreeItem component or the SimpleTreeView. if (treeViewComponentName.startsWith('SimpleTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ experimentalFeatures: { labelEditing: true }, @@ -44,10 +48,12 @@ describeTreeView<[UseTreeViewLabelSignature]>( expect(view.getItemLabelInput('1')).not.to.equal(null); }); - it('should not render label when double clicked if item is editable', function test() { + it('should not render label when double clicked if item is editable', function test(t = {}) { // This test is not relevant for the TreeItem component or the SimpleTreeView. if (treeViewComponentName.startsWith('SimpleTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ experimentalFeatures: { labelEditing: true }, @@ -62,10 +68,12 @@ describeTreeView<[UseTreeViewLabelSignature]>( expect(view.getItemLabel('1')).to.equal(null); }); - it('should not render labelInput on Enter if item is not editable', function test() { + it('should not render labelInput on Enter if item is not editable', function test(t = {}) { // This test is not relevant for the TreeItem component or the SimpleTreeView. if (treeViewComponentName.startsWith('SimpleTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ experimentalFeatures: { labelEditing: true }, @@ -81,10 +89,12 @@ describeTreeView<[UseTreeViewLabelSignature]>( expect(view.getItemLabel('1')).not.to.equal(null); }); - it('should render labelInput on Enter if item is editable', function test() { + it('should render labelInput on Enter if item is editable', function test(t = {}) { // This test is not relevant for the TreeItem component or the SimpleTreeView. if (treeViewComponentName.startsWith('SimpleTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ experimentalFeatures: { labelEditing: true }, @@ -99,10 +109,12 @@ describeTreeView<[UseTreeViewLabelSignature]>( expect(view.getItemLabelInput('1')).not.to.equal(null); }); - it('should unmount labelInput after save', function test() { + it('should unmount labelInput after save', function test(t = {}) { // This test is not relevant for the TreeItem component or the SimpleTreeView. if (treeViewComponentName.startsWith('SimpleTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ experimentalFeatures: { labelEditing: true }, @@ -119,10 +131,12 @@ describeTreeView<[UseTreeViewLabelSignature]>( expect(view.getItemLabel('1')).not.to.equal(null); }); - it('should unmount labelInput after cancel', function test() { + it('should unmount labelInput after cancel', function test(t = {}) { // This test is not relevant for the TreeItem component or the SimpleTreeView. if (treeViewComponentName.startsWith('SimpleTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ experimentalFeatures: { labelEditing: true }, @@ -141,10 +155,12 @@ describeTreeView<[UseTreeViewLabelSignature]>( }); describe('labelInput value', () => { - it('should equal label value on first render', function test() { + it('should equal label value on first render', function test(t = {}) { // This test is not relevant for the TreeItem component or the SimpleTreeView. if (treeViewComponentName.startsWith('SimpleTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ experimentalFeatures: { labelEditing: true }, @@ -159,10 +175,12 @@ describeTreeView<[UseTreeViewLabelSignature]>( expect(view.getItemLabelInput('1').value).to.equal('test'); }); - it('should save new value on Enter', function test() { + it('should save new value on Enter', function test(t = {}) { // This test is not relevant for the TreeItem component or the SimpleTreeView. if (treeViewComponentName.startsWith('SimpleTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ experimentalFeatures: { labelEditing: true }, @@ -179,10 +197,12 @@ describeTreeView<[UseTreeViewLabelSignature]>( expect(view.getItemLabel('1').textContent).to.equal('new value'); }); - it('should hold new value on render after save', function test() { + it('should hold new value on render after save', function test(t = {}) { // This test is not relevant for the TreeItem component or the SimpleTreeView. if (treeViewComponentName.startsWith('SimpleTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ experimentalFeatures: { labelEditing: true }, @@ -200,10 +220,12 @@ describeTreeView<[UseTreeViewLabelSignature]>( expect(view.getItemLabelInput('1').value).to.equal('new value'); }); - it('should hold initial value on render after cancel', function test() { + it('should hold initial value on render after cancel', function test(t = {}) { // This test is not relevant for the TreeItem component or the SimpleTreeView. if (treeViewComponentName.startsWith('SimpleTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ experimentalFeatures: { labelEditing: true }, @@ -224,10 +246,12 @@ describeTreeView<[UseTreeViewLabelSignature]>( }); }); describe('updateItemLabel api method', () => { - it('should change the label value', function test() { + it('should change the label value', function test(t = {}) { // This test is not relevant for the TreeItem component or the SimpleTreeView. if (treeViewComponentName.startsWith('SimpleTreeView')) { - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const view = render({ items: [{ id: '1', label: 'test' }], diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 2496eff56d3c..3be6b8dc6fd4 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -9,6 +9,7 @@ const packages = [ 'x-data-grid', 'x-data-grid-pro', 'x-data-grid-premium', + 'x-tree-view', 'x-internals', ]; From a1feb9bce78f3d1752f3d68312a825adc6352a0d Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 21:56:32 +0200 Subject: [PATCH 092/119] fix treeview --- .../plugins/useTreeViewItems/useTreeViewItems.test.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/x-tree-view/src/internals/plugins/useTreeViewItems/useTreeViewItems.test.tsx b/packages/x-tree-view/src/internals/plugins/useTreeViewItems/useTreeViewItems.test.tsx index 4e94f276478d..3c403cb373e1 100644 --- a/packages/x-tree-view/src/internals/plugins/useTreeViewItems/useTreeViewItems.test.tsx +++ b/packages/x-tree-view/src/internals/plugins/useTreeViewItems/useTreeViewItems.test.tsx @@ -32,7 +32,8 @@ describeTreeView< : []), 'MUI X: The Tree View component requires all items to have a unique `id` property.', 'MUI X: The Tree View component requires all items to have a unique `id` property.', - `The above error occurred in the component`, + // Vitest error message adds a 2 at the end of the component name + `The above error occurred in the Date: Mon, 14 Oct 2024 21:57:50 +0200 Subject: [PATCH 093/119] enable treeview pro --- vitest.workspace.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 3be6b8dc6fd4..2eb3e68d8b0f 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -10,6 +10,7 @@ const packages = [ 'x-data-grid-pro', 'x-data-grid-premium', 'x-tree-view', + 'x-tree-view-pro', 'x-internals', ]; From 8757aa4f784e6a70689ce80a82a16228948b2e2c Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 21:58:35 +0200 Subject: [PATCH 094/119] rename setup file --- test/{setup.ts => setupVitest.ts} | 0 vitest.config.mts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename test/{setup.ts => setupVitest.ts} (100%) diff --git a/test/setup.ts b/test/setupVitest.ts similarity index 100% rename from test/setup.ts rename to test/setupVitest.ts diff --git a/vitest.config.mts b/vitest.config.mts index 839c1e24df4d..7d14def36cca 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -34,7 +34,7 @@ export default defineConfig({ }, test: { globals: true, - setupFiles: ['test/setup.ts'], + setupFiles: ['test/setupVitest.ts'], // Required for some datepickers tests that contain early returns. passWithNoTests: true, sequence: { From 9799824d06e79fa04b8afbb02854a5c0d7b47948 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 22:05:44 +0200 Subject: [PATCH 095/119] update mui-internals and dedupe --- package.json | 2 +- pnpm-lock.yaml | 56 +++++++++++++++++++++++++------------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 0a2fd76267c2..3adb6628e02c 100644 --- a/package.json +++ b/package.json @@ -206,7 +206,7 @@ "@types/node": "^20.16.10", "@playwright/test": "1.44.1", "playwright": "1.44.1", - "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils" + "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils" }, "packageManager": "pnpm@9.12.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 163af6434c24..09ea1b096f56 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,7 +9,7 @@ overrides: '@types/node': ^20.16.10 '@playwright/test': 1.44.1 playwright: 1.44.1 - '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils + '@mui/internal-test-utils': https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils patchedDependencies: babel-plugin-replace-imports@1.0.2: @@ -96,8 +96,8 @@ importers: specifier: ^1.0.15 version: 1.0.15 '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -780,8 +780,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1024,8 +1024,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1136,8 +1136,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1198,8 +1198,8 @@ importers: version: 5.1.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1251,8 +1251,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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1346,8 +1346,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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1393,8 +1393,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.25.7)(@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: ^6.0.1 version: 6.0.1 @@ -1413,8 +1413,8 @@ importers: version: 18.3.1 devDependencies: '@mui/internal-test-utils': - specifier: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.25.7)(@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: ^6.0.1 version: 6.0.1 @@ -1457,8 +1457,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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -1516,8 +1516,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: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils - version: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils + version: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.25.7)(@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) @@ -3175,9 +3175,9 @@ packages: '@mui/internal-scripts@1.0.22': resolution: {integrity: sha512-+GEmp73U9o2touhiMRNO+hv8AlYWwVpu6ZjKLnZ3OLoYq5kg0e2p8GMpHTBTmalNKXXM3kOchgs0NYoYJwsX4g==} - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils': - resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils} - version: 1.0.15 + '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils': + resolution: {tarball: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils} + version: 1.0.16 peerDependencies: react: ^18.2.0 react-dom: ^18.2.0 @@ -12242,7 +12242,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/b67121a7/@mui/internal-test-utils(@babel/core@7.25.7)(@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@https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.25.7)(@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.25.7(@babel/core@7.25.7) '@babel/preset-typescript': 7.25.7(@babel/core@7.25.7) @@ -20445,7 +20445,7 @@ snapshots: dependencies: '@vitest/expect': 2.1.2 '@vitest/mocker': 2.1.2(@vitest/spy@2.1.2)(msw@2.4.4(typescript@5.6.3))(vite@5.3.4(@types/node@20.16.11)(terser@5.27.0)) - '@vitest/pretty-format': 2.1.2 + '@vitest/pretty-format': 2.1.3 '@vitest/runner': 2.1.2 '@vitest/snapshot': 2.1.2 '@vitest/spy': 2.1.2 From ed6dbb8f3d9cc4a44db74b83b319d79cfe9f82c7 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 22:17:07 +0200 Subject: [PATCH 096/119] fix tests --- .../src/context/AnimationProvider/useSkipAnimation.test.tsx | 6 ++++-- .../src/tests/cellSelection.DataGridPremium.test.tsx | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/x-charts/src/context/AnimationProvider/useSkipAnimation.test.tsx b/packages/x-charts/src/context/AnimationProvider/useSkipAnimation.test.tsx index 997cdbd30429..290570d93765 100644 --- a/packages/x-charts/src/context/AnimationProvider/useSkipAnimation.test.tsx +++ b/packages/x-charts/src/context/AnimationProvider/useSkipAnimation.test.tsx @@ -28,11 +28,13 @@ describe('useSkipAnimation', () => { window.matchMedia = oldMatchMedia; }); - it('should throw an error when parent context not present', function test() { + it('should throw an error when parent context not present', function test(t = {}) { if (!/jsdom/.test(window.navigator.userAgent)) { // can't catch render errors in the browser for unknown reason // tried try-catch + error boundary + window onError preventDefault - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const errorRef = React.createRef(); diff --git a/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx b/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx index 482bcc7143f3..3179db750328 100644 --- a/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx +++ b/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx @@ -270,7 +270,7 @@ describe(' - Cell selection', () => { // fireEvent.mouseOver(getCell(3, 0), { ctrlKey: true }); const isMac = window.navigator.platform.toUpperCase().indexOf('MAC') >= 0; - await user.keyboard(isMac ? '{Meta>}' : '{Control>'); + await user.keyboard(isMac ? '{Meta>}' : '{Control>}'); await user.pointer([ // touch the screen at element1 { keys: '[MouseLeft>]', target: getCell(2, 0) }, From 7c62bfc31efc42faf203fe150102e03db352cc14 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 14 Oct 2024 23:02:39 +0200 Subject: [PATCH 097/119] update comments --- .../src/tests/cellSelection.DataGridPremium.test.tsx | 2 -- test/setupVitest.ts | 5 ----- vitest.config.mts | 3 ++- vitest.workspace.ts | 1 - 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx b/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx index 3179db750328..f64b875cd53a 100644 --- a/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx +++ b/packages/x-data-grid-premium/src/tests/cellSelection.DataGridPremium.test.tsx @@ -266,8 +266,6 @@ describe(' - Cell selection', () => { ); // Add a new cell range to the selection - // fireEvent.mouseDown(getCell(2, 0), { ctrlKey: true }); - // fireEvent.mouseOver(getCell(3, 0), { ctrlKey: true }); const isMac = window.navigator.platform.toUpperCase().indexOf('MAC') >= 0; await user.keyboard(isMac ? '{Meta>}' : '{Control>}'); diff --git a/test/setupVitest.ts b/test/setupVitest.ts index 18c94fabce60..3df2109ece64 100644 --- a/test/setupVitest.ts +++ b/test/setupVitest.ts @@ -3,7 +3,6 @@ import 'test/utils/addChaiAssertions'; import 'test/utils/setupPickers'; import 'test/utils/licenseRelease'; import { generateTestLicenseKey, setupTestLicenseKey } from 'test/utils/testLicense'; -// import { unstable_resetCleanupTracking as unstable_resetCleanupTrackingTreeView } from '@mui/x-tree-view'; // @ts-ignore globalThis.before = beforeAll; @@ -25,10 +24,6 @@ beforeEach(() => { setupTestLicenseKey(licenseKey); }); -afterEach(() => { - // unstable_resetCleanupTrackingTreeView(); -}); - // Only necessary when not in browser mode. if (isVitestJsdom) { class Touch { diff --git a/vitest.config.mts b/vitest.config.mts index 7d14def36cca..c7de743b6d23 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -35,7 +35,8 @@ export default defineConfig({ test: { globals: true, setupFiles: ['test/setupVitest.ts'], - // Required for some datepickers tests that contain early returns. + // Required for some tests that contain early returns. + // Should be removed once we migrate to vitest. passWithNoTests: true, sequence: { hooks: 'list', diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 2eb3e68d8b0f..d8e0bc0e818d 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -38,7 +38,6 @@ export default defineWorkspace([ headless: true, // https://playwright.dev providerOptions: { - // https://playwright.dev/docs/api/class-browsertype#browsertypelaunchoptions launch: { // Required for x-data-grid-pro tests. // packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx From 4f6b9c4bca95cd66d4f5e524643d80dae5b61740 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 15 Oct 2024 00:04:08 +0200 Subject: [PATCH 098/119] jsdom only packages --- vitest.workspace.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/vitest.workspace.ts b/vitest.workspace.ts index d8e0bc0e818d..27d138fadfec 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -11,9 +11,10 @@ const packages = [ 'x-data-grid-premium', 'x-tree-view', 'x-tree-view-pro', - 'x-internals', ]; +const jsdomOnlyPackages = ['x-license', 'x-internals']; + // Ideally we move the configuration to each package. // Currently it doesn't work because vitest doesn't detect two different configurations in the same package. // We could bypass this limitation by having a folder per configuration. Eg: `packages/x-charts/browser` & `packages/x-charts/jsdom`. @@ -67,17 +68,18 @@ export default defineWorkspace([ // Manually changing the process.env in browser tests doesn't work. // And alternative is to use `const {NODE_ENV} = process.env` in the code instead. // x-license relies on `process.env.NODE_ENV` to determine the environment. - { + // x-internals has a weird chai import issue I couldn't fix + ...jsdomOnlyPackages.map((name) => ({ extends: './vitest.config.mts', plugins: [react()], test: { - include: [`packages/x-license/src/**/*.test.?(c|m)[jt]s?(x)`], - exclude: [`packages/x-license/src/**/*.browser.test.?(c|m)[jt]s?(x)`], - name: `jsdom/x-license`, + include: [`packages/${name}}/src/**/*.test.?(c|m)[jt]s?(x)`], + exclude: [`packages/${name}}/src/**/*.browser.test.?(c|m)[jt]s?(x)`], + name: `jsdom/${name}}`, environment: 'jsdom', env: { MUI_JSDOM: 'true', }, }, - }, + })), ]); From 5442abd0f918b255a7e5255a994984883082848a Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 15 Oct 2024 11:39:58 +0200 Subject: [PATCH 099/119] setup circleci and enable coverage --- .circleci/config.yml | 36 +++++++++++ package.json | 1 + pnpm-lock.yaml | 143 +++++++++++++++++++++++++++++++++++++------ vitest.config.mts | 9 +++ 4 files changed, 169 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c1146e554f23..4bfdcd8e072d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -137,6 +137,29 @@ jobs: curl -Os https://uploader.codecov.io/latest/linux/codecov chmod +x codecov ./codecov -t ${CODECOV_TOKEN} -Z -F "$REACT_VERSION-jsdom" + + test_unit_vitest: + <<: *default-job + steps: + - checkout + - install_js + - run: + name: Tests fake browser (vitest) + command: pnpm vitest --project "jsdom/*" --coverage + - run: + name: Check coverage generated + command: | + if ! [[ -s coverage/lcov.info ]] + then + exit 1 + fi + # - run: + # name: Coverage + # command: | + # curl -Os https://uploader.codecov.io/latest/linux/codecov + # chmod +x codecov + # ./codecov -t ${CODECOV_TOKEN} -Z -F "$REACT_VERSION-jsdom" + test_lint: <<: *default-job steps: @@ -226,6 +249,19 @@ jobs: # hardcoded in karma-webpack path: /tmp/_karma_webpack_ destination: artifact-file + + test_browser_vitest: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.44.1-focal + steps: + - checkout + - install_js: + browsers: true + - run: + name: Tests real browsers (vitest) + command: pnpm vitest --project "browser/*" + test_types: <<: *default-job steps: diff --git a/package.json b/package.json index 3adb6628e02c..d6273102ea1c 100644 --- a/package.json +++ b/package.json @@ -121,6 +121,7 @@ "@typescript-eslint/parser": "^7.18.0", "@vitejs/plugin-react": "^4.3.2", "@vitest/browser": "^2.1.3", + "@vitest/coverage-v8": "^2.1.3", "autoprefixer": "^10.4.20", "axe-core": "4.10.0", "babel-loader": "^9.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 09ea1b096f56..887c174c0773 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -176,6 +176,9 @@ importers: '@vitest/browser': specifier: ^2.1.3 version: 2.1.3(@vitest/spy@2.1.3)(playwright@1.44.1)(typescript@5.6.3)(vite@5.3.4(@types/node@20.16.11)(terser@5.27.0))(vitest@2.1.3) + '@vitest/coverage-v8': + specifier: ^2.1.3 + version: 2.1.3(@vitest/browser@2.1.3)(vitest@2.1.3) autoprefixer: specifier: ^10.4.20 version: 10.4.20(postcss@8.4.47) @@ -403,7 +406,7 @@ importers: version: 2.1.3(@types/node@20.16.11)(@vitest/browser@2.1.3)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.3))(terser@5.27.0) webpack: specifier: ^5.95.0 - version: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + version: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) webpack-bundle-analyzer: specifier: ^4.10.2 version: 4.10.2 @@ -4480,6 +4483,15 @@ packages: webdriverio: optional: true + '@vitest/coverage-v8@2.1.3': + resolution: {integrity: sha512-2OJ3c7UPoFSmBZwqD2VEkUw6A/tzPF0LmW0ZZhhB8PFxuc+9IBG/FaSM+RLEenc7ljzFvGN+G0nGQoZnh7sy2A==} + peerDependencies: + '@vitest/browser': 2.1.3 + vitest: 2.1.3 + peerDependenciesMeta: + '@vitest/browser': + optional: true + '@vitest/expect@2.1.2': resolution: {integrity: sha512-FEgtlN8mIUSEAAnlvn7mP8vzaWhEaAEvhSXCqrsijM7K6QqjB11qoRZYEd4AKSCDz8p0/+yH5LzhZ47qt+EyPg==} @@ -6656,6 +6668,10 @@ packages: engines: {node: '>=16 || 14 >=14.17'} hasBin: true + glob@10.4.5: + resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} + hasBin: true + glob@11.0.0: resolution: {integrity: sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==} engines: {node: 20 || >=22} @@ -7242,10 +7258,18 @@ packages: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} + istanbul-lib-source-maps@5.0.6: + resolution: {integrity: sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==} + engines: {node: '>=10'} + istanbul-reports@3.1.6: resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} engines: {node: '>=8'} + istanbul-reports@3.1.7: + resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} + engines: {node: '>=8'} + istanbul@0.4.5: resolution: {integrity: sha512-nMtdn4hvK0HjUlzr1DrKSUY8ychprt8dzHOgY2KXsIhHu5PuQQEOTM27gV9Xblyon7aUH/TSFIjRHEODF/FRPg==} deprecated: |- @@ -7267,6 +7291,9 @@ packages: resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==} engines: {node: '>=14'} + jackspeak@3.4.3: + resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jackspeak@4.0.2: resolution: {integrity: sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==} engines: {node: 20 || >=22} @@ -7735,6 +7762,9 @@ packages: magic-string@0.30.11: resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} + magicast@0.3.5: + resolution: {integrity: sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==} + make-array@1.0.5: resolution: {integrity: sha512-sgK2SAzxT19rWU+qxKUcn6PAh/swiIiz2F8C2cZjLc1z4iwYIfdoihqFIDQ8BDzAGtWPYJ6Sr13K1j/DXynDLA==} engines: {node: '>=0.10.0'} @@ -8590,6 +8620,10 @@ packages: resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} engines: {node: '>=16 || 14 >=14.17'} + path-scurry@1.11.1: + resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} + engines: {node: '>=16 || 14 >=14.18'} + path-scurry@2.0.0: resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} engines: {node: 20 || >=22} @@ -9663,6 +9697,10 @@ packages: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} + test-exclude@7.0.1: + resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==} + engines: {node: '>=18'} + text-extensions@1.9.0: resolution: {integrity: sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==} engines: {node: '>=0.10'} @@ -13564,7 +13602,7 @@ snapshots: dependencies: '@types/node': 20.16.11 tapable: 2.2.1 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) transitivePeerDependencies: - '@swc/core' - esbuild @@ -13768,6 +13806,26 @@ snapshots: - utf-8-validate - vite + '@vitest/coverage-v8@2.1.3(@vitest/browser@2.1.3)(vitest@2.1.3)': + dependencies: + '@ampproject/remapping': 2.3.0 + '@bcoe/v8-coverage': 0.2.3 + debug: 4.3.6(supports-color@8.1.1) + istanbul-lib-coverage: 3.2.2 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 5.0.6 + istanbul-reports: 3.1.7 + magic-string: 0.30.11 + magicast: 0.3.5 + std-env: 3.7.0 + test-exclude: 7.0.1 + tinyrainbow: 1.2.0 + vitest: 2.1.3(@types/node@20.16.11)(@vitest/browser@2.1.3)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.3))(terser@5.27.0) + optionalDependencies: + '@vitest/browser': 2.1.3(@vitest/spy@2.1.3)(playwright@1.44.1)(typescript@5.6.3)(vite@5.3.4(@types/node@20.16.11)(terser@5.27.0))(vitest@2.1.3) + transitivePeerDependencies: + - supports-color + '@vitest/expect@2.1.2': dependencies: '@vitest/spy': 2.1.2 @@ -13937,19 +13995,19 @@ snapshots: '@webassemblyjs/ast': 1.12.1 '@xtuc/long': 4.2.2 - '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0)': + '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.95.0)': dependencies: - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0) - '@webpack-cli/info@2.0.2(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0)': + '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.95.0)': dependencies: - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0) - '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0)': + '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack@5.95.0)': dependencies: - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0) '@xtuc/ieee754@1.2.0': {} @@ -14319,7 +14377,7 @@ snapshots: '@babel/core': 7.25.7 find-cache-dir: 4.0.0 schema-utils: 4.2.0 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) babel-plugin-istanbul@7.0.0: dependencies: @@ -14818,7 +14876,7 @@ snapshots: dependencies: schema-utils: 4.2.0 serialize-javascript: 6.0.2 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) compression@1.7.4: dependencies: @@ -15691,7 +15749,7 @@ snapshots: lodash: 4.17.21 resolve: 2.0.0-next.5 semver: 5.7.2 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) transitivePeerDependencies: - supports-color @@ -16429,6 +16487,15 @@ snapshots: minipass: 7.1.2 path-scurry: 1.10.1 + glob@10.4.5: + dependencies: + foreground-child: 3.3.0 + jackspeak: 3.4.3 + minimatch: 9.0.4 + minipass: 7.1.2 + package-json-from-dist: 1.0.1 + path-scurry: 1.11.1 + glob@11.0.0: dependencies: foreground-child: 3.3.0 @@ -16665,7 +16732,7 @@ snapshots: pretty-error: 4.0.0 tapable: 2.2.1 optionalDependencies: - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) htmlparser2@6.1.0: dependencies: @@ -17042,11 +17109,24 @@ snapshots: transitivePeerDependencies: - supports-color + istanbul-lib-source-maps@5.0.6: + dependencies: + '@jridgewell/trace-mapping': 0.3.25 + debug: 4.3.6(supports-color@8.1.1) + istanbul-lib-coverage: 3.2.2 + transitivePeerDependencies: + - supports-color + istanbul-reports@3.1.6: dependencies: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 + istanbul-reports@3.1.7: + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.1 + istanbul@0.4.5: dependencies: abbrev: 1.0.9 @@ -17085,6 +17165,12 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jackspeak@3.4.3: + dependencies: + '@isaacs/cliui': 8.0.2 + optionalDependencies: + '@pkgjs/parseargs': 0.11.0 + jackspeak@4.0.2: dependencies: '@isaacs/cliui': 8.0.2 @@ -17363,7 +17449,7 @@ snapshots: dependencies: glob: 7.2.3 minimatch: 9.0.4 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) webpack-merge: 4.2.2 karma@6.4.4: @@ -17724,6 +17810,12 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 + magicast@0.3.5: + dependencies: + '@babel/parser': 7.25.7 + '@babel/types': 7.25.7 + source-map-js: 1.2.1 + make-array@1.0.5: {} make-dir@2.1.0: @@ -18822,6 +18914,11 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 + path-scurry@1.11.1: + dependencies: + lru-cache: 10.4.3 + minipass: 7.1.2 + path-scurry@2.0.0: dependencies: lru-cache: 11.0.1 @@ -19800,7 +19897,7 @@ snapshots: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) string-width@4.2.3: dependencies: @@ -20006,7 +20103,7 @@ snapshots: schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.27.0 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) optionalDependencies: '@swc/core': 1.7.35(@swc/helpers@0.5.5) @@ -20023,6 +20120,12 @@ snapshots: glob: 7.2.3 minimatch: 3.1.2 + test-exclude@7.0.1: + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 10.4.5 + minimatch: 9.0.4 + text-extensions@1.9.0: {} text-table@0.2.0: {} @@ -20554,9 +20657,9 @@ snapshots: webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0): dependencies: '@discoveryjs/json-ext': 0.5.7 - '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0) - '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0) - '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0) + '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4)(webpack@5.95.0) + '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4)(webpack@5.95.0) + '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4)(webpack@5.95.0) colorette: 2.0.20 commander: 10.0.1 cross-spawn: 7.0.3 @@ -20565,7 +20668,7 @@ snapshots: import-local: 3.1.0 interpret: 3.1.1 rechoir: 0.8.0 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) webpack-merge: 5.10.0 optionalDependencies: webpack-bundle-analyzer: 4.10.2 @@ -20582,7 +20685,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack@5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)): + webpack@5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4): dependencies: '@types/estree': 1.0.5 '@webassemblyjs/ast': 1.12.1 diff --git a/vitest.config.mts b/vitest.config.mts index c7de743b6d23..30d5c1f6ed6b 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -1,5 +1,8 @@ +import path from 'path'; import { defineConfig } from 'vitest/config'; +const MONOREPO_ROOT = path.resolve(__dirname, './'); + export default defineConfig({ resolve: { alias: [ @@ -38,6 +41,12 @@ export default defineConfig({ // Required for some tests that contain early returns. // Should be removed once we migrate to vitest. passWithNoTests: true, + coverage: { + provider: 'v8', + reporter: ['text', 'lcov'], + reportsDirectory: path.resolve(MONOREPO_ROOT, 'coverage'), + include: ['packages/*/src/**/*.ts', 'packages/*/src/**/*.tsx'], + }, sequence: { hooks: 'list', }, From aba0b6304e4f608bb85e1460370f336c32b0f6d8 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 15 Oct 2024 11:50:11 +0200 Subject: [PATCH 100/119] dedupe --- pnpm-lock.yaml | 76 +++++++++++++++++++------------------------------- 1 file changed, 29 insertions(+), 47 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 887c174c0773..ba30863bf594 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -406,7 +406,7 @@ importers: version: 2.1.3(@types/node@20.16.11)(@vitest/browser@2.1.3)(jsdom@24.1.3)(msw@2.4.4(typescript@5.6.3))(terser@5.27.0) webpack: specifier: ^5.95.0 - version: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + version: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) webpack-bundle-analyzer: specifier: ^4.10.2 version: 4.10.2 @@ -7262,10 +7262,6 @@ packages: resolution: {integrity: sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==} engines: {node: '>=10'} - istanbul-reports@3.1.6: - resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} - engines: {node: '>=8'} - istanbul-reports@3.1.7: resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} engines: {node: '>=8'} @@ -8616,10 +8612,6 @@ packages: path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - path-scurry@1.10.1: - resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} - engines: {node: '>=16 || 14 >=14.17'} - path-scurry@1.11.1: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} @@ -12603,7 +12595,7 @@ snapshots: '@npmcli/map-workspaces@3.0.6': dependencies: '@npmcli/name-from-folder': 2.0.0 - glob: 10.3.10 + glob: 10.4.5 minimatch: 9.0.4 read-package-json-fast: 3.0.2 @@ -12625,7 +12617,7 @@ snapshots: '@npmcli/package-json@5.2.0': dependencies: '@npmcli/git': 5.0.4 - glob: 10.3.10 + glob: 10.4.5 hosted-git-info: 7.0.2 json-parse-even-better-errors: 3.0.2 normalize-package-data: 6.0.2 @@ -13602,7 +13594,7 @@ snapshots: dependencies: '@types/node': 20.16.11 tapable: 2.2.1 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) transitivePeerDependencies: - '@swc/core' - esbuild @@ -13995,19 +13987,19 @@ snapshots: '@webassemblyjs/ast': 1.12.1 '@xtuc/long': 4.2.2 - '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.95.0)': + '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0)': dependencies: - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0) - '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.95.0)': + '@webpack-cli/info@2.0.2(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0)': dependencies: - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0) - '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack@5.95.0)': + '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0)': dependencies: - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0) '@xtuc/ieee754@1.2.0': {} @@ -14377,7 +14369,7 @@ snapshots: '@babel/core': 7.25.7 find-cache-dir: 4.0.0 schema-utils: 4.2.0 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) babel-plugin-istanbul@7.0.0: dependencies: @@ -14586,7 +14578,7 @@ snapshots: foreground-child: 2.0.0 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 - istanbul-reports: 3.1.6 + istanbul-reports: 3.1.7 rimraf: 3.0.2 test-exclude: 6.0.0 v8-to-istanbul: 9.2.0 @@ -14599,7 +14591,7 @@ snapshots: dependencies: '@npmcli/fs': 3.1.1 fs-minipass: 3.0.3 - glob: 10.3.10 + glob: 10.4.5 lru-cache: 10.4.3 minipass: 7.1.2 minipass-collect: 2.0.1 @@ -14876,7 +14868,7 @@ snapshots: dependencies: schema-utils: 4.2.0 serialize-javascript: 6.0.2 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) compression@1.7.4: dependencies: @@ -15749,7 +15741,7 @@ snapshots: lodash: 4.17.21 resolve: 2.0.0-next.5 semver: 5.7.2 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) transitivePeerDependencies: - supports-color @@ -16485,7 +16477,7 @@ snapshots: jackspeak: 2.3.6 minimatch: 9.0.4 minipass: 7.1.2 - path-scurry: 1.10.1 + path-scurry: 1.11.1 glob@10.4.5: dependencies: @@ -16535,7 +16527,7 @@ snapshots: fs.realpath: 1.0.0 minimatch: 8.0.4 minipass: 4.2.8 - path-scurry: 1.10.1 + path-scurry: 1.11.1 globals@11.12.0: {} @@ -16732,7 +16724,7 @@ snapshots: pretty-error: 4.0.0 tapable: 2.2.1 optionalDependencies: - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) htmlparser2@6.1.0: dependencies: @@ -17117,11 +17109,6 @@ snapshots: transitivePeerDependencies: - supports-color - istanbul-reports@3.1.6: - dependencies: - html-escaper: 2.0.2 - istanbul-lib-report: 3.0.1 - istanbul-reports@3.1.7: dependencies: html-escaper: 2.0.2 @@ -17449,7 +17436,7 @@ snapshots: dependencies: glob: 7.2.3 minimatch: 9.0.4 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) webpack-merge: 4.2.2 karma@6.4.4: @@ -18374,7 +18361,7 @@ snapshots: dependencies: env-paths: 2.2.1 exponential-backoff: 3.1.1 - glob: 10.3.10 + glob: 10.4.5 graceful-fs: 4.2.11 make-fetch-happen: 13.0.0 nopt: 7.2.1 @@ -18552,7 +18539,7 @@ snapshots: istanbul-lib-processinfo: 2.0.3 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 4.0.1 - istanbul-reports: 3.1.6 + istanbul-reports: 3.1.7 make-dir: 3.1.0 node-preload: 0.2.1 p-map: 3.0.0 @@ -18909,11 +18896,6 @@ snapshots: path-parse@1.0.7: {} - path-scurry@1.10.1: - dependencies: - lru-cache: 10.4.3 - minipass: 7.1.2 - path-scurry@1.11.1: dependencies: lru-cache: 10.4.3 @@ -19897,7 +19879,7 @@ snapshots: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) string-width@4.2.3: dependencies: @@ -20032,7 +20014,7 @@ snapshots: dependencies: '@jridgewell/gen-mapping': 0.3.5 commander: 4.1.1 - glob: 10.3.10 + glob: 10.4.5 lines-and-columns: 1.2.4 mz: 2.7.0 pirates: 4.0.6 @@ -20103,7 +20085,7 @@ snapshots: schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.27.0 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) optionalDependencies: '@swc/core': 1.7.35(@swc/helpers@0.5.5) @@ -20657,9 +20639,9 @@ snapshots: webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0): dependencies: '@discoveryjs/json-ext': 0.5.7 - '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4)(webpack@5.95.0) - '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4)(webpack@5.95.0) - '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4)(webpack@5.95.0) + '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0) + '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0) + '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0))(webpack@5.95.0) colorette: 2.0.20 commander: 10.0.1 cross-spawn: 7.0.3 @@ -20668,7 +20650,7 @@ snapshots: import-local: 3.1.0 interpret: 3.1.1 rechoir: 0.8.0 - webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4) + webpack: 5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)) webpack-merge: 5.10.0 optionalDependencies: webpack-bundle-analyzer: 4.10.2 @@ -20685,7 +20667,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack@5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4): + webpack@5.95.0(@swc/core@1.7.35(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack-bundle-analyzer@4.10.2)(webpack@5.95.0)): dependencies: '@types/estree': 1.0.5 '@webassemblyjs/ast': 1.12.1 From 5a930f106fa7060f425833469bb7e76ad285c13f Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 15 Oct 2024 13:00:21 +0200 Subject: [PATCH 101/119] make helper libs also testable under vitest --- .../{ => src}/tests/d3-interpolate.test.ts | 0 .../{ => src}/tests/d3-scale.test.ts | 0 vitest.config.mts | 24 ++-- vitest.workspace.ts | 113 +++++++++--------- 4 files changed, 69 insertions(+), 68 deletions(-) rename packages/x-charts-vendor/{ => src}/tests/d3-interpolate.test.ts (100%) rename packages/x-charts-vendor/{ => src}/tests/d3-scale.test.ts (100%) diff --git a/packages/x-charts-vendor/tests/d3-interpolate.test.ts b/packages/x-charts-vendor/src/tests/d3-interpolate.test.ts similarity index 100% rename from packages/x-charts-vendor/tests/d3-interpolate.test.ts rename to packages/x-charts-vendor/src/tests/d3-interpolate.test.ts diff --git a/packages/x-charts-vendor/tests/d3-scale.test.ts b/packages/x-charts-vendor/src/tests/d3-scale.test.ts similarity index 100% rename from packages/x-charts-vendor/tests/d3-scale.test.ts rename to packages/x-charts-vendor/src/tests/d3-scale.test.ts diff --git a/vitest.config.mts b/vitest.config.mts index 30d5c1f6ed6b..d09c0f8348b6 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -7,21 +7,21 @@ export default defineConfig({ resolve: { alias: [ ...[ - { lib: 'charts', plans: ['pro'] }, - { lib: 'date-pickers', plans: ['pro'] }, - { lib: 'tree-view', plans: ['pro'] }, - { lib: 'data-grid', plans: ['pro', 'premium', 'generator'] }, - { lib: 'internals' }, - { lib: 'license' }, + { lib: 'x-charts', plans: ['pro'] }, + { lib: 'x-date-pickers', plans: ['pro'] }, + { lib: 'x-tree-view', plans: ['pro'] }, + { lib: 'x-data-grid', plans: ['pro', 'premium', 'generator'] }, + { lib: 'x-internals' }, + { lib: 'x-license' }, ].flatMap((v) => { return [ { - find: `@mui/x-${v.lib}`, - replacement: new URL(`./packages/x-${v.lib}/src`, import.meta.url).pathname, + find: `@mui/${v.lib}`, + replacement: new URL(`./packages/${v.lib}/src`, import.meta.url).pathname, }, ...(v.plans ?? []).map((plan) => ({ - find: `@mui/x-${v.lib}-${plan}`, - replacement: new URL(`./packages/x-${v.lib}-${plan}/src`, import.meta.url).pathname, + find: `@mui/${v.lib}-${plan}`, + replacement: new URL(`./packages/${v.lib}-${plan}/src`, import.meta.url).pathname, })), ]; }), @@ -29,6 +29,10 @@ export default defineConfig({ find: 'test/utils', replacement: new URL('./test/utils', import.meta.url).pathname, }, + { + find: '@mui/x-charts-vendor', + replacement: new URL('./packages/x-charts-vendor', import.meta.url).pathname, + }, { find: 'moment/locale', replacement: 'moment/dist/locale', diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 27d138fadfec..98978463ebac 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -1,5 +1,5 @@ import react from '@vitejs/plugin-react'; -import { defineWorkspace } from 'vitest/config'; +import { defineWorkspace, WorkspaceProjectConfiguration } from 'vitest/config'; const packages = [ 'x-charts', @@ -13,73 +13,70 @@ const packages = [ 'x-tree-view-pro', ]; -const jsdomOnlyPackages = ['x-license', 'x-internals']; +const jsdomOnlyPackages = [ + 'x-license', + 'x-internals', + 'x-codemod', + 'x-charts-vendor', + 'eslint-plugin-material-ui', +]; + +const allPackages = [...packages, ...jsdomOnlyPackages]; // Ideally we move the configuration to each package. // Currently it doesn't work because vitest doesn't detect two different configurations in the same package. // We could bypass this limitation by having a folder per configuration. Eg: `packages/x-charts/browser` & `packages/x-charts/jsdom`. export default defineWorkspace([ - ...packages.flatMap( - (name): ReturnType => [ - { - extends: './vitest.config.mts', - plugins: [react()], - test: { - include: [`packages/${name}/src/**/*.test.?(c|m)[jt]s?(x)`], - exclude: [`packages/${name}/src/**/*.jsdom.test.?(c|m)[jt]s?(x)`], - name: `browser/${name}`, - env: { - MUI_BROWSER: 'true', - }, - browser: { - enabled: true, - name: 'chromium', - provider: 'playwright', - headless: true, - // https://playwright.dev - providerOptions: { - launch: { - // Required for x-data-grid-pro tests. - // packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx - ignoreDefaultArgs: ['--hide-scrollbars'], + ...allPackages.flatMap((name): WorkspaceProjectConfiguration[] => [ + // TODO: Decide on + // Manually changing the process.env in browser tests doesn't work. + // And alternative is to use `const {NODE_ENV} = process.env` in the code instead. + // x-license relies on `process.env.NODE_ENV` to determine the environment. + // x-internals has a weird chai import issue I couldn't fix + ...(jsdomOnlyPackages.includes(name) + ? [] + : [ + { + extends: './vitest.config.mts', + plugins: [react()], + test: { + include: [`packages/${name}/src/**/*.test.?(c|m)[jt]s?(x)`], + exclude: [`packages/${name}/src/**/*.jsdom.test.?(c|m)[jt]s?(x)`], + name: `browser/${name}`, + env: { + MUI_BROWSER: 'true', + }, + browser: { + enabled: true, + name: 'chromium', + provider: 'playwright', + headless: true, + // https://playwright.dev + providerOptions: { + launch: { + // Required for x-data-grid-pro tests. + // packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx + ignoreDefaultArgs: ['--hide-scrollbars'], + }, + }, + screenshotFailures: false, }, }, - screenshotFailures: false, }, + ]), + { + extends: './vitest.config.mts', + plugins: [react()], + test: { + include: [`packages/${name}/src/**/*.test.?(c|m)[jt]s?(x)`], + exclude: [`packages/${name}/src/**/*.browser.test.?(c|m)[jt]s?(x)`], + name: `jsdom/${name}`, + environment: 'jsdom', + env: { + MUI_JSDOM: 'true', }, }, - { - extends: './vitest.config.mts', - plugins: [react()], - test: { - include: [`packages/${name}/src/**/*.test.?(c|m)[jt]s?(x)`], - exclude: [`packages/${name}/src/**/*.browser.test.?(c|m)[jt]s?(x)`], - name: `jsdom/${name}`, - environment: 'jsdom', - env: { - MUI_JSDOM: 'true', - }, - }, - }, - ], - ), - // TODO: Decide on - // Manually changing the process.env in browser tests doesn't work. - // And alternative is to use `const {NODE_ENV} = process.env` in the code instead. - // x-license relies on `process.env.NODE_ENV` to determine the environment. - // x-internals has a weird chai import issue I couldn't fix - ...jsdomOnlyPackages.map((name) => ({ - extends: './vitest.config.mts', - plugins: [react()], - test: { - include: [`packages/${name}}/src/**/*.test.?(c|m)[jt]s?(x)`], - exclude: [`packages/${name}}/src/**/*.browser.test.?(c|m)[jt]s?(x)`], - name: `jsdom/${name}}`, - environment: 'jsdom', - env: { - MUI_JSDOM: 'true', - }, }, - })), + ]), ]); From 8066b237a470e7776cea6d85cd9d4873ee84e908 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 15 Oct 2024 13:23:39 +0200 Subject: [PATCH 102/119] fix x-charts-vendor should import from esm --- vitest.config.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vitest.config.mts b/vitest.config.mts index d09c0f8348b6..f64b90b85fe4 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -31,7 +31,7 @@ export default defineConfig({ }, { find: '@mui/x-charts-vendor', - replacement: new URL('./packages/x-charts-vendor', import.meta.url).pathname, + replacement: new URL('./packages/x-charts-vendor/es', import.meta.url).pathname, }, { find: 'moment/locale', From 98013ae364f134b5d9e53dc8addf6e24c96e0e10 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 15 Oct 2024 16:37:12 +0200 Subject: [PATCH 103/119] run coverage in vitest gha --- .github/workflows/vitest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vitest.yml b/.github/workflows/vitest.yml index 72fb915a9c17..79c97648642c 100644 --- a/.github/workflows/vitest.yml +++ b/.github/workflows/vitest.yml @@ -30,7 +30,7 @@ jobs: - name: Install Playwright Browsers run: pnpm playwright install --with-deps - name: Run Tests - run: pnpm vitest --project "jsdom/*" + run: pnpm vitest --project "jsdom/*" --coverage vitest-browser: name: Vitest Tests (browser) runs-on: ubuntu-latest From f3b6d1f1001e81ed4f3429600eaaa776046257f2 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 5 Nov 2024 15:31:40 +0100 Subject: [PATCH 104/119] add to workflow --- .circleci/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4bfdcd8e072d..fc5016d63063 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -336,6 +336,10 @@ workflows: <<: *default-context requires: - checkout + - test_unit_vitest: + <<: *default-context + requires: + - checkout - test_lint: <<: *default-context requires: @@ -348,6 +352,10 @@ workflows: <<: *default-context requires: - checkout + - test_browser_vitest: + <<: *default-context + requires: + - checkout - test_types: <<: *default-context requires: From 7cf9c6929666b5b6d9d21b911eed1ca19d921240 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 5 Nov 2024 15:33:16 +0100 Subject: [PATCH 105/119] apply glob suggestions --- .eslintrc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 319c98fb3388..f87b204e45fa 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -59,7 +59,7 @@ const RESTRICTED_TOP_LEVEL_IMPORTS = [ const buildPackageRestrictedImports = (packageName, root, allowRootImports = true) => [ { files: [`packages/${root}/src/**/*.?(c|m)[jt]s?(x)`], - excludedFiles: ['*.d.ts', '*.spec.ts', '*.spec.tsx', '**.test.tx', '**.test.tsx'], + excludedFiles: ['*.d.ts', '*.spec.*', '*.test.*'], rules: { 'no-restricted-imports': [ 'error', @@ -245,7 +245,7 @@ module.exports = { }, { files: ['packages/*/src/**/*.?(c|m)[jt]s?(x)'], - excludedFiles: ['*.d.ts', '*.spec.ts', '*.spec.tsx'], + excludedFiles: ['*.d.ts', '*.spec.*'], rules: { 'material-ui/mui-name-matches-component-name': [ 'error', From 0085b9e9adc44c5ea06fa3951ac31c77db5ea972 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 5 Nov 2024 15:54:26 +0100 Subject: [PATCH 106/119] dedupe --- pnpm-lock.yaml | 546 +++++++------------------------------------------ 1 file changed, 78 insertions(+), 468 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4bdffb3498c8..0b155e1fe410 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -172,7 +172,7 @@ importers: version: 7.18.0(eslint@8.57.1)(typescript@5.6.3) '@vitejs/plugin-react': specifier: ^4.3.2 - version: 4.3.2(vite@5.3.4(@types/node@20.17.6)(terser@5.27.0)) + version: 4.3.3(vite@5.3.4(@types/node@20.17.6)(terser@5.27.0)) '@vitest/browser': specifier: ^2.1.3 version: 2.1.3(@vitest/spy@2.1.3)(playwright@1.44.1)(typescript@5.6.3)(vite@5.3.4(@types/node@20.17.6)(terser@5.27.0))(vitest@2.1.3) @@ -1791,18 +1791,10 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/code-frame@7.25.7': - resolution: {integrity: sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==} - engines: {node: '>=6.9.0'} - '@babel/code-frame@7.26.2': resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.25.7': - resolution: {integrity: sha512-9ickoLz+hcXCeh7jrcin+/SLWm+GkxE2kTvoYyp38p4WkdFXfQJxDFGWp/YHjiKLPx06z2A7W8XKuqbReXDzsw==} - engines: {node: '>=6.9.0'} - '@babel/compat-data@7.26.2': resolution: {integrity: sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==} engines: {node: '>=6.9.0'} @@ -1811,18 +1803,10 @@ packages: resolution: {integrity: sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==} engines: {node: '>=6.9.0'} - '@babel/generator@7.25.7': - resolution: {integrity: sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==} - engines: {node: '>=6.9.0'} - '@babel/generator@7.26.2': resolution: {integrity: sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==} engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.25.7': - resolution: {integrity: sha512-4xwU8StnqnlIhhioZf1tqnVWeQ9pvH/ujS8hRfw/WOza+/a+1qv69BWNy+oY231maTCWgKWhfBU7kDpsds6zAA==} - engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.25.9': resolution: {integrity: sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==} engines: {node: '>=6.9.0'} @@ -1831,32 +1815,16 @@ packages: resolution: {integrity: sha512-C47lC7LIDCnz0h4vai/tpNOI95tCd5ZT3iBt/DBH5lXKHZsyNQv18yf1wIIg2ntiQNgmAvA+DgZ82iW8Qdym8g==} engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.25.7': - resolution: {integrity: sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==} - engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.25.9': resolution: {integrity: sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==} engines: {node: '>=6.9.0'} - '@babel/helper-create-class-features-plugin@7.25.7': - resolution: {integrity: sha512-bD4WQhbkx80mAyj/WCm4ZHcF4rDxkoLFO6ph8/5/mQ3z4vAzltQXAmbc7GvVJx5H+lk5Mi5EmbTeox5nMGCsbw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-create-class-features-plugin@7.25.9': resolution: {integrity: sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-create-regexp-features-plugin@7.25.7': - resolution: {integrity: sha512-byHhumTj/X47wJ6C6eLpK7wW/WBEcnUeb7D0FNc/jFQnQVw7DOso3Zz5u9x/zLrFVkHa89ZGDbkAa1D54NdrCQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-create-regexp-features-plugin@7.25.9': resolution: {integrity: sha512-ORPNZ3h6ZRkOyAa/SaHU+XsLZr0UQzRwuDQ0cczIA17nAzZ+85G5cVkOJIj7QavLZGSe8QXUmNFxSZzjcZF9bw==} engines: {node: '>=6.9.0'} @@ -1868,46 +1836,24 @@ packages: peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - '@babel/helper-member-expression-to-functions@7.25.7': - resolution: {integrity: sha512-O31Ssjd5K6lPbTX9AAYpSKrZmLeagt9uwschJd+Ixo6QiRyfpvgtVQp8qrDR9UNFjZ8+DO34ZkdrN+BnPXemeA==} - engines: {node: '>=6.9.0'} - '@babel/helper-member-expression-to-functions@7.25.9': resolution: {integrity: sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==} engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.25.7': - resolution: {integrity: sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==} - engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.25.9': resolution: {integrity: sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.25.7': - resolution: {integrity: sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-module-transforms@7.26.0': resolution: {integrity: sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-optimise-call-expression@7.25.7': - resolution: {integrity: sha512-VAwcwuYhv/AT+Vfr28c9y6SHzTan1ryqrydSTFGjU0uDJHw3uZ+PduI8plCLkRsDnqK2DMEDmwrOQRsK/Ykjng==} - engines: {node: '>=6.9.0'} - '@babel/helper-optimise-call-expression@7.25.9': resolution: {integrity: sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==} engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.25.7': - resolution: {integrity: sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==} - engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.25.9': resolution: {integrity: sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==} engines: {node: '>=6.9.0'} @@ -1918,54 +1864,28 @@ packages: peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-replace-supers@7.25.7': - resolution: {integrity: sha512-iy8JhqlUW9PtZkd4pHM96v6BdJ66Ba9yWSE4z0W4TvSZwLBPkyDsiIU3ENe4SmrzRBs76F7rQXTy1lYC49n6Lw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-replace-supers@7.25.9': resolution: {integrity: sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-simple-access@7.25.7': - resolution: {integrity: sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==} - engines: {node: '>=6.9.0'} - '@babel/helper-simple-access@7.25.9': resolution: {integrity: sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q==} engines: {node: '>=6.9.0'} - '@babel/helper-skip-transparent-expression-wrappers@7.25.7': - resolution: {integrity: sha512-pPbNbchZBkPMD50K0p3JGcFMNLVUCuU/ABybm/PGNj4JiHrpmNyqqCphBk4i19xXtNV0JhldQJJtbSW5aUvbyA==} - engines: {node: '>=6.9.0'} - '@babel/helper-skip-transparent-expression-wrappers@7.25.9': resolution: {integrity: sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.25.7': - resolution: {integrity: sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==} - engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.25.9': resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.25.7': - resolution: {integrity: sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==} - engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.25.9': resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.25.7': - resolution: {integrity: sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==} - engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.25.9': resolution: {integrity: sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==} engines: {node: '>=6.9.0'} @@ -1978,10 +1898,6 @@ packages: resolution: {integrity: sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.25.7': - resolution: {integrity: sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==} - engines: {node: '>=6.9.0'} - '@babel/node@7.26.0': resolution: {integrity: sha512-5ASMjh42hbnqyCOK68Q5chh1jKAqn91IswFTN+niwt4FLABhEWCT1tEuuo6mlNQ4WG/oFQLvJ71PaHAKtWtJyA==} engines: {node: '>=6.9.0'} @@ -1989,11 +1905,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/parser@7.25.7': - resolution: {integrity: sha512-aZn7ETtQsjjGG5HruveUK06cU3Hljuhd9Iojm4M8WWv3wLE6OkE5PWbDUkItmMgegmccaITudyuW5RPYrYlgWw==} - engines: {node: '>=6.0.0'} - hasBin: true - '@babel/parser@7.26.2': resolution: {integrity: sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==} engines: {node: '>=6.0.0'} @@ -2071,16 +1982,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3': - resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-optional-chaining@7.8.3': - resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-typescript@7.25.9': resolution: {integrity: sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==} engines: {node: '>=6.9.0'} @@ -2123,12 +2024,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-properties@7.25.7': - resolution: {integrity: sha512-mhyfEW4gufjIqYFo9krXHJ3ElbFLIze5IDp+wQTxoPd+mwFb1NxatNAwmv8Q8Iuxv7Zc+q8EkiMQwc9IhyGf4g==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-properties@7.25.9': resolution: {integrity: sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q==} engines: {node: '>=6.9.0'} @@ -2243,12 +2138,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-commonjs@7.25.7': - resolution: {integrity: sha512-L9Gcahi0kKFYXvweO6n0wc3ZG1ChpSFdgG+eV1WYZ3/dGbJK7vvk91FgGgak8YwRgrCuihF8tE/Xg07EkL5COg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-commonjs@7.25.9': resolution: {integrity: sha512-dwh2Ol1jWwL2MgkCzUSOvfmKElqQcuswAZypBSUsScMXvgdT8Ekq5YA6TtqpTVWH+4903NmboMuH1o9i8Rxlyg==} engines: {node: '>=6.9.0'} @@ -2279,12 +2168,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-nullish-coalescing-operator@7.25.7': - resolution: {integrity: sha512-FbuJ63/4LEL32mIxrxwYaqjJxpbzxPVQj5a+Ebrc8JICV6YX8nE53jY+K0RZT3um56GoNWgkS2BQ/uLGTjtwfw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-nullish-coalescing-operator@7.25.9': resolution: {integrity: sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog==} engines: {node: '>=6.9.0'} @@ -2315,12 +2198,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-optional-chaining@7.25.7': - resolution: {integrity: sha512-h39agClImgPWg4H8mYVAbD1qP9vClFbEjqoJmt87Zen8pjqK8FTPUwrOXAvqu5soytwxrLMd2fx2KSCp2CHcNg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-optional-chaining@7.25.9': resolution: {integrity: sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A==} engines: {node: '>=6.9.0'} @@ -2333,12 +2210,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-private-methods@7.25.7': - resolution: {integrity: sha512-KY0hh2FluNxMLwOCHbxVOKfdB5sjWG4M183885FmaqWWiGMhRZq4DQRKH6mHdEucbJnyDyYiZNwNG424RymJjA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-private-methods@7.25.9': resolution: {integrity: sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw==} engines: {node: '>=6.9.0'} @@ -2512,12 +2383,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/register@7.25.7': - resolution: {integrity: sha512-qHTd2Rhn/rKhSUwdY6+n98FmwXN+N+zxSVx3zWqRe9INyvTpv+aQ5gDV2+43ACd3VtMBzPPljbb0gZb8u5ma6Q==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/register@7.25.9': resolution: {integrity: sha512-8D43jXtGsYmEeDvm4MWHYUpWf8iiXgWYx3fW7E7Wb7Oe6FWqJPl5K6TuFW0dOwNZzEE5rjlaSJYH9JjrUKJszA==} engines: {node: '>=6.9.0'} @@ -2532,10 +2397,6 @@ packages: resolution: {integrity: sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==} engines: {node: '>=6.9.0'} - '@babel/template@7.25.7': - resolution: {integrity: sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==} - engines: {node: '>=6.9.0'} - '@babel/template@7.25.9': resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} engines: {node: '>=6.9.0'} @@ -2544,10 +2405,6 @@ packages: resolution: {integrity: sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==} engines: {node: '>=6.9.0'} - '@babel/types@7.25.7': - resolution: {integrity: sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==} - engines: {node: '>=6.9.0'} - '@babel/types@7.26.0': resolution: {integrity: sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==} engines: {node: '>=6.9.0'} @@ -4531,12 +4388,6 @@ packages: peerDependencies: vite: ^4 || ^5 - '@vitejs/plugin-react@4.3.2': - resolution: {integrity: sha512-hieu+o05v4glEBucTcKMK3dlES0OeJlD9YVOAPraVMOInBCwzumaIFiUjr4bHK7NPgnAHgiskUoceKercrN8vg==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - vite: ^4.2.0 || ^5.0.0 - '@vitejs/plugin-react@4.3.3': resolution: {integrity: sha512-NooDe9GpHGqNns1i8XDERg0Vsg5SSYRhRxxyTGogUdkdNt47jal+fbuYi+Yfq6pzRCKXyoPcWisfxE6RIM3GKA==} engines: {node: ^14.18.0 || >=16.0.0} @@ -4983,9 +4834,6 @@ packages: resolution: {integrity: sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w==} engines: {node: '>=4'} - axios@1.7.5: - resolution: {integrity: sha512-fZu86yCo+svH3uqJ/yTdQ0QHpQu5oL+/QE+QPSv6BZSkDAoky9vytxp7u5qk83OJFS3kEBcesWni9WTZAv3tSw==} - axios@1.7.7: resolution: {integrity: sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==} @@ -5769,15 +5617,6 @@ packages: supports-color: optional: true - debug@4.3.6: - resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - debug@4.3.7: resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} engines: {node: '>=6.0'} @@ -6752,10 +6591,6 @@ packages: resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} engines: {node: '>=8'} - globalthis@1.0.3: - resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} - engines: {node: '>= 0.4'} - globalthis@1.0.4: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} @@ -8135,9 +7970,6 @@ packages: ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -9802,10 +9634,6 @@ packages: resolution: {integrity: sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==} engines: {node: '>=14.14'} - to-fast-properties@2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} - to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -10633,7 +10461,7 @@ snapshots: '@argos-ci/api-client@0.7.0': dependencies: - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) openapi-fetch: 0.13.0 transitivePeerDependencies: - supports-color @@ -10644,7 +10472,7 @@ snapshots: '@argos-ci/util': 2.2.0 axios: 1.7.7(debug@4.3.7) convict: 6.2.4 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) fast-glob: 3.3.2 sharp: 0.33.5 tmp: 0.2.3 @@ -10667,19 +10495,12 @@ snapshots: '@nicolo-ribaudo/chokidar-2': 2.1.8-no-fsevents.3 chokidar: 3.6.0 - '@babel/code-frame@7.25.7': - dependencies: - '@babel/highlight': 7.25.7 - picocolors: 1.1.0 - '@babel/code-frame@7.26.2': dependencies: '@babel/helper-validator-identifier': 7.25.9 js-tokens: 4.0.0 picocolors: 1.1.0 - '@babel/compat-data@7.25.7': {} - '@babel/compat-data@7.26.2': {} '@babel/core@7.26.0': @@ -10695,20 +10516,13 @@ snapshots: '@babel/traverse': 7.25.9 '@babel/types': 7.26.0 convert-source-map: 2.0.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/generator@7.25.7': - dependencies: - '@babel/types': 7.26.0 - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - jsesc: 3.0.2 - '@babel/generator@7.26.2': dependencies: '@babel/parser': 7.26.2 @@ -10717,10 +10531,6 @@ snapshots: '@jridgewell/trace-mapping': 0.3.25 jsesc: 3.0.2 - '@babel/helper-annotate-as-pure@7.25.7': - dependencies: - '@babel/types': 7.26.0 - '@babel/helper-annotate-as-pure@7.25.9': dependencies: '@babel/types': 7.26.0 @@ -10732,14 +10542,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-compilation-targets@7.25.7': - dependencies: - '@babel/compat-data': 7.25.7 - '@babel/helper-validator-option': 7.25.7 - browserslist: 4.24.0 - lru-cache: 5.1.1 - semver: 6.3.1 - '@babel/helper-compilation-targets@7.25.9': dependencies: '@babel/compat-data': 7.26.2 @@ -10748,19 +10550,6 @@ snapshots: lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.25.7(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-member-expression-to-functions': 7.25.7 - '@babel/helper-optimise-call-expression': 7.25.7 - '@babel/helper-replace-supers': 7.25.7(@babel/core@7.26.0) - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - '@babel/traverse': 7.25.9 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - '@babel/helper-create-class-features-plugin@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -10774,13 +10563,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-create-regexp-features-plugin@7.25.7(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-annotate-as-pure': 7.25.7 - regexpu-core: 6.1.1 - semver: 6.3.1 - '@babel/helper-create-regexp-features-plugin@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -10791,21 +10573,14 @@ snapshots: '@babel/helper-define-polyfill-provider@0.6.2(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 - '@babel/helper-compilation-targets': 7.25.7 + '@babel/helper-compilation-targets': 7.25.9 '@babel/helper-plugin-utils': 7.25.9 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: - supports-color - '@babel/helper-member-expression-to-functions@7.25.7': - dependencies: - '@babel/traverse': 7.25.9 - '@babel/types': 7.26.0 - transitivePeerDependencies: - - supports-color - '@babel/helper-member-expression-to-functions@7.25.9': dependencies: '@babel/traverse': 7.25.9 @@ -10813,13 +10588,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-module-imports@7.25.7': - dependencies: - '@babel/traverse': 7.25.9 - '@babel/types': 7.26.0 - transitivePeerDependencies: - - supports-color - '@babel/helper-module-imports@7.25.9': dependencies: '@babel/traverse': 7.25.9 @@ -10827,16 +10595,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.25.7(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-module-imports': 7.25.7 - '@babel/helper-simple-access': 7.25.7 - '@babel/helper-validator-identifier': 7.25.7 - '@babel/traverse': 7.25.9 - transitivePeerDependencies: - - supports-color - '@babel/helper-module-transforms@7.26.0(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -10846,16 +10604,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-optimise-call-expression@7.25.7': - dependencies: - '@babel/types': 7.26.0 - '@babel/helper-optimise-call-expression@7.25.9': dependencies: '@babel/types': 7.26.0 - '@babel/helper-plugin-utils@7.25.7': {} - '@babel/helper-plugin-utils@7.25.9': {} '@babel/helper-remap-async-to-generator@7.25.9(@babel/core@7.26.0)': @@ -10867,15 +10619,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-replace-supers@7.25.7(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-member-expression-to-functions': 7.25.7 - '@babel/helper-optimise-call-expression': 7.25.7 - '@babel/traverse': 7.25.9 - transitivePeerDependencies: - - supports-color - '@babel/helper-replace-supers@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -10885,13 +10628,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-simple-access@7.25.7': - dependencies: - '@babel/traverse': 7.25.9 - '@babel/types': 7.26.0 - transitivePeerDependencies: - - supports-color - '@babel/helper-simple-access@7.25.9': dependencies: '@babel/traverse': 7.25.9 @@ -10899,13 +10635,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-skip-transparent-expression-wrappers@7.25.7': - dependencies: - '@babel/traverse': 7.25.9 - '@babel/types': 7.26.0 - transitivePeerDependencies: - - supports-color - '@babel/helper-skip-transparent-expression-wrappers@7.25.9': dependencies: '@babel/traverse': 7.25.9 @@ -10913,16 +10642,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-string-parser@7.25.7': {} - '@babel/helper-string-parser@7.25.9': {} - '@babel/helper-validator-identifier@7.25.7': {} - '@babel/helper-validator-identifier@7.25.9': {} - '@babel/helper-validator-option@7.25.7': {} - '@babel/helper-validator-option@7.25.9': {} '@babel/helper-wrap-function@7.25.9': @@ -10938,13 +10661,6 @@ snapshots: '@babel/template': 7.25.9 '@babel/types': 7.26.0 - '@babel/highlight@7.25.7': - dependencies: - '@babel/helper-validator-identifier': 7.25.7 - chalk: 2.4.2 - js-tokens: 4.0.0 - picocolors: 1.1.0 - '@babel/node@7.26.0(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -10955,10 +10671,6 @@ snapshots: regenerator-runtime: 0.14.1 v8flags: 3.2.0 - '@babel/parser@7.25.7': - dependencies: - '@babel/types': 7.26.0 - '@babel/parser@7.26.2': dependencies: '@babel/types': 7.26.0 @@ -11001,8 +10713,8 @@ snapshots: '@babel/plugin-proposal-private-methods@7.18.6(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.26.0) - '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 transitivePeerDependencies: - supports-color @@ -11013,12 +10725,12 @@ snapshots: '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-plugin-utils': 7.25.9 '@babel/plugin-syntax-flow@7.24.7(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-plugin-utils': 7.25.9 '@babel/plugin-syntax-import-assertions@7.26.0(@babel/core@7.26.0)': dependencies: @@ -11035,16 +10747,6 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-syntax-typescript@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -11053,7 +10755,7 @@ snapshots: '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.26.0) + '@babel/helper-create-regexp-features-plugin': 7.25.9(@babel/core@7.26.0) '@babel/helper-plugin-utils': 7.25.9 '@babel/plugin-transform-arrow-functions@7.25.9(@babel/core@7.26.0)': @@ -11089,14 +10791,6 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-class-properties@7.25.7(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.26.0) - '@babel/helper-plugin-utils': 7.25.7 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-class-properties@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -11174,7 +10868,7 @@ snapshots: '@babel/plugin-transform-flow-strip-types@7.24.7(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-plugin-utils': 7.25.9 '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.26.0) '@babel/plugin-transform-for-of@7.25.9(@babel/core@7.26.0)': @@ -11222,15 +10916,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-commonjs@7.25.7(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.26.0) - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-simple-access': 7.25.7 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-modules-commonjs@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -11269,12 +10954,6 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-nullish-coalescing-operator@7.25.7(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.26.0) - '@babel/plugin-transform-nullish-coalescing-operator@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -11305,15 +10984,6 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-optional-chaining@7.25.7(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.26.0) - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-optional-chaining@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -11327,14 +10997,6 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-private-methods@7.25.7(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.26.0) - '@babel/helper-plugin-utils': 7.25.7 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-private-methods@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -11377,12 +11039,12 @@ snapshots: '@babel/plugin-transform-react-jsx-self@7.24.7(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-plugin-utils': 7.25.9 '@babel/plugin-transform-react-jsx-source@7.24.7(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-plugin-utils': 7.25.9 '@babel/plugin-transform-react-jsx@7.25.9(@babel/core@7.26.0)': dependencies: @@ -11570,8 +11232,8 @@ snapshots: '@babel/preset-flow@7.24.7(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-validator-option': 7.25.7 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-validator-option': 7.25.9 '@babel/plugin-transform-flow-strip-types': 7.24.7(@babel/core@7.26.0) '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.26.0)': @@ -11604,15 +11266,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/register@7.25.7(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - clone-deep: 4.0.1 - find-cache-dir: 2.1.0 - make-dir: 2.1.0 - pirates: 4.0.6 - source-map-support: 0.5.21 - '@babel/register@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -11631,12 +11284,6 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 - '@babel/template@7.25.7': - dependencies: - '@babel/code-frame': 7.25.7 - '@babel/parser': 7.25.7 - '@babel/types': 7.26.0 - '@babel/template@7.25.9': dependencies: '@babel/code-frame': 7.26.2 @@ -11650,17 +11297,11 @@ snapshots: '@babel/parser': 7.26.2 '@babel/template': 7.25.9 '@babel/types': 7.26.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) globals: 11.12.0 transitivePeerDependencies: - supports-color - '@babel/types@7.25.7': - dependencies: - '@babel/helper-string-parser': 7.25.7 - '@babel/helper-validator-identifier': 7.25.7 - to-fast-properties: 2.0.0 - '@babel/types@7.26.0': dependencies: '@babel/helper-string-parser': 7.25.9 @@ -11683,7 +11324,7 @@ snapshots: '@codspeed/core@3.1.1': dependencies: - axios: 1.7.5 + axios: 1.7.7(debug@4.3.7) find-up: 6.3.0 form-data: 4.0.0 node-gyp-build: 4.8.1 @@ -11725,7 +11366,7 @@ snapshots: '@emotion/babel-plugin@11.12.0': dependencies: - '@babel/helper-module-imports': 7.25.7 + '@babel/helper-module-imports': 7.25.9 '@babel/runtime': 7.26.0 '@emotion/hash': 0.9.2 '@emotion/memoize': 0.9.0 @@ -11978,7 +11619,7 @@ snapshots: '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) espree: 9.6.1 globals: 13.24.0 ignore: 5.3.1 @@ -12055,7 +11696,7 @@ snapshots: '@humanwhocodes/config-array@0.13.0': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -12384,9 +12025,9 @@ snapshots: '@mui/internal-test-utils@https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.26.0)(@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.25.7(@babel/core@7.26.0) + '@babel/plugin-transform-modules-commonjs': 7.25.9(@babel/core@7.26.0) '@babel/preset-typescript': 7.26.0(@babel/core@7.26.0) - '@babel/register': 7.25.7(@babel/core@7.26.0) + '@babel/register': 7.25.9(@babel/core@7.26.0) '@babel/runtime': 7.26.0 '@emotion/cache': 11.13.1 '@emotion/react': 11.13.3(@types/react@18.3.4)(react@18.3.1) @@ -13272,7 +12913,7 @@ snapshots: '@types/express': 4.17.21 '@types/promise.allsettled': 1.0.6 '@types/tsscmp': 1.0.2 - axios: 1.7.5 + axios: 1.7.7(debug@4.3.7) express: 4.21.0 path-to-regexp: 8.2.0 promise.allsettled: 1.0.7 @@ -13325,7 +12966,7 @@ snapshots: '@slack/types': 2.13.0 '@types/is-stream': 1.1.0 '@types/node': 20.17.6 - axios: 1.7.5 + axios: 1.7.7(debug@4.3.7) eventemitter3: 3.1.2 form-data: 2.5.1 is-electron: 2.2.2 @@ -13399,7 +13040,7 @@ snapshots: '@testing-library/dom@10.4.0': dependencies: - '@babel/code-frame': 7.25.7 + '@babel/code-frame': 7.26.2 '@babel/runtime': 7.26.0 '@types/aria-query': 5.0.4 aria-query: 5.3.0 @@ -13411,7 +13052,7 @@ snapshots: '@testing-library/jest-dom@6.6.3': dependencies: '@adobe/css-tools': 4.4.0 - aria-query: 5.3.0 + aria-query: 5.3.2 chalk: 3.0.0 css.escape: 1.5.1 dom-accessibility-api: 0.6.3 @@ -13445,7 +13086,7 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.25.7 + '@babel/parser': 7.26.2 '@babel/types': 7.26.0 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 @@ -13457,7 +13098,7 @@ snapshots: '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.25.7 + '@babel/parser': 7.26.2 '@babel/types': 7.26.0 '@types/babel__traverse@7.20.6': @@ -13747,7 +13388,7 @@ snapshots: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.3) '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) eslint: 8.57.1 optionalDependencies: typescript: 5.6.3 @@ -13768,7 +13409,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.3) '@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.6.3) - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) eslint: 8.57.1 ts-api-utils: 1.3.0(typescript@5.6.3) optionalDependencies: @@ -13784,7 +13425,7 @@ snapshots: dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.3 @@ -13798,7 +13439,7 @@ snapshots: dependencies: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.4 @@ -13854,17 +13495,6 @@ snapshots: transitivePeerDependencies: - '@swc/helpers' - '@vitejs/plugin-react@4.3.2(vite@5.3.4(@types/node@20.17.6)(terser@5.27.0))': - dependencies: - '@babel/core': 7.26.0 - '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.26.0) - '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.26.0) - '@types/babel__core': 7.20.5 - react-refresh: 0.14.2 - vite: 5.3.4(@types/node@20.17.6)(terser@5.27.0) - transitivePeerDependencies: - - supports-color - '@vitejs/plugin-react@4.3.3(vite@5.3.4(@types/node@20.17.6)(terser@5.27.0))': dependencies: '@babel/core': 7.26.0 @@ -13901,7 +13531,7 @@ snapshots: dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 5.0.6 @@ -14109,13 +13739,13 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color agent-base@7.1.0: dependencies: - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -14410,14 +14040,6 @@ snapshots: axe-core@4.10.2: {} - axios@1.7.5: - dependencies: - follow-redirects: 1.15.6(debug@4.3.7) - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - axios@1.7.7(debug@4.3.7): dependencies: follow-redirects: 1.15.6(debug@4.3.7) @@ -14437,7 +14059,7 @@ snapshots: babel-plugin-istanbul@7.0.0: dependencies: - '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-plugin-utils': 7.25.9 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 6.0.2 @@ -14461,16 +14083,16 @@ snapshots: babel-plugin-optimize-clsx@2.6.2: dependencies: - '@babel/generator': 7.25.7 - '@babel/template': 7.25.7 - '@babel/types': 7.25.7 + '@babel/generator': 7.26.2 + '@babel/template': 7.25.9 + '@babel/types': 7.26.0 find-cache-dir: 3.3.2 lodash: 4.17.21 object-hash: 2.2.0 babel-plugin-polyfill-corejs2@0.4.10(@babel/core@7.26.0): dependencies: - '@babel/compat-data': 7.25.7 + '@babel/compat-data': 7.26.2 '@babel/core': 7.26.0 '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.26.0) semver: 6.3.1 @@ -15221,7 +14843,7 @@ snapshots: chalk: 2.4.2 commander: 2.20.3 core-js: 3.35.1 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) fast-json-patch: 3.1.1 get-stdin: 6.0.0 http-proxy-agent: 5.0.0 @@ -15309,16 +14931,12 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.3.6(supports-color@8.1.1): + debug@4.3.7(supports-color@8.1.1): dependencies: - ms: 2.1.2 + ms: 2.1.3 optionalDependencies: supports-color: 8.1.1 - debug@4.3.7: - dependencies: - ms: 2.1.3 - decamelize-keys@1.1.1: dependencies: decamelize: 1.2.0 @@ -15513,7 +15131,7 @@ snapshots: base64id: 2.0.0 cookie: 0.4.2 cors: 2.8.5 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) engine.io-parser: 5.2.1 ws: 8.11.0 transitivePeerDependencies: @@ -15569,7 +15187,7 @@ snapshots: function.prototype.name: 1.1.6 get-intrinsic: 1.2.4 get-symbol-description: 1.0.2 - globalthis: 1.0.3 + globalthis: 1.0.4 gopd: 1.0.1 has-property-descriptors: 1.0.2 has-proto: 1.0.3 @@ -15846,7 +15464,7 @@ snapshots: '@es-joy/jsdoccomment': 0.49.0 are-docs-informative: 0.0.2 comment-parser: 1.4.1 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) escape-string-regexp: 4.0.0 eslint: 8.57.1 espree: 10.1.0 @@ -15897,7 +15515,7 @@ snapshots: eslint-plugin-react-compiler@0.0.0-experimental-9ed098e-20240725(eslint@8.57.1): dependencies: '@babel/core': 7.26.0 - '@babel/parser': 7.25.7 + '@babel/parser': 7.26.2 '@babel/plugin-proposal-private-methods': 7.18.6(@babel/core@7.26.0) eslint: 8.57.1 hermes-parser: 0.20.1 @@ -15974,7 +15592,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -16315,7 +15933,7 @@ snapshots: follow-redirects@1.15.6(debug@4.3.7): optionalDependencies: - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) for-each@0.3.3: dependencies: @@ -16578,10 +16196,6 @@ snapshots: dependencies: type-fest: 0.20.2 - globalthis@1.0.3: - dependencies: - define-properties: 1.2.1 - globalthis@1.0.4: dependencies: define-properties: 1.2.1 @@ -16795,14 +16409,14 @@ snapshots: dependencies: '@tootallnate/once': 2.0.0 agent-base: 6.0.2 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -16817,14 +16431,14 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color https-proxy-agent@7.0.5: dependencies: agent-base: 7.1.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -17119,7 +16733,7 @@ snapshots: istanbul-lib-instrument@6.0.2: dependencies: '@babel/core': 7.26.0 - '@babel/parser': 7.25.7 + '@babel/parser': 7.26.2 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 7.6.3 @@ -17143,7 +16757,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -17152,7 +16766,7 @@ snapshots: istanbul-lib-source-maps@5.0.6: dependencies: '@jridgewell/trace-mapping': 0.3.25 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) istanbul-lib-coverage: 3.2.2 transitivePeerDependencies: - supports-color @@ -17242,15 +16856,15 @@ snapshots: jscodeshift@17.0.0(@babel/preset-env@7.26.0(@babel/core@7.26.0)): dependencies: '@babel/core': 7.26.0 - '@babel/parser': 7.25.7 - '@babel/plugin-transform-class-properties': 7.25.7(@babel/core@7.26.0) - '@babel/plugin-transform-modules-commonjs': 7.25.7(@babel/core@7.26.0) - '@babel/plugin-transform-nullish-coalescing-operator': 7.25.7(@babel/core@7.26.0) - '@babel/plugin-transform-optional-chaining': 7.25.7(@babel/core@7.26.0) - '@babel/plugin-transform-private-methods': 7.25.7(@babel/core@7.26.0) + '@babel/parser': 7.26.2 + '@babel/plugin-transform-class-properties': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-modules-commonjs': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-nullish-coalescing-operator': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-optional-chaining': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-private-methods': 7.25.9(@babel/core@7.26.0) '@babel/preset-flow': 7.24.7(@babel/core@7.26.0) '@babel/preset-typescript': 7.26.0(@babel/core@7.26.0) - '@babel/register': 7.25.7(@babel/core@7.26.0) + '@babel/register': 7.25.9(@babel/core@7.26.0) flow-parser: 0.227.0 graceful-fs: 4.2.11 micromatch: 4.0.8 @@ -17789,7 +17403,7 @@ snapshots: log4js@6.9.1: dependencies: date-format: 4.0.14 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) flatted: 3.3.1 rfdc: 1.3.1 streamroller: 3.1.5 @@ -17841,7 +17455,7 @@ snapshots: magicast@0.3.5: dependencies: - '@babel/parser': 7.25.7 + '@babel/parser': 7.26.2 '@babel/types': 7.26.0 source-map-js: 1.2.1 @@ -18102,7 +17716,7 @@ snapshots: micromark@4.0.0: dependencies: '@types/debug': 4.1.12 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) decode-named-character-reference: 1.0.2 devlop: 1.1.0 micromark-core-commonmark: 2.0.1 @@ -18232,7 +17846,7 @@ snapshots: ansi-colors: 4.1.3 browser-stdout: 1.3.1 chokidar: 3.6.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) diff: 5.2.0 escape-string-regexp: 4.0.0 find-up: 5.0.0 @@ -18275,8 +17889,6 @@ snapshots: ms@2.0.0: {} - ms@2.1.2: {} - ms@2.1.3: {} msw@2.4.4(typescript@5.6.3): @@ -18518,7 +18130,7 @@ snapshots: '@yarnpkg/lockfile': 1.1.0 '@yarnpkg/parsers': 3.0.0-rc.46 '@zkochan/js-yaml': 0.0.6 - axios: 1.7.5 + axios: 1.7.7(debug@4.3.7) chalk: 4.1.2 cli-cursor: 3.1.0 cli-spinners: 2.6.1 @@ -18885,7 +18497,7 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.25.7 + '@babel/code-frame': 7.26.2 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -19185,7 +18797,7 @@ snapshots: react-docgen@5.4.3: dependencies: '@babel/core': 7.26.0 - '@babel/generator': 7.25.7 + '@babel/generator': 7.26.2 '@babel/runtime': 7.26.0 ast-types: 0.14.2 commander: 2.20.3 @@ -19791,7 +19403,7 @@ snapshots: socket.io-parser@4.2.4: dependencies: '@socket.io/component-emitter': 3.1.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -19800,7 +19412,7 @@ snapshots: accepts: 1.3.8 base64id: 2.0.0 cors: 2.8.5 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) engine.io: 6.5.4 socket.io-adapter: 2.5.2 socket.io-parser: 4.2.4 @@ -19812,7 +19424,7 @@ snapshots: socks-proxy-agent@8.0.2: dependencies: agent-base: 7.1.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) socks: 2.7.1 transitivePeerDependencies: - supports-color @@ -19904,7 +19516,7 @@ snapshots: streamroller@3.1.5: dependencies: date-format: 4.0.14 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) fs-extra: 8.1.0 transitivePeerDependencies: - supports-color @@ -20196,8 +19808,6 @@ snapshots: tmp@0.2.3: {} - to-fast-properties@2.0.0: {} - to-regex-range@5.0.1: dependencies: is-number: 7.0.0 @@ -20269,7 +19879,7 @@ snapshots: tuf-js@2.2.0: dependencies: '@tufjs/models': 2.0.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) make-fetch-happen: 13.0.0 transitivePeerDependencies: - supports-color @@ -20526,7 +20136,7 @@ snapshots: vite-node@2.1.3(@types/node@20.17.6)(terser@5.27.0): dependencies: cac: 6.7.14 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) pathe: 1.1.2 vite: 5.3.4(@types/node@20.17.6)(terser@5.27.0) transitivePeerDependencies: @@ -20559,7 +20169,7 @@ snapshots: '@vitest/spy': 2.1.3 '@vitest/utils': 2.1.3 chai: 5.1.1 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) magic-string: 0.30.11 pathe: 1.1.2 std-env: 3.7.0 From 121bde42b43ba846590ba739ea368c60bd4bcec7 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 5 Nov 2024 15:57:13 +0100 Subject: [PATCH 107/119] fix skipping new tests --- .../x-data-grid/src/tests/rows.DataGrid.test.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/x-data-grid/src/tests/rows.DataGrid.test.tsx b/packages/x-data-grid/src/tests/rows.DataGrid.test.tsx index 4f57aee0833d..4b15936896b0 100644 --- a/packages/x-data-grid/src/tests/rows.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/rows.DataGrid.test.tsx @@ -964,10 +964,12 @@ describe(' - Rows', () => { }); }); - it('should consider the spacing when computing the content size', function test() { + it('should consider the spacing when computing the content size', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const spacingTop = 5; const spacingBottom = 10; @@ -985,10 +987,12 @@ describe(' - Rows', () => { expect(virtualScrollerContent).toHaveInlineStyle({ width: 'auto' }); }); - it('should update the content size when getRowSpacing is removed', function test() { + it('should update the content size when getRowSpacing is removed', function test(t = {}) { if (isJSDOM) { // Need layouting - this.skip(); + // @ts-expect-error to support mocha and vitest + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + this?.skip?.() || t?.skip(); } const spacingTop = 5; const spacingBottom = 10; From dd2621bef72941a12df50546e554ccff47990d59 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Tue, 5 Nov 2024 16:20:23 +0100 Subject: [PATCH 108/119] Revert user events for some date pickers --- .../DateCalendar/tests/DateCalendar.test.tsx | 149 +++++++++--------- 1 file changed, 72 insertions(+), 77 deletions(-) diff --git a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx index a38ba557d0c4..993e51ab21bd 100644 --- a/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx +++ b/packages/x-date-pickers/src/DateCalendar/tests/DateCalendar.test.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { expect } from 'chai'; import { spy } from 'sinon'; -import { fireEvent, screen } from '@mui/internal-test-utils'; +import { fireEvent, screen, waitFor } from '@mui/internal-test-utils'; import { DateCalendar } from '@mui/x-date-pickers/DateCalendar'; import { PickersDay } from '@mui/x-date-pickers/PickersDay'; import { createPickerRenderer, adapterToUse } from 'test/utils/pickers'; @@ -9,31 +9,28 @@ import { createPickerRenderer, adapterToUse } from 'test/utils/pickers'; const isJSDOM = /jsdom/.test(window.navigator.userAgent); describe('', () => { - const { render, clock } = createPickerRenderer({ - clock: 'fake', - clockConfig: new Date('2019-01-02'), - }); + const { render, clock } = createPickerRenderer({ clockConfig: new Date(2019, 0, 2) }); - it('switches between views uncontrolled', () => { + it('switches between views uncontrolled', async () => { const handleViewChange = spy(); - render( + const { user } = render( , ); - fireEvent.click(screen.getByLabelText(/switch to year view/i)); + await user.click(screen.getByLabelText(/switch to year view/i)); expect(handleViewChange.callCount).to.equal(1); expect(screen.queryByLabelText(/switch to year view/i)).to.equal(null); expect(screen.getByLabelText('year view is open, switch to calendar view')).toBeVisible(); }); - it('should allow month and view changing, but not selection when readOnly prop is passed', () => { + it('should allow month and view changing, but not selection when readOnly prop is passed', async () => { const onChangeMock = spy(); const onMonthChangeMock = spy(); - render( + const { user } = render( ', () => { />, ); - fireEvent.click(screen.getByTitle('Previous month')); + await user.click(screen.getByTitle('Previous month')); expect(onMonthChangeMock.callCount).to.equal(1); - fireEvent.click(screen.getByTitle('Next month')); + await user.click(screen.getByTitle('Next month')); expect(onMonthChangeMock.callCount).to.equal(2); - clock.runToLast(); + await waitFor(() => expect(screen.getAllByRole('rowgroup').length).to.equal(1)); - fireEvent.click(screen.getByRole('gridcell', { name: '5' })); + await user.click(screen.getByRole('gridcell', { name: '5' })); expect(onChangeMock.callCount).to.equal(0); - fireEvent.click(screen.getByText('January 2019')); + await user.click(screen.getByText('January 2019')); expect(screen.queryByLabelText('year view is open, switch to calendar view')).toBeVisible(); }); - it('should not allow interaction when disabled prop is passed', () => { + it('should not allow interaction when disabled prop is passed', async () => { const onChangeMock = spy(); const onMonthChangeMock = spy(); - render( + const { user } = render( ', () => { />, ); - fireEvent.click(screen.getByText('January 2019')); + await user.click(screen.getByText('January 2019')); expect(screen.queryByText('January 2019')).toBeVisible(); expect(screen.queryByLabelText('year view is open, switch to calendar view')).to.equal(null); - fireEvent.click(screen.getByTitle('Previous month')); + await user.setup({ pointerEventsCheck: 0 }).click(screen.getByTitle('Previous month')); expect(onMonthChangeMock.callCount).to.equal(0); - fireEvent.click(screen.getByTitle('Next month')); + await user.setup({ pointerEventsCheck: 0 }).click(screen.getByTitle('Next month')); expect(onMonthChangeMock.callCount).to.equal(0); - fireEvent.click(screen.getByRole('gridcell', { name: '5' })); + await user.setup({ pointerEventsCheck: 0 }).click(screen.getByRole('gridcell', { name: '5' })); expect(onChangeMock.callCount).to.equal(0); }); @@ -192,10 +189,10 @@ describe('', () => { ).to.have.text('1'); }); - it('should use `referenceDate` when no value defined', () => { + it('should use `referenceDate` when no value defined', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { // should make the reference day firstly focusable expect(screen.getByRole('gridcell', { name: '17' })).to.have.attribute('tabindex', '0'); - fireEvent.click(screen.getByRole('gridcell', { name: '2' })); + await user.click(screen.getByRole('gridcell', { name: '2' })); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2022, 3, 2, 12, 30)); }); - it('should not use `referenceDate` when a value is defined', () => { + it('should not use `referenceDate` when a value is defined', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { />, ); - fireEvent.click(screen.getByRole('gridcell', { name: '2' })); + await user.click(screen.getByRole('gridcell', { name: '2' })); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2019, 0, 2, 12, 20)); }); - it('should not use `referenceDate` when a defaultValue is defined', () => { + it('should not use `referenceDate` when a defaultValue is defined', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { />, ); - fireEvent.click(screen.getByRole('gridcell', { name: '2' })); + await user.click(screen.getByRole('gridcell', { name: '2' })); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2019, 0, 2, 12, 20)); }); - it('should keep the time of the currently provided date', () => { + it('should keep the time of the currently provided date', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { />, ); - fireEvent.click(screen.getByRole('gridcell', { name: '2' })); + await user.click(screen.getByRole('gridcell', { name: '2' })); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime( adapterToUse.date('2018-01-02T11:11:11.111'), @@ -300,10 +297,10 @@ describe('', () => { }); describe('view: month', () => { - it('should select the closest enabled date in the month if the current date is disabled', () => { + it('should select the closest enabled date in the month if the current date is disabled', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const april = screen.getByText('Apr', { selector: 'button' }); - fireEvent.click(april); + await user.click(april); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2019, 3, 6)); }); - it('should respect minDate when selecting closest enabled date', () => { + it('should respect minDate when selecting closest enabled date', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const april = screen.getByText('Apr', { selector: 'button' }); - fireEvent.click(april); + await user.click(april); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2019, 3, 7)); }); - it('should respect maxDate when selecting closest enabled date', () => { + it('should respect maxDate when selecting closest enabled date', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const april = screen.getByText('Apr', { selector: 'button' }); - fireEvent.click(april); + await user.click(april); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2019, 3, 22)); }); - it('should go to next view without changing the date when no date of the new month is enabled', () => { + it('should go to next view without changing the date when no date of the new month is enabled', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const april = screen.getByText('Apr', { selector: 'button' }); - fireEvent.click(april); - clock.runToLast(); + await user.click(april); expect(onChange.callCount).to.equal(0); expect(screen.getByTestId('calendar-month-and-year-text')).to.have.text('April 2019'); }); - it('should use `referenceDate` when no value defined', () => { + it('should use `referenceDate` when no value defined', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const april = screen.getByText('Apr', { selector: 'button' }); - fireEvent.click(april); + await user.click(april); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2018, 3, 1, 12, 30)); }); - it('should not use `referenceDate` when a value is defined', () => { + it('should not use `referenceDate` when a value is defined', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const april = screen.getByText('Apr', { selector: 'button' }); - fireEvent.click(april); + await user.click(april); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2019, 3, 1, 12, 20)); }); - it('should not use `referenceDate` when a defaultValue is defined', () => { + it('should not use `referenceDate` when a defaultValue is defined', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const april = screen.getByText('Apr', { selector: 'button' }); - fireEvent.click(april); + await user.click(april); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2019, 3, 1, 12, 20)); @@ -450,10 +446,10 @@ describe('', () => { expect(screen.getAllByTestId('year')).to.have.length(200); }); - it('should select the closest enabled date in the month if the current date is disabled', () => { + it('should select the closest enabled date in the month if the current date is disabled', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const year2022 = screen.getByText('2022', { selector: 'button' }); - fireEvent.click(year2022); + await user.click(year2022); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2022, 4, 1)); }); - it('should respect minDate when selecting closest enabled date', () => { + it('should respect minDate when selecting closest enabled date', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const year2017 = screen.getByText('2017', { selector: 'button' }); - fireEvent.click(year2017); + await user.click(year2017); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2017, 4, 12)); }); - it('should respect maxDate when selecting closest enabled date', () => { + it('should respect maxDate when selecting closest enabled date', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const year2022 = screen.getByText('2022', { selector: 'button' }); - fireEvent.click(year2022); + await user.click(year2022); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2022, 2, 31)); }); - it('should go to next view without changing the date when no date of the new year is enabled', () => { + it('should go to next view without changing the date when no date of the new year is enabled', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const year2022 = screen.getByText('2022', { selector: 'button' }); - fireEvent.click(year2022); - clock.runToLast(); + await user.click(year2022); expect(onChange.callCount).to.equal(0); expect(screen.getByTestId('calendar-month-and-year-text')).to.have.text('January 2022'); @@ -560,10 +555,10 @@ describe('', () => { expect(parentBoundingBox.bottom).not.to.lessThan(buttonBoundingBox.bottom); }); - it('should use `referenceDate` when no value defined', () => { + it('should use `referenceDate` when no value defined', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const year2022 = screen.getByText('2022', { selector: 'button' }); - fireEvent.click(year2022); + await user.click(year2022); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2022, 0, 1, 12, 30)); }); - it('should not use `referenceDate` when a value is defined', () => { + it('should not use `referenceDate` when a value is defined', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const year2022 = screen.getByText('2022', { selector: 'button' }); - fireEvent.click(year2022); + await user.click(year2022); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2022, 0, 1, 12, 20)); }); - it('should not use `referenceDate` when a defaultValue is defined', () => { + it('should not use `referenceDate` when a defaultValue is defined', async () => { const onChange = spy(); - render( + const { user } = render( ', () => { ); const year2022 = screen.getByText('2022', { selector: 'button' }); - fireEvent.click(year2022); + await user.click(year2022); expect(onChange.callCount).to.equal(1); expect(onChange.lastCall.firstArg).toEqualDateTime(new Date(2022, 0, 1, 12, 20)); From fd39e3227ebbc35cd9d0e0a856ef156e13cc4ac0 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 6 Nov 2024 09:59:31 +0100 Subject: [PATCH 109/119] try to optimize threads --- .circleci/config.yml | 8 ++++++-- vitest.config.mts | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 326b6448fd4e..45ba31c4f3d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -145,7 +145,9 @@ jobs: - install_js - run: name: Tests fake browser (vitest) - command: pnpm vitest --project "jsdom/*" --coverage + command: pnpm vitest --project "jsdom/*" --coverage --pool=threads + environment: + VITEST_MAX_THREADS: 2 - run: name: Check coverage generated command: | @@ -271,7 +273,9 @@ jobs: browsers: true - run: name: Tests real browsers (vitest) - command: pnpm vitest --project "browser/*" + command: pnpm vitest --project "browser/*" --pool=threads + environment: + VITEST_MAX_THREADS: 2 test_types: <<: *default-job diff --git a/vitest.config.mts b/vitest.config.mts index f64b90b85fe4..f6edc15e89f7 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -57,5 +57,10 @@ export default defineConfig({ env: { MUI_VITEST: 'true', }, + poolOptions: { + threads: { + useAtomics: true, + }, + }, }, }); From a154440d093951934b45c41ace9c16f32af2b544 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 6 Nov 2024 10:47:15 +0100 Subject: [PATCH 110/119] fix run --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 45ba31c4f3d7..981385b3c8fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -148,6 +148,7 @@ jobs: command: pnpm vitest --project "jsdom/*" --coverage --pool=threads environment: VITEST_MAX_THREADS: 2 + VITEST_MIN_THREADS: 1 - run: name: Check coverage generated command: | @@ -276,6 +277,7 @@ jobs: command: pnpm vitest --project "browser/*" --pool=threads environment: VITEST_MAX_THREADS: 2 + VITEST_MIN_THREADS: 1 test_types: <<: *default-job From 10523ece1ec53c12b8ca6550c101276802c0f212 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 6 Nov 2024 11:06:53 +0100 Subject: [PATCH 111/119] simpler reporter --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 981385b3c8fb..e5448bdfc2c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -145,7 +145,7 @@ jobs: - install_js - run: name: Tests fake browser (vitest) - command: pnpm vitest --project "jsdom/*" --coverage --pool=threads + command: pnpm vitest --project "jsdom/*" --coverage --pool=threads --reporter=dot environment: VITEST_MAX_THREADS: 2 VITEST_MIN_THREADS: 1 @@ -274,7 +274,7 @@ jobs: browsers: true - run: name: Tests real browsers (vitest) - command: pnpm vitest --project "browser/*" --pool=threads + command: pnpm vitest --project "browser/*" --pool=threads --reporter=dot environment: VITEST_MAX_THREADS: 2 VITEST_MIN_THREADS: 1 From 96d1d12972a9b7bb9e4adea77e3521d5fdc48eef Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 6 Nov 2024 11:19:47 +0100 Subject: [PATCH 112/119] reporters --- .circleci/config.yml | 4 ++-- vitest.config.mts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e5448bdfc2c4..981385b3c8fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -145,7 +145,7 @@ jobs: - install_js - run: name: Tests fake browser (vitest) - command: pnpm vitest --project "jsdom/*" --coverage --pool=threads --reporter=dot + command: pnpm vitest --project "jsdom/*" --coverage --pool=threads environment: VITEST_MAX_THREADS: 2 VITEST_MIN_THREADS: 1 @@ -274,7 +274,7 @@ jobs: browsers: true - run: name: Tests real browsers (vitest) - command: pnpm vitest --project "browser/*" --pool=threads --reporter=dot + command: pnpm vitest --project "browser/*" --pool=threads environment: VITEST_MAX_THREADS: 2 VITEST_MIN_THREADS: 1 diff --git a/vitest.config.mts b/vitest.config.mts index f6edc15e89f7..083e43cfa242 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -51,6 +51,7 @@ export default defineConfig({ reportsDirectory: path.resolve(MONOREPO_ROOT, 'coverage'), include: ['packages/*/src/**/*.ts', 'packages/*/src/**/*.tsx'], }, + reporters: ['dot'], sequence: { hooks: 'list', }, From d86d6cf10593b302f3588c707d508e5df43a1957 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 6 Nov 2024 17:21:17 +0100 Subject: [PATCH 113/119] try not using image --- .circleci/config.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 981385b3c8fb..6e2d7cea65c2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -80,7 +80,7 @@ commands: pnpm --version - run: name: Install js dependencies - command: pnpm install + command: pnpm install --frozen-lockfile - run: name: Resolve React version @@ -145,10 +145,10 @@ jobs: - install_js - run: name: Tests fake browser (vitest) - command: pnpm vitest --project "jsdom/*" --coverage --pool=threads + command: pnpm vitest --project "jsdom/*" --coverage --pool=forks environment: - VITEST_MAX_THREADS: 2 - VITEST_MIN_THREADS: 1 + VITEST_MAX_FORKS: 2 + VITEST_MIN_FORKS: 1 - run: name: Check coverage generated command: | @@ -266,18 +266,19 @@ jobs: test_browser_vitest: <<: *default-job - docker: - - image: mcr.microsoft.com/playwright:v1.44.1-focal steps: - checkout - install_js: browsers: true + - run: + name: Install Playwright Browsers + command: pnpm playwright install --with-deps - run: name: Tests real browsers (vitest) - command: pnpm vitest --project "browser/*" --pool=threads + command: pnpm vitest --project "browser/*" --pool=forks environment: - VITEST_MAX_THREADS: 2 - VITEST_MIN_THREADS: 1 + VITEST_MAX_FORKS: 2 + VITEST_MIN_FORKS: 1 test_types: <<: *default-job From 3bfdce8c1b233600c7022aa697e89c2d4cefa8da Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 6 Nov 2024 17:38:32 +0100 Subject: [PATCH 114/119] remove "browser" tag --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6e2d7cea65c2..d7bd41ff9f9d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -268,8 +268,7 @@ jobs: <<: *default-job steps: - checkout - - install_js: - browsers: true + - install_js - run: name: Install Playwright Browsers command: pnpm playwright install --with-deps From 73b10fecac333a7ebbde59b02c6a0235ae04054f Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 6 Nov 2024 18:30:29 +0100 Subject: [PATCH 115/119] try a single fork in browser mode --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d7bd41ff9f9d..305eecf08dab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -276,7 +276,7 @@ jobs: name: Tests real browsers (vitest) command: pnpm vitest --project "browser/*" --pool=forks environment: - VITEST_MAX_FORKS: 2 + VITEST_MAX_FORKS: 1 VITEST_MIN_FORKS: 1 test_types: From be83e6106d169d916a022e8ea3069180352f8d28 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 6 Nov 2024 19:44:43 +0100 Subject: [PATCH 116/119] threads --- .circleci/config.yml | 22 +++++++++++----------- vitest.config.mts | 1 - 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 305eecf08dab..18c9ce688a1d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -80,7 +80,7 @@ commands: pnpm --version - run: name: Install js dependencies - command: pnpm install --frozen-lockfile + command: pnpm install - run: name: Resolve React version @@ -145,10 +145,10 @@ jobs: - install_js - run: name: Tests fake browser (vitest) - command: pnpm vitest --project "jsdom/*" --coverage --pool=forks + command: pnpm vitest --project "jsdom/*" --coverage --pool=threads environment: - VITEST_MAX_FORKS: 2 - VITEST_MIN_FORKS: 1 + VITEST_MAX_THREADS: 3 + VITEST_MIN_THREADS: 2 - run: name: Check coverage generated command: | @@ -266,18 +266,18 @@ jobs: test_browser_vitest: <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.44.1-focal steps: - checkout - - install_js - - run: - name: Install Playwright Browsers - command: pnpm playwright install --with-deps + - install_js: + browsers: true - run: name: Tests real browsers (vitest) - command: pnpm vitest --project "browser/*" --pool=forks + command: pnpm vitest --project "browser/*" --pool=threads environment: - VITEST_MAX_FORKS: 1 - VITEST_MIN_FORKS: 1 + VITEST_MAX_THREADS: 3 + VITEST_MIN_THREADS: 2 test_types: <<: *default-job diff --git a/vitest.config.mts b/vitest.config.mts index 083e43cfa242..f6edc15e89f7 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -51,7 +51,6 @@ export default defineConfig({ reportsDirectory: path.resolve(MONOREPO_ROOT, 'coverage'), include: ['packages/*/src/**/*.ts', 'packages/*/src/**/*.tsx'], }, - reporters: ['dot'], sequence: { hooks: 'list', }, From 1ff3ea1084bbb4f698e21bbc28ff7097cc1ecab2 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Thu, 7 Nov 2024 07:16:25 +0100 Subject: [PATCH 117/119] try options --- .circleci/config.yml | 4 ++-- vitest.config.mts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 18c9ce688a1d..a92270478305 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -147,7 +147,7 @@ jobs: name: Tests fake browser (vitest) command: pnpm vitest --project "jsdom/*" --coverage --pool=threads environment: - VITEST_MAX_THREADS: 3 + VITEST_MAX_THREADS: 5 VITEST_MIN_THREADS: 2 - run: name: Check coverage generated @@ -276,7 +276,7 @@ jobs: name: Tests real browsers (vitest) command: pnpm vitest --project "browser/*" --pool=threads environment: - VITEST_MAX_THREADS: 3 + VITEST_MAX_THREADS: 5 VITEST_MIN_THREADS: 2 test_types: diff --git a/vitest.config.mts b/vitest.config.mts index f6edc15e89f7..71d766088e57 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -60,6 +60,7 @@ export default defineConfig({ poolOptions: { threads: { useAtomics: true, + singleThread: true, }, }, }, From 6a5056e5cc32900e6f40530074aedbcd89fe26d4 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Thu, 7 Nov 2024 08:29:49 +0100 Subject: [PATCH 118/119] run only one --- vitest.config.mts | 1 - 1 file changed, 1 deletion(-) diff --git a/vitest.config.mts b/vitest.config.mts index 71d766088e57..f6edc15e89f7 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -60,7 +60,6 @@ export default defineConfig({ poolOptions: { threads: { useAtomics: true, - singleThread: true, }, }, }, From ee14aa5966ec58c1f31a42f7ff8d3fa4dae81e6b Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Thu, 7 Nov 2024 08:49:48 +0100 Subject: [PATCH 119/119] more threads --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a92270478305..41c56cde5307 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -147,7 +147,7 @@ jobs: name: Tests fake browser (vitest) command: pnpm vitest --project "jsdom/*" --coverage --pool=threads environment: - VITEST_MAX_THREADS: 5 + VITEST_MAX_THREADS: 6 VITEST_MIN_THREADS: 2 - run: name: Check coverage generated @@ -274,10 +274,10 @@ jobs: browsers: true - run: name: Tests real browsers (vitest) - command: pnpm vitest --project "browser/*" --pool=threads + command: pnpm vitest --project "browser/x-data-grid" --pool=threads environment: - VITEST_MAX_THREADS: 5 - VITEST_MIN_THREADS: 2 + VITEST_MAX_THREADS: 1 + VITEST_MIN_THREADS: 1 test_types: <<: *default-job