From 9a2b1a5cf77fd1a63ec47e50c385169559fbf892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20Tr=E1=BB=8Dng=20H=E1=BA=A3i?= <41283691+hainenber@users.noreply.github.com> Date: Sat, 12 Oct 2024 01:46:01 +0700 Subject: [PATCH] chore(fe): uplift FE packages to latest version (#30357) Signed-off-by: hainenber --- superset-frontend/jest.config.js | 2 +- superset-frontend/package-lock.json | 455 ++++++++++-------- superset-frontend/package.json | 8 +- .../superset-ui-chart-controls/package.json | 6 +- .../packages/superset-ui-core/package.json | 38 +- .../test/chart/clients/ChartClient.test.ts | 2 +- .../test/connection/SupersetClient.test.ts | 8 +- .../connection/SupersetClientClass.test.ts | 37 +- .../test/connection/callApi/callApi.test.ts | 78 +-- .../callApiAndParseWithTimeout.test.ts | 13 +- .../connection/callApi/parseResponse.test.ts | 14 +- .../api/legacy/getDatasourceMetadata.test.ts | 4 +- .../test/query/api/legacy/getFormData.test.ts | 4 +- .../test/query/api/setupClientForTest.ts | 1 + .../test/query/api/v1/getChartData.test.ts | 4 +- .../test/query/api/v1/makeApi.test.ts | 4 +- .../time-comparison/fetchTimeRange.test.ts | 20 +- .../package.json | 2 +- .../plugins/plugin-chart-table/package.json | 6 +- .../spec/helpers/testing-library.tsx | 2 +- .../ShareSqlLabQuery.test.tsx | 2 +- .../components/SouthPane/SouthPane.test.tsx | 2 +- .../AlteredSliceTag/AlteredSliceTag.test.jsx | 2 +- .../InvalidSQLErrorMessage.test.tsx | 2 +- .../MarshmallowErrorMessage.test.tsx | 2 +- .../FiltersConfigModal.test.tsx | 4 +- .../tests/CurrentCalendarFrame.test.tsx | 2 +- .../ColumnSelectPopover.test.tsx | 2 +- .../OAuth2ClientField.test.tsx | 2 +- .../databases/DatabaseModal/index.test.tsx | 2 + .../UploadDataModel/UploadDataModal.test.tsx | 6 +- 31 files changed, 402 insertions(+), 334 deletions(-) diff --git a/superset-frontend/jest.config.js b/superset-frontend/jest.config.js index cb1a882869e43..9caf67f166ae6 100644 --- a/superset-frontend/jest.config.js +++ b/superset-frontend/jest.config.js @@ -56,7 +56,7 @@ module.exports = { moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], snapshotSerializers: ['@emotion/jest/enzyme-serializer'], transformIgnorePatterns: [ - 'node_modules/(?!d3-(interpolate|color|time)|remark-gfm|markdown-table|micromark-*.|decode-named-character-reference|character-entities|mdast-util-*.|unist-util-*.|ccount|escape-string-regexp|nanoid|@rjsf/*.|sinon|echarts|zrender)', + 'node_modules/(?!d3-(interpolate|color|time)|remark-gfm|markdown-table|micromark-*.|decode-named-character-reference|character-entities|mdast-util-*.|unist-util-*.|ccount|escape-string-regexp|nanoid|@rjsf/*.|sinon|echarts|zrender|fetch-mock)', ], globals: { __DEV__: true, diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index 1c452cb65330e..533829ac9bbc7 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -178,10 +178,10 @@ "@storybook/react-webpack5": "8.1.11", "@svgr/webpack": "^8.1.0", "@testing-library/dom": "^8.20.1", - "@testing-library/jest-dom": "^5.11.6", + "@testing-library/jest-dom": "^6.5.0", "@testing-library/react": "^12.1.5", - "@testing-library/react-hooks": "^5.1.3", - "@testing-library/user-event": "^12.7.0", + "@testing-library/react-hooks": "^8.0.1", + "@testing-library/user-event": "^12.8.3", "@types/classnames": "^2.2.10", "@types/dom-to-image": "^2.6.7", "@types/enzyme": "^3.10.18", @@ -307,7 +307,9 @@ } }, "node_modules/@adobe/css-tools": { - "version": "4.3.3", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.0.tgz", + "integrity": "sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ==", "license": "MIT" }, "node_modules/@ampproject/remapping": { @@ -5897,6 +5899,7 @@ }, "node_modules/@jest/expect-utils": { "version": "29.7.0", + "dev": true, "license": "MIT", "dependencies": { "jest-get-type": "^29.6.3" @@ -6021,6 +6024,7 @@ }, "node_modules/@jest/schemas": { "version": "29.6.3", + "dev": true, "license": "MIT", "dependencies": { "@sinclair/typebox": "^0.27.8" @@ -6194,6 +6198,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, "dependencies": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", @@ -6210,6 +6215,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, "dependencies": { "@types/istanbul-lib-report": "*" } @@ -9644,6 +9650,7 @@ }, "node_modules/@sinclair/typebox": { "version": "0.27.8", + "dev": true, "license": "MIT" }, "node_modules/@sindresorhus/is": { @@ -12906,23 +12913,21 @@ } }, "node_modules/@testing-library/jest-dom": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.17.0.tgz", - "integrity": "sha512-ynmNeT7asXyH3aSVv4vvX4Rb+0qjOhdNHnO/3vuZNqPmhDpV/+rCSGwQ7bLcmU2cJ4dvoheIO85LQj0IbJHEtg==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.5.0.tgz", + "integrity": "sha512-xGGHpBXYSHUUr6XsKBfs85TWlYKpTc37cSBBVrXcib2MkHLboWlkClhWF37JKlDb9KEq3dHs+f2xR7XJEWGBxA==", "license": "MIT", "dependencies": { - "@adobe/css-tools": "^4.0.1", - "@babel/runtime": "^7.9.2", - "@types/testing-library__jest-dom": "^5.9.1", + "@adobe/css-tools": "^4.4.0", "aria-query": "^5.0.0", "chalk": "^3.0.0", "css.escape": "^1.5.1", - "dom-accessibility-api": "^0.5.6", - "lodash": "^4.17.15", + "dom-accessibility-api": "^0.6.3", + "lodash": "^4.17.21", "redent": "^3.0.0" }, "engines": { - "node": ">=8", + "node": ">=14", "npm": ">=6", "yarn": ">=1" } @@ -12945,6 +12950,12 @@ "node": ">=8" } }, + "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", + "license": "MIT" + }, "node_modules/@testing-library/react": { "version": "12.1.5", "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-12.1.5.tgz", @@ -12964,22 +12975,27 @@ } }, "node_modules/@testing-library/react-hooks": { - "version": "5.1.3", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-8.0.1.tgz", + "integrity": "sha512-Aqhl2IVmLt8IovEVarNDFuJDVWVvhnr9/GCU6UUnrYXwgDFF9h2L2o2P9KBni1AST5sT6riAyoukFLyjQUgD/g==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5", - "@types/react": ">=16.9.0", - "@types/react-dom": ">=16.9.0", - "@types/react-test-renderer": ">=16.9.0", - "filter-console": "^0.1.1", "react-error-boundary": "^3.1.0" }, + "engines": { + "node": ">=12" + }, "peerDependencies": { - "react": ">=16.9.0", - "react-dom": ">=16.9.0", - "react-test-renderer": ">=16.9.0" + "@types/react": "^16.9.0 || ^17.0.0", + "react": "^16.9.0 || ^17.0.0", + "react-dom": "^16.9.0 || ^17.0.0", + "react-test-renderer": "^16.9.0 || ^17.0.0" }, "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, "react-dom": { "optional": true }, @@ -13003,7 +13019,9 @@ } }, "node_modules/@testing-library/user-event": { - "version": "12.7.0", + "version": "12.8.3", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-12.8.3.tgz", + "integrity": "sha512-IR0iWbFkgd56Bu5ZI/ej8yQwrkCv8Qydx6RzwbKz9faXazR/+5tvYKsZQgyXJiwgpcva127YO6JcWy7YlCfofQ==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5" @@ -13305,6 +13323,7 @@ }, "node_modules/@types/d3-interpolate": { "version": "3.0.4", + "dev": true, "license": "MIT", "dependencies": { "@types/d3-color": "*" @@ -13471,6 +13490,13 @@ "@types/node": "*" } }, + "node_modules/@types/glob-to-regexp": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@types/glob-to-regexp/-/glob-to-regexp-0.4.4.tgz", + "integrity": "sha512-nDKoaKJYbnn1MZxUY0cA1bPmmgZbg0cTq7Rh13d0KWYNOiKbqoR+2d89SnRPszGh7ROzSwZ/GOjZ4jPbmmZ6Eg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/glob/node_modules/@types/minimatch": { "version": "5.1.2", "dev": true, @@ -13545,10 +13571,12 @@ }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.3", + "dev": true, "license": "MIT" }, "node_modules/@types/istanbul-lib-report": { "version": "3.0.0", + "dev": true, "license": "MIT", "dependencies": { "@types/istanbul-lib-coverage": "*" @@ -13565,6 +13593,7 @@ }, "node_modules/@types/jest": { "version": "29.5.12", + "dev": true, "license": "MIT", "dependencies": { "expect": "^29.0.0", @@ -13573,6 +13602,7 @@ }, "node_modules/@types/jest/node_modules/ansi-styles": { "version": "5.2.0", + "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -13583,6 +13613,7 @@ }, "node_modules/@types/jest/node_modules/pretty-format": { "version": "29.7.0", + "dev": true, "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", @@ -13595,6 +13626,7 @@ }, "node_modules/@types/jest/node_modules/react-is": { "version": "18.3.1", + "dev": true, "license": "MIT" }, "node_modules/@types/jquery": { @@ -13831,13 +13863,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-test-renderer": { - "version": "17.0.1", - "license": "MIT", - "dependencies": { - "@types/react": "*" - } - }, "node_modules/@types/react-transition-group": { "version": "4.4.10", "dev": true, @@ -13918,6 +13943,7 @@ }, "node_modules/@types/rison": { "version": "0.0.9", + "dev": true, "license": "MIT" }, "node_modules/@types/scheduler": { @@ -13926,6 +13952,7 @@ }, "node_modules/@types/seedrandom": { "version": "3.0.8", + "dev": true, "license": "MIT" }, "node_modules/@types/semver": { @@ -14005,13 +14032,6 @@ "version": "1.0.8", "license": "MIT" }, - "node_modules/@types/testing-library__jest-dom": { - "version": "5.9.5", - "license": "MIT", - "dependencies": { - "@types/jest": "*" - } - }, "node_modules/@types/through": { "version": "0.0.33", "license": "MIT", @@ -14125,12 +14145,14 @@ "version": "17.0.33", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", + "dev": true, "dependencies": { "@types/yargs-parser": "*" } }, "node_modules/@types/yargs-parser": { "version": "15.0.0", + "dev": true, "license": "MIT" }, "node_modules/@types/yauzl": { @@ -22364,6 +22386,7 @@ }, "node_modules/diff-sequences": { "version": "29.6.3", + "dev": true, "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -25008,6 +25031,7 @@ }, "node_modules/expect": { "version": "29.7.0", + "dev": true, "license": "MIT", "dependencies": { "@jest/expect-utils": "^29.7.0", @@ -25852,13 +25876,6 @@ "node": ">=0.10.0" } }, - "node_modules/filter-console": { - "version": "0.1.1", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/filter-obj": { "version": "1.1.0", "license": "MIT", @@ -30672,6 +30689,7 @@ }, "node_modules/jest-diff": { "version": "29.7.0", + "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", @@ -30685,6 +30703,7 @@ }, "node_modules/jest-diff/node_modules/ansi-styles": { "version": "5.2.0", + "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -30695,6 +30714,7 @@ }, "node_modules/jest-diff/node_modules/pretty-format": { "version": "29.7.0", + "dev": true, "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", @@ -30707,6 +30727,7 @@ }, "node_modules/jest-diff/node_modules/react-is": { "version": "18.3.1", + "dev": true, "license": "MIT" }, "node_modules/jest-docblock": { @@ -31686,6 +31707,7 @@ }, "node_modules/jest-get-type": { "version": "29.6.3", + "dev": true, "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -31878,6 +31900,7 @@ }, "node_modules/jest-matcher-utils": { "version": "29.7.0", + "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", @@ -31891,6 +31914,7 @@ }, "node_modules/jest-matcher-utils/node_modules/ansi-styles": { "version": "5.2.0", + "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -31901,6 +31925,7 @@ }, "node_modules/jest-matcher-utils/node_modules/pretty-format": { "version": "29.7.0", + "dev": true, "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", @@ -31913,10 +31938,12 @@ }, "node_modules/jest-matcher-utils/node_modules/react-is": { "version": "18.3.1", + "dev": true, "license": "MIT" }, "node_modules/jest-message-util": { "version": "29.7.0", + "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.12.13", @@ -31935,10 +31962,12 @@ }, "node_modules/jest-message-util/node_modules/@types/stack-utils": { "version": "2.0.3", + "dev": true, "license": "MIT" }, "node_modules/jest-message-util/node_modules/ansi-styles": { "version": "5.2.0", + "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -31949,6 +31978,7 @@ }, "node_modules/jest-message-util/node_modules/braces": { "version": "3.0.3", + "dev": true, "license": "MIT", "dependencies": { "fill-range": "^7.1.1" @@ -31959,6 +31989,7 @@ }, "node_modules/jest-message-util/node_modules/fill-range": { "version": "7.1.1", + "dev": true, "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -31969,6 +32000,7 @@ }, "node_modules/jest-message-util/node_modules/is-number": { "version": "7.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=0.12.0" @@ -31976,6 +32008,7 @@ }, "node_modules/jest-message-util/node_modules/micromatch": { "version": "4.0.7", + "dev": true, "license": "MIT", "dependencies": { "braces": "^3.0.3", @@ -31987,6 +32020,7 @@ }, "node_modules/jest-message-util/node_modules/pretty-format": { "version": "29.7.0", + "dev": true, "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", @@ -31999,10 +32033,12 @@ }, "node_modules/jest-message-util/node_modules/react-is": { "version": "18.3.1", + "dev": true, "license": "MIT" }, "node_modules/jest-message-util/node_modules/slash": { "version": "3.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -32010,6 +32046,7 @@ }, "node_modules/jest-message-util/node_modules/to-regex-range": { "version": "5.0.1", + "dev": true, "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -32277,6 +32314,7 @@ }, "node_modules/jest-util": { "version": "29.7.0", + "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -32292,6 +32330,7 @@ }, "node_modules/jest-util/node_modules/ci-info": { "version": "3.9.0", + "dev": true, "funding": [ { "type": "github", @@ -46572,6 +46611,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/regexparam": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-3.0.0.tgz", + "integrity": "sha512-RSYAtP31mvYLkAHrOlh25pCNQ5hWnT106VukGaaFfuJrZFkGRX5GhUAdPqpSDXxOhA2c4akmRuplv1mRqnBn6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/regexpu-core": { "version": "5.3.2", "dev": true, @@ -49607,6 +49656,7 @@ }, "node_modules/stack-utils": { "version": "2.0.3", + "dev": true, "license": "MIT", "dependencies": { "escape-string-regexp": "^2.0.0" @@ -49617,6 +49667,7 @@ }, "node_modules/stack-utils/node_modules/escape-string-regexp": { "version": "2.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -55561,10 +55612,10 @@ "@emotion/react": "^11.4.1", "@superset-ui/core": "*", "@testing-library/dom": "^8.20.1", - "@testing-library/jest-dom": "^5.11.6", + "@testing-library/jest-dom": "*", "@testing-library/react": "^12.1.5", - "@testing-library/react-hooks": "^5.0.3", - "@testing-library/user-event": "^12.7.0", + "@testing-library/react-hooks": "*", + "@testing-library/user-event": "*", "ace-builds": "^1.4.14", "antd": "4.10.3", "brace": "^0.11.1", @@ -55580,21 +55631,7 @@ "license": "Apache-2.0", "dependencies": { "@babel/runtime": "^7.25.6", - "@testing-library/react-hooks": "^5.1.3", - "@types/d3-format": "^1.3.0", - "@types/d3-interpolate": "^3.0.4", - "@types/d3-scale": "^2.1.1", - "@types/d3-time": "^3.0.3", - "@types/d3-time-format": "^4.0.3", - "@types/enzyme": "^3.10.18", - "@types/fetch-mock": "^7.3.8", "@types/json-bigint": "^1.0.4", - "@types/lodash": "^4.17.7", - "@types/math-expression-evaluator": "^1.3.3", - "@types/node": "^22.5.4", - "@types/prop-types": "^15.7.13", - "@types/rison": "0.0.9", - "@types/seedrandom": "^3.0.8", "@vx/responsive": "^0.0.199", "csstype": "^3.1.3", "d3-format": "^1.3.2", @@ -55604,7 +55641,7 @@ "d3-time-format": "^4.1.0", "fetch-retry": "^6.0.0", "jed": "^1.1.1", - "lodash": "^4.17.11", + "lodash": "^4.17.21", "math-expression-evaluator": "^1.3.8", "pretty-ms": "^7.0.0", "react-error-boundary": "^1.2.5", @@ -55620,8 +55657,21 @@ }, "devDependencies": { "@emotion/styled": "^11.3.0", - "fetch-mock": "^6.5.2", - "jest-mock-console": "^1.0.0", + "@types/d3-format": "^1.3.0", + "@types/d3-interpolate": "^3.0.4", + "@types/d3-scale": "^2.1.1", + "@types/d3-time": "^3.0.3", + "@types/d3-time-format": "^4.0.3", + "@types/enzyme": "^3.10.18", + "@types/fetch-mock": "^7.3.8", + "@types/lodash": "^4.17.7", + "@types/math-expression-evaluator": "^1.3.3", + "@types/node": "^22.5.4", + "@types/prop-types": "^15.7.2", + "@types/rison": "0.0.9", + "@types/seedrandom": "^3.0.8", + "fetch-mock": "^11.1.4", + "jest-mock-console": "^2.0.0", "resize-observer-polyfill": "1.5.1", "timezone-mock": "1.3.6" }, @@ -55630,9 +55680,10 @@ "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@testing-library/dom": "^8.20.1", - "@testing-library/jest-dom": "^5.11.6", + "@testing-library/jest-dom": "*", "@testing-library/react": "^12.1.5", - "@testing-library/user-event": "^12.7.0", + "@testing-library/react-hooks": "*", + "@testing-library/user-event": "*", "@types/react": "*", "@types/react-loadable": "*", "@types/tinycolor2": "*", @@ -55652,70 +55703,34 @@ "node": ">=6.9.0" } }, - "packages/superset-ui-core/node_modules/@testing-library/react-hooks": { - "version": "8.0.1", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.12.5", - "react-error-boundary": "^3.1.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "@types/react": "^16.9.0 || ^17.0.0", - "react": "^16.9.0 || ^17.0.0", - "react-dom": "^16.9.0 || ^17.0.0", - "react-test-renderer": "^16.9.0 || ^17.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "react-test-renderer": { - "optional": true - } - } - }, - "packages/superset-ui-core/node_modules/@testing-library/react-hooks/node_modules/react-error-boundary": { - "version": "3.1.4", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.12.5" - }, - "engines": { - "node": ">=10", - "npm": ">=6" - }, - "peerDependencies": { - "react": ">=16.13.1" - } - }, "packages/superset-ui-core/node_modules/@types/d3-format": { "version": "1.4.2", + "dev": true, "license": "MIT" }, "packages/superset-ui-core/node_modules/@types/d3-time": { "version": "3.0.3", + "dev": true, "license": "MIT" }, "packages/superset-ui-core/node_modules/@types/d3-time-format": { "version": "2.3.1", + "dev": true, "license": "MIT" }, "packages/superset-ui-core/node_modules/@types/fetch-mock": { "version": "7.3.8", + "dev": true, "license": "MIT" }, "packages/superset-ui-core/node_modules/@types/lodash": { "version": "4.17.7", + "dev": true, "license": "MIT" }, "packages/superset-ui-core/node_modules/@types/math-expression-evaluator": { "version": "1.3.3", + "dev": true, "license": "MIT" }, "packages/superset-ui-core/node_modules/d3-array": { @@ -55785,17 +55800,25 @@ } }, "packages/superset-ui-core/node_modules/fetch-mock": { - "version": "6.5.2", + "version": "11.1.4", + "resolved": "https://registry.npmjs.org/fetch-mock/-/fetch-mock-11.1.4.tgz", + "integrity": "sha512-Enndh1ApARgYDPfWFgfzLeSgdQVasMj6qDWDArya6quj3Z83AVGsl1YrVe8OxWVWsN7a+56RQRoGNmo9HdldAg==", "dev": true, - "hasInstallScript": true, "license": "MIT", "dependencies": { - "babel-polyfill": "^6.26.0", - "glob-to-regexp": "^0.4.0", - "path-to-regexp": "^2.2.1" + "@types/glob-to-regexp": "^0.4.4", + "dequal": "^2.0.3", + "glob-to-regexp": "^0.4.1", + "is-subset": "^0.1.1", + "regexparam": "^3.0.0" }, "engines": { - "node": ">=4.0.0" + "node": ">=8.0.0" + }, + "peerDependenciesMeta": { + "node-fetch": { + "optional": true + } } }, "packages/superset-ui-core/node_modules/jest-mock-console": { @@ -57232,7 +57255,7 @@ "peerDependencies": { "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", - "@testing-library/jest-dom": "^5.17.0", + "@testing-library/jest-dom": "*", "@testing-library/react": "^12.1.5", "react": "^16.13.1", "react-dom": "^16.13.1" @@ -57864,10 +57887,10 @@ "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", "@testing-library/dom": "^8.20.1", - "@testing-library/jest-dom": "^5.11.6", + "@testing-library/jest-dom": "*", "@testing-library/react": "^12.1.5", - "@testing-library/react-hooks": "^5.0.3", - "@testing-library/user-event": "^12.7.0", + "@testing-library/react-hooks": "*", + "@testing-library/user-event": "*", "@types/classnames": "*", "@types/react": "*", "match-sorter": "^6.3.3", @@ -58007,7 +58030,9 @@ "dev": true }, "@adobe/css-tools": { - "version": "4.3.3" + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.0.tgz", + "integrity": "sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ==" }, "@ampproject/remapping": { "version": "2.2.0", @@ -61608,6 +61633,7 @@ }, "@jest/expect-utils": { "version": "29.7.0", + "dev": true, "requires": { "jest-get-type": "^29.6.3" } @@ -61696,6 +61722,7 @@ }, "@jest/schemas": { "version": "29.6.3", + "dev": true, "requires": { "@sinclair/typebox": "^0.27.8" } @@ -61829,6 +61856,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, "requires": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", @@ -61842,6 +61870,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, "requires": { "@types/istanbul-lib-report": "*" } @@ -64221,7 +64250,8 @@ } }, "@sinclair/typebox": { - "version": "0.27.8" + "version": "0.27.8", + "dev": true }, "@sindresorhus/is": { "version": "4.6.0", @@ -65809,7 +65839,6 @@ "requires": { "@babel/runtime": "^7.25.6", "@emotion/styled": "^11.3.0", - "@testing-library/react-hooks": "^5.1.3", "@types/d3-format": "^1.3.0", "@types/d3-interpolate": "^3.0.4", "@types/d3-scale": "^2.1.1", @@ -65821,7 +65850,7 @@ "@types/lodash": "^4.17.7", "@types/math-expression-evaluator": "^1.3.3", "@types/node": "^22.5.4", - "@types/prop-types": "^15.7.13", + "@types/prop-types": "^15.7.2", "@types/rison": "0.0.9", "@types/seedrandom": "^3.0.8", "@vx/responsive": "^0.0.199", @@ -65831,11 +65860,11 @@ "d3-scale": "^3.0.0", "d3-time": "^3.1.0", "d3-time-format": "^4.1.0", - "fetch-mock": "^6.5.2", + "fetch-mock": "^11.1.4", "fetch-retry": "^6.0.0", "jed": "^1.1.1", - "jest-mock-console": "^1.0.0", - "lodash": "^4.17.11", + "jest-mock-console": "^2.0.0", + "lodash": "^4.17.21", "math-expression-evaluator": "^1.3.8", "pretty-ms": "^7.0.0", "react-error-boundary": "^1.2.5", @@ -65860,38 +65889,29 @@ "regenerator-runtime": "^0.14.0" } }, - "@testing-library/react-hooks": { - "version": "8.0.1", - "requires": { - "@babel/runtime": "^7.12.5", - "react-error-boundary": "^3.1.0" - }, - "dependencies": { - "react-error-boundary": { - "version": "3.1.4", - "requires": { - "@babel/runtime": "^7.12.5" - } - } - } - }, "@types/d3-format": { - "version": "1.4.2" + "version": "1.4.2", + "dev": true }, "@types/d3-time": { - "version": "3.0.3" + "version": "3.0.3", + "dev": true }, "@types/d3-time-format": { - "version": "2.3.1" + "version": "2.3.1", + "dev": true }, "@types/fetch-mock": { - "version": "7.3.8" + "version": "7.3.8", + "dev": true }, "@types/lodash": { - "version": "4.17.7" + "version": "4.17.7", + "dev": true }, "@types/math-expression-evaluator": { - "version": "1.3.3" + "version": "1.3.3", + "dev": true }, "d3-array": { "version": "2.12.1", @@ -65946,12 +65966,16 @@ "version": "5.0.0" }, "fetch-mock": { - "version": "6.5.2", + "version": "11.1.4", + "resolved": "https://registry.npmjs.org/fetch-mock/-/fetch-mock-11.1.4.tgz", + "integrity": "sha512-Enndh1ApARgYDPfWFgfzLeSgdQVasMj6qDWDArya6quj3Z83AVGsl1YrVe8OxWVWsN7a+56RQRoGNmo9HdldAg==", "dev": true, "requires": { - "babel-polyfill": "^6.26.0", - "glob-to-regexp": "^0.4.0", - "path-to-regexp": "^2.2.1" + "@types/glob-to-regexp": "^0.4.4", + "dequal": "^2.0.3", + "glob-to-regexp": "^0.4.1", + "is-subset": "^0.1.1", + "regexparam": "^3.0.0" } }, "jest-mock-console": { @@ -68603,18 +68627,16 @@ } }, "@testing-library/jest-dom": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.17.0.tgz", - "integrity": "sha512-ynmNeT7asXyH3aSVv4vvX4Rb+0qjOhdNHnO/3vuZNqPmhDpV/+rCSGwQ7bLcmU2cJ4dvoheIO85LQj0IbJHEtg==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.5.0.tgz", + "integrity": "sha512-xGGHpBXYSHUUr6XsKBfs85TWlYKpTc37cSBBVrXcib2MkHLboWlkClhWF37JKlDb9KEq3dHs+f2xR7XJEWGBxA==", "requires": { - "@adobe/css-tools": "^4.0.1", - "@babel/runtime": "^7.9.2", - "@types/testing-library__jest-dom": "^5.9.1", + "@adobe/css-tools": "^4.4.0", "aria-query": "^5.0.0", "chalk": "^3.0.0", "css.escape": "^1.5.1", - "dom-accessibility-api": "^0.5.6", - "lodash": "^4.17.15", + "dom-accessibility-api": "^0.6.3", + "lodash": "^4.17.21", "redent": "^3.0.0" }, "dependencies": { @@ -68630,6 +68652,11 @@ "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } + }, + "dom-accessibility-api": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==" } } }, @@ -68644,13 +68671,11 @@ } }, "@testing-library/react-hooks": { - "version": "5.1.3", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-8.0.1.tgz", + "integrity": "sha512-Aqhl2IVmLt8IovEVarNDFuJDVWVvhnr9/GCU6UUnrYXwgDFF9h2L2o2P9KBni1AST5sT6riAyoukFLyjQUgD/g==", "requires": { "@babel/runtime": "^7.12.5", - "@types/react": "^16.9.53", - "@types/react-dom": ">=16.9.0", - "@types/react-test-renderer": ">=16.9.0", - "filter-console": "^0.1.1", "react-error-boundary": "^3.1.0" }, "dependencies": { @@ -68663,7 +68688,9 @@ } }, "@testing-library/user-event": { - "version": "12.7.0", + "version": "12.8.3", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-12.8.3.tgz", + "integrity": "sha512-IR0iWbFkgd56Bu5ZI/ej8yQwrkCv8Qydx6RzwbKz9faXazR/+5tvYKsZQgyXJiwgpcva127YO6JcWy7YlCfofQ==", "requires": { "@babel/runtime": "^7.12.5" } @@ -68914,6 +68941,7 @@ }, "@types/d3-interpolate": { "version": "3.0.4", + "dev": true, "requires": { "@types/d3-color": "*" } @@ -69060,6 +69088,12 @@ } } }, + "@types/glob-to-regexp": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@types/glob-to-regexp/-/glob-to-regexp-0.4.4.tgz", + "integrity": "sha512-nDKoaKJYbnn1MZxUY0cA1bPmmgZbg0cTq7Rh13d0KWYNOiKbqoR+2d89SnRPszGh7ROzSwZ/GOjZ4jPbmmZ6Eg==", + "dev": true + }, "@types/graceful-fs": { "version": "4.1.3", "dev": true, @@ -69119,10 +69153,12 @@ } }, "@types/istanbul-lib-coverage": { - "version": "2.0.3" + "version": "2.0.3", + "dev": true }, "@types/istanbul-lib-report": { "version": "3.0.0", + "dev": true, "requires": { "@types/istanbul-lib-coverage": "*" } @@ -69137,16 +69173,19 @@ }, "@types/jest": { "version": "29.5.12", + "dev": true, "requires": { "expect": "^29.0.0", "pretty-format": "^29.0.0" }, "dependencies": { "ansi-styles": { - "version": "5.2.0" + "version": "5.2.0", + "dev": true }, "pretty-format": { "version": "29.7.0", + "dev": true, "requires": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -69154,7 +69193,8 @@ } }, "react-is": { - "version": "18.3.1" + "version": "18.3.1", + "dev": true } } }, @@ -69362,12 +69402,6 @@ "@types/react": "^16.9.53" } }, - "@types/react-test-renderer": { - "version": "17.0.1", - "requires": { - "@types/react": "^16.9.53" - } - }, "@types/react-transition-group": { "version": "4.4.10", "dev": true, @@ -69440,13 +69474,15 @@ "dev": true }, "@types/rison": { - "version": "0.0.9" + "version": "0.0.9", + "dev": true }, "@types/scheduler": { "version": "0.16.6" }, "@types/seedrandom": { - "version": "3.0.8" + "version": "3.0.8", + "dev": true }, "@types/semver": { "version": "7.5.0", @@ -69516,12 +69552,6 @@ "@types/tapable": { "version": "1.0.8" }, - "@types/testing-library__jest-dom": { - "version": "5.9.5", - "requires": { - "@types/jest": "*" - } - }, "@types/through": { "version": "0.0.33", "requires": { @@ -69610,12 +69640,14 @@ "version": "17.0.33", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", + "dev": true, "requires": { "@types/yargs-parser": "*" } }, "@types/yargs-parser": { - "version": "15.0.0" + "version": "15.0.0", + "dev": true }, "@types/yauzl": { "version": "2.9.2", @@ -75124,7 +75156,8 @@ "version": "1.0.5" }, "diff-sequences": { - "version": "29.6.3" + "version": "29.6.3", + "dev": true }, "dir-glob": { "version": "3.0.1", @@ -76833,6 +76866,7 @@ }, "expect": { "version": "29.7.0", + "dev": true, "requires": { "@jest/expect-utils": "^29.7.0", "jest-get-type": "^29.6.3", @@ -77404,9 +77438,6 @@ "to-regex-range": "^2.1.0" } }, - "filter-console": { - "version": "0.1.1" - }, "filter-obj": { "version": "1.1.0" }, @@ -80414,6 +80445,7 @@ }, "jest-diff": { "version": "29.7.0", + "dev": true, "requires": { "chalk": "^4.0.0", "diff-sequences": "^29.6.3", @@ -80422,10 +80454,12 @@ }, "dependencies": { "ansi-styles": { - "version": "5.2.0" + "version": "5.2.0", + "dev": true }, "pretty-format": { "version": "29.7.0", + "dev": true, "requires": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -80433,7 +80467,8 @@ } }, "react-is": { - "version": "18.3.1" + "version": "18.3.1", + "dev": true } } }, @@ -81100,7 +81135,8 @@ } }, "jest-get-type": { - "version": "29.6.3" + "version": "29.6.3", + "dev": true }, "jest-haste-map": { "version": "29.7.0", @@ -81234,6 +81270,7 @@ }, "jest-matcher-utils": { "version": "29.7.0", + "dev": true, "requires": { "chalk": "^4.0.0", "jest-diff": "^29.7.0", @@ -81242,10 +81279,12 @@ }, "dependencies": { "ansi-styles": { - "version": "5.2.0" + "version": "5.2.0", + "dev": true }, "pretty-format": { "version": "29.7.0", + "dev": true, "requires": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -81253,12 +81292,14 @@ } }, "react-is": { - "version": "18.3.1" + "version": "18.3.1", + "dev": true } } }, "jest-message-util": { "version": "29.7.0", + "dev": true, "requires": { "@babel/code-frame": "^7.12.13", "@jest/types": "^29.6.3", @@ -81272,28 +81313,34 @@ }, "dependencies": { "@types/stack-utils": { - "version": "2.0.3" + "version": "2.0.3", + "dev": true }, "ansi-styles": { - "version": "5.2.0" + "version": "5.2.0", + "dev": true }, "braces": { "version": "3.0.3", + "dev": true, "requires": { "fill-range": "^7.1.1" } }, "fill-range": { "version": "7.1.1", + "dev": true, "requires": { "to-regex-range": "^5.0.1" } }, "is-number": { - "version": "7.0.0" + "version": "7.0.0", + "dev": true }, "micromatch": { "version": "4.0.7", + "dev": true, "requires": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -81301,6 +81348,7 @@ }, "pretty-format": { "version": "29.7.0", + "dev": true, "requires": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -81308,13 +81356,16 @@ } }, "react-is": { - "version": "18.3.1" + "version": "18.3.1", + "dev": true }, "slash": { - "version": "3.0.0" + "version": "3.0.0", + "dev": true }, "to-regex-range": { "version": "5.0.1", + "dev": true, "requires": { "is-number": "^7.0.0" } @@ -81507,6 +81558,7 @@ }, "jest-util": { "version": "29.7.0", + "dev": true, "requires": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -81517,7 +81569,8 @@ }, "dependencies": { "ci-info": { - "version": "3.9.0" + "version": "3.9.0", + "dev": true } } }, @@ -90122,6 +90175,12 @@ "set-function-name": "^2.0.1" } }, + "regexparam": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-3.0.0.tgz", + "integrity": "sha512-RSYAtP31mvYLkAHrOlh25pCNQ5hWnT106VukGaaFfuJrZFkGRX5GhUAdPqpSDXxOhA2c4akmRuplv1mRqnBn6Q==", + "dev": true + }, "regexpu-core": { "version": "5.3.2", "dev": true, @@ -92070,12 +92129,14 @@ }, "stack-utils": { "version": "2.0.3", + "dev": true, "requires": { "escape-string-regexp": "^2.0.0" }, "dependencies": { "escape-string-regexp": { - "version": "2.0.0" + "version": "2.0.0", + "dev": true } } }, diff --git a/superset-frontend/package.json b/superset-frontend/package.json index 3dee70e069fda..258738112ce03 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -244,10 +244,10 @@ "@storybook/react-webpack5": "8.1.11", "@svgr/webpack": "^8.1.0", "@testing-library/dom": "^8.20.1", - "@testing-library/jest-dom": "^5.11.6", + "@testing-library/jest-dom": "^6.5.0", "@testing-library/react": "^12.1.5", - "@testing-library/react-hooks": "^5.1.3", - "@testing-library/user-event": "^12.7.0", + "@testing-library/react-hooks": "^8.0.1", + "@testing-library/user-event": "^12.8.3", "@types/classnames": "^2.2.10", "@types/dom-to-image": "^2.6.7", "@types/enzyme": "^3.10.18", @@ -340,7 +340,7 @@ "react-resizable": "^3.0.5", "react-test-renderer": "^16.14.0", "redux-mock-store": "^1.5.4", - "sinon": "^18.0.1", + "sinon": "^18.0.0", "source-map": "^0.7.4", "source-map-support": "^0.5.21", "speed-measure-webpack-plugin": "^1.5.0", diff --git a/superset-frontend/packages/superset-ui-chart-controls/package.json b/superset-frontend/packages/superset-ui-chart-controls/package.json index c7ce78a603f91..3c4dc88debf50 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/package.json +++ b/superset-frontend/packages/superset-ui-chart-controls/package.json @@ -35,10 +35,10 @@ "@emotion/react": "^11.4.1", "@superset-ui/core": "*", "@testing-library/dom": "^8.20.1", - "@testing-library/jest-dom": "^5.11.6", + "@testing-library/jest-dom": "*", "@testing-library/react": "^12.1.5", - "@testing-library/react-hooks": "^5.0.3", - "@testing-library/user-event": "^12.7.0", + "@testing-library/react-hooks": "*", + "@testing-library/user-event": "*", "ace-builds": "^1.4.14", "antd": "4.10.3", "brace": "^0.11.1", diff --git a/superset-frontend/packages/superset-ui-core/package.json b/superset-frontend/packages/superset-ui-core/package.json index 27b0c6e089355..e532c0e87a5d0 100644 --- a/superset-frontend/packages/superset-ui-core/package.json +++ b/superset-frontend/packages/superset-ui-core/package.json @@ -25,21 +25,7 @@ ], "dependencies": { "@babel/runtime": "^7.25.6", - "@testing-library/react-hooks": "^5.1.3", - "@types/d3-format": "^1.3.0", - "@types/d3-interpolate": "^3.0.4", - "@types/d3-scale": "^2.1.1", - "@types/d3-time": "^3.0.3", - "@types/d3-time-format": "^4.0.3", - "@types/enzyme": "^3.10.18", - "@types/fetch-mock": "^7.3.8", "@types/json-bigint": "^1.0.4", - "@types/lodash": "^4.17.7", - "@types/math-expression-evaluator": "^1.3.3", - "@types/node": "^22.5.4", - "@types/prop-types": "^15.7.13", - "@types/rison": "0.0.9", - "@types/seedrandom": "^3.0.8", "@vx/responsive": "^0.0.199", "csstype": "^3.1.3", "d3-format": "^1.3.2", @@ -49,7 +35,7 @@ "d3-time-format": "^4.1.0", "fetch-retry": "^6.0.0", "jed": "^1.1.1", - "lodash": "^4.17.11", + "lodash": "^4.17.21", "math-expression-evaluator": "^1.3.8", "pretty-ms": "^7.0.0", "react-error-boundary": "^1.2.5", @@ -65,8 +51,21 @@ }, "devDependencies": { "@emotion/styled": "^11.3.0", - "fetch-mock": "^6.5.2", - "jest-mock-console": "^1.0.0", + "@types/d3-format": "^1.3.0", + "@types/d3-interpolate": "^3.0.4", + "@types/d3-scale": "^2.1.1", + "@types/d3-time": "^3.0.3", + "@types/d3-time-format": "^4.0.3", + "@types/enzyme": "^3.10.18", + "@types/fetch-mock": "^7.3.8", + "@types/lodash": "^4.17.7", + "@types/math-expression-evaluator": "^1.3.3", + "@types/node": "^22.5.4", + "@types/prop-types": "^15.7.2", + "@types/rison": "0.0.9", + "@types/seedrandom": "^3.0.8", + "fetch-mock": "^11.1.4", + "jest-mock-console": "^2.0.0", "resize-observer-polyfill": "1.5.1", "timezone-mock": "1.3.6" }, @@ -75,9 +74,10 @@ "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@testing-library/dom": "^8.20.1", - "@testing-library/jest-dom": "^5.11.6", + "@testing-library/jest-dom": "*", "@testing-library/react": "^12.1.5", - "@testing-library/user-event": "^12.7.0", + "@testing-library/react-hooks": "*", + "@testing-library/user-event": "*", "@types/react": "*", "@types/react-loadable": "*", "@types/tinycolor2": "*", diff --git a/superset-frontend/packages/superset-ui-core/test/chart/clients/ChartClient.test.ts b/superset-frontend/packages/superset-ui-core/test/chart/clients/ChartClient.test.ts index 9992ca9381853..c82755374d3e7 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/clients/ChartClient.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/chart/clients/ChartClient.test.ts @@ -49,7 +49,7 @@ describe('ChartClient', () => { chartClient = new ChartClient(); }); - afterEach(fetchMock.restore); + afterEach(() => fetchMock.restore()); describe('new ChartClient(config)', () => { it('creates a client without argument', () => { diff --git a/superset-frontend/packages/superset-ui-core/test/connection/SupersetClient.test.ts b/superset-frontend/packages/superset-ui-core/test/connection/SupersetClient.test.ts index caba59f563722..500c7d956401b 100644 --- a/superset-frontend/packages/superset-ui-core/test/connection/SupersetClient.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/connection/SupersetClient.test.ts @@ -22,13 +22,11 @@ import { SupersetClient, SupersetClientClass } from '@superset-ui/core'; import { LOGIN_GLOB } from './fixtures/constants'; describe('SupersetClient', () => { - beforeAll(() => { - fetchMock.get(LOGIN_GLOB, { result: '' }); - }); + beforeAll(() => fetchMock.get(LOGIN_GLOB, { result: '' })); - afterAll(fetchMock.restore); + afterAll(() => fetchMock.restore()); - afterEach(SupersetClient.reset); + afterEach(() => SupersetClient.reset()); it('exposes reset, configure, init, get, post, postForm, isAuthenticated, and reAuthenticate methods', () => { expect(typeof SupersetClient.configure).toBe('function'); diff --git a/superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts b/superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts index 56ab3f1baea07..39f148f7beeec 100644 --- a/superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts @@ -21,11 +21,12 @@ import { SupersetClientClass, ClientConfig, CallApi } from '@superset-ui/core'; import { LOGIN_GLOB } from './fixtures/constants'; describe('SupersetClientClass', () => { - beforeAll(() => { + beforeEach(() => { + fetchMock.reset(); fetchMock.get(LOGIN_GLOB, { result: '' }); }); - afterAll(fetchMock.restore); + afterAll(() => fetchMock.restore()); describe('new SupersetClientClass()', () => { it('fallback protocol to https when setting only host', () => { @@ -78,11 +79,10 @@ describe('SupersetClientClass', () => { }); describe('.init()', () => { - afterEach(() => { - fetchMock.reset(); - // reset - fetchMock.get(LOGIN_GLOB, { result: 1234 }, { overwriteRoutes: true }); - }); + beforeEach(() => + fetchMock.get(LOGIN_GLOB, { result: 1234 }, { overwriteRoutes: true }), + ); + afterEach(() => fetchMock.reset()); it('calls api/v1/security/csrf_token/ when init() is called if no CSRF token is passed', async () => { expect.assertions(1); @@ -165,7 +165,7 @@ describe('SupersetClientClass', () => { }); describe('.isAuthenticated()', () => { - afterEach(fetchMock.reset); + afterEach(() => fetchMock.reset()); it('returns true if there is a token and false if not', async () => { expect.assertions(2); @@ -254,7 +254,8 @@ describe('SupersetClientClass', () => { }); describe('requests', () => { - afterEach(fetchMock.reset); + afterEach(() => fetchMock.restore()); + const protocol = 'https:'; const host = 'host'; const mockGetEndpoint = '/get/url'; @@ -272,13 +273,15 @@ describe('SupersetClientClass', () => { const mockTextJsonResponse = '{ "value": 9223372036854775807 }'; const mockPayload = { json: () => Promise.resolve('payload') }; - fetchMock.get(mockGetUrl, mockPayload); - fetchMock.post(mockPostUrl, mockPayload); - fetchMock.put(mockPutUrl, mockPayload); - fetchMock.delete(mockDeleteUrl, mockPayload); - fetchMock.delete(mockRequestUrl, mockPayload); - fetchMock.get(mockTextUrl, mockTextJsonResponse); - fetchMock.post(mockTextUrl, mockTextJsonResponse); + beforeEach(() => { + fetchMock.get(mockGetUrl, mockPayload); + fetchMock.post(mockPostUrl, mockPayload); + fetchMock.put(mockPutUrl, mockPayload); + fetchMock.delete(mockDeleteUrl, mockPayload); + fetchMock.delete(mockRequestUrl, mockPayload); + fetchMock.get(mockTextUrl, mockTextJsonResponse); + fetchMock.post(mockTextUrl, mockTextJsonResponse); + }); it('checks for authentication before every get and post request', async () => { expect.assertions(6); @@ -623,6 +626,8 @@ describe('SupersetClientClass', () => { let createElement: any; beforeEach(async () => { + fetchMock.get(LOGIN_GLOB, { result: 1234 }, { overwriteRoutes: true }); + client = new SupersetClientClass({ protocol, host }); authSpy = jest.spyOn(SupersetClientClass.prototype, 'ensureAuth'); await client.init(); diff --git a/superset-frontend/packages/superset-ui-core/test/connection/callApi/callApi.test.ts b/superset-frontend/packages/superset-ui-core/test/connection/callApi/callApi.test.ts index 1067945a7677f..387b96575be5b 100644 --- a/superset-frontend/packages/superset-ui-core/test/connection/callApi/callApi.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/connection/callApi/callApi.test.ts @@ -29,43 +29,41 @@ const corruptObject = new BadObject(); /* @ts-expect-error */ BadObject.prototype.toString = undefined; +const mockGetUrl = '/mock/get/url'; +const mockPostUrl = '/mock/post/url'; +const mockPutUrl = '/mock/put/url'; +const mockPatchUrl = '/mock/patch/url'; +const mockCacheUrl = '/mock/cache/url'; +const mockNotFound = '/mock/notfound'; +const mockErrorUrl = '/mock/error/url'; +const mock503 = '/mock/503'; + +const mockGetPayload = { get: 'payload' }; +const mockPostPayload = { post: 'payload' }; +const mockPutPayload = { post: 'payload' }; +const mockPatchPayload = { post: 'payload' }; +const mockCachePayload = { + status: 200, + body: 'BODY', + headers: { Etag: 'etag' }, +}; +const mockErrorPayload = { status: 500, statusText: 'Internal error' }; + describe('callApi()', () => { - beforeAll(() => { - fetchMock.get(LOGIN_GLOB, { result: '1234' }); + beforeAll(() => fetchMock.get(LOGIN_GLOB, { result: '1234' })); + + beforeEach(() => { + fetchMock.get(mockGetUrl, mockGetPayload); + fetchMock.post(mockPostUrl, mockPostPayload); + fetchMock.put(mockPutUrl, mockPutPayload); + fetchMock.patch(mockPatchUrl, mockPatchPayload); + fetchMock.get(mockCacheUrl, mockCachePayload); + fetchMock.get(mockNotFound, { status: 404 }); + fetchMock.get(mock503, { status: 503 }); + fetchMock.get(mockErrorUrl, () => Promise.reject(mockErrorPayload)); }); - afterAll(fetchMock.restore); - - const mockGetUrl = '/mock/get/url'; - const mockPostUrl = '/mock/post/url'; - const mockPutUrl = '/mock/put/url'; - const mockPatchUrl = '/mock/patch/url'; - const mockCacheUrl = '/mock/cache/url'; - const mockNotFound = '/mock/notfound'; - const mockErrorUrl = '/mock/error/url'; - const mock503 = '/mock/503'; - - const mockGetPayload = { get: 'payload' }; - const mockPostPayload = { post: 'payload' }; - const mockPutPayload = { post: 'payload' }; - const mockPatchPayload = { post: 'payload' }; - const mockCachePayload = { - status: 200, - body: 'BODY', - headers: { Etag: 'etag' }, - }; - const mockErrorPayload = { status: 500, statusText: 'Internal error' }; - - fetchMock.get(mockGetUrl, mockGetPayload); - fetchMock.post(mockPostUrl, mockPostPayload); - fetchMock.put(mockPutUrl, mockPutPayload); - fetchMock.patch(mockPatchUrl, mockPatchPayload); - fetchMock.get(mockCacheUrl, mockCachePayload); - fetchMock.get(mockNotFound, { status: 404 }); - fetchMock.get(mock503, { status: 503 }); - fetchMock.get(mockErrorUrl, () => Promise.reject(mockErrorPayload)); - - afterEach(fetchMock.reset); + afterEach(() => fetchMock.reset()); describe('request config', () => { it('calls the right url with the specified method', async () => { @@ -401,7 +399,7 @@ describe('callApi()', () => { Object.defineProperty(constants, 'CACHE_AVAILABLE', { value: false }); const firstResponse = await callApi({ url: mockCacheUrl, method: 'GET' }); - const calls = fetchMock.calls(mockCacheUrl); + let calls = fetchMock.calls(mockCacheUrl); expect(calls).toHaveLength(1); const firstBody = await firstResponse.text(); expect(firstBody).toEqual('BODY'); @@ -410,6 +408,7 @@ describe('callApi()', () => { url: mockCacheUrl, method: 'GET', }); + calls = fetchMock.calls(mockCacheUrl); const fetchParams = calls[1][1] as RequestInit; expect(calls).toHaveLength(2); // second call should not have If-None-Match header @@ -425,11 +424,12 @@ describe('callApi()', () => { expect.assertions(3); // first call sets the cache await callApi({ url: mockCacheUrl, method: 'GET' }); - const calls = fetchMock.calls(mockCacheUrl); + let calls = fetchMock.calls(mockCacheUrl); expect(calls).toHaveLength(1); // second call sends the Etag in the If-None-Match header await callApi({ url: mockCacheUrl, method: 'GET' }); + calls = fetchMock.calls(mockCacheUrl); const fetchParams = calls[1][1] as RequestInit; const headers = { 'If-None-Match': 'etag' }; expect(calls).toHaveLength(2); @@ -442,8 +442,7 @@ describe('callApi()', () => { expect.assertions(3); // first call sets the cache await callApi({ url: mockCacheUrl, method: 'GET' }); - const calls = fetchMock.calls(mockCacheUrl); - expect(calls).toHaveLength(1); + expect(fetchMock.calls(mockCacheUrl)).toHaveLength(1); // second call reuses the cached payload on a 304 const mockCachedPayload = { status: 304 }; fetchMock.get(mockCacheUrl, mockCachedPayload, { overwriteRoutes: true }); @@ -452,7 +451,7 @@ describe('callApi()', () => { url: mockCacheUrl, method: 'GET', }); - expect(calls).toHaveLength(2); + expect(fetchMock.calls(mockCacheUrl)).toHaveLength(2); const secondBody = await secondResponse.text(); expect(secondBody).toEqual('BODY'); }); @@ -641,6 +640,7 @@ describe('callApi()', () => { it('should ignore "null" postPayload string', async () => { expect.assertions(1); fetchMock.post('/post-null-postpayload', {}); + fetchMock.post('/post-formdata', {}); await callApi({ url: '/post-formdata', method: 'POST', diff --git a/superset-frontend/packages/superset-ui-core/test/connection/callApi/callApiAndParseWithTimeout.test.ts b/superset-frontend/packages/superset-ui-core/test/connection/callApi/callApiAndParseWithTimeout.test.ts index 36cc95bfa10c6..e0bf14e6c8ee8 100644 --- a/superset-frontend/packages/superset-ui-core/test/connection/callApi/callApiAndParseWithTimeout.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/connection/callApi/callApiAndParseWithTimeout.test.ts @@ -27,16 +27,15 @@ import * as rejectAfterTimeout from '../../../src/connection/callApi/rejectAfter import { LOGIN_GLOB } from '../fixtures/constants'; +const mockGetUrl = '/mock/get/url'; +const mockGetPayload = { get: 'payload' }; + describe('callApiAndParseWithTimeout()', () => { - beforeAll(() => { - fetchMock.get(LOGIN_GLOB, { result: '1234' }); - }); + beforeAll(() => fetchMock.get(LOGIN_GLOB, { result: '1234' })); - afterAll(fetchMock.restore); + beforeEach(() => fetchMock.get(mockGetUrl, mockGetPayload)); - const mockGetUrl = '/mock/get/url'; - const mockGetPayload = { get: 'payload' }; - fetchMock.get(mockGetUrl, mockGetPayload); + afterAll(() => fetchMock.restore()); afterEach(() => { fetchMock.reset(); diff --git a/superset-frontend/packages/superset-ui-core/test/connection/callApi/parseResponse.test.ts b/superset-frontend/packages/superset-ui-core/test/connection/callApi/parseResponse.test.ts index b08b5b8cb80c4..789910c977be4 100644 --- a/superset-frontend/packages/superset-ui-core/test/connection/callApi/parseResponse.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/connection/callApi/parseResponse.test.ts @@ -27,7 +27,7 @@ describe('parseResponse()', () => { fetchMock.get(LOGIN_GLOB, { result: '1234' }); }); - afterAll(fetchMock.restore); + afterAll(() => fetchMock.restore()); const mockGetUrl = '/mock/get/url'; const mockPostUrl = '/mock/post/url'; @@ -38,12 +38,14 @@ describe('parseResponse()', () => { const mockPostPayload = { post: 'payload' }; const mockErrorPayload = { status: 500, statusText: 'Internal error' }; - fetchMock.get(mockGetUrl, mockGetPayload); - fetchMock.post(mockPostUrl, mockPostPayload); - fetchMock.get(mockErrorUrl, () => Promise.reject(mockErrorPayload)); - fetchMock.get(mockNoParseUrl, new Response('test response')); + beforeEach(() => { + fetchMock.get(mockGetUrl, mockGetPayload); + fetchMock.post(mockPostUrl, mockPostPayload); + fetchMock.get(mockErrorUrl, () => Promise.reject(mockErrorPayload)); + fetchMock.get(mockNoParseUrl, new Response('test response')); + }); - afterEach(fetchMock.reset); + afterEach(() => fetchMock.reset()); it('returns a Promise', () => { const apiPromise = callApi({ url: mockGetUrl, method: 'GET' }); diff --git a/superset-frontend/packages/superset-ui-core/test/query/api/legacy/getDatasourceMetadata.test.ts b/superset-frontend/packages/superset-ui-core/test/query/api/legacy/getDatasourceMetadata.test.ts index 91ba94083d15e..c5bb3fcd83a1f 100644 --- a/superset-frontend/packages/superset-ui-core/test/query/api/legacy/getDatasourceMetadata.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/query/api/legacy/getDatasourceMetadata.test.ts @@ -22,9 +22,9 @@ import { getDatasourceMetadata } from '../../../../src/query/api/legacy'; import setupClientForTest from '../setupClientForTest'; describe('getFormData()', () => { - beforeAll(setupClientForTest); + beforeAll(() => setupClientForTest()); - afterEach(fetchMock.restore); + afterEach(() => fetchMock.restore()); it('returns datasource metadata for given datasource key', () => { const mockData = { diff --git a/superset-frontend/packages/superset-ui-core/test/query/api/legacy/getFormData.test.ts b/superset-frontend/packages/superset-ui-core/test/query/api/legacy/getFormData.test.ts index b5530560e3c3c..8bb3fb2979b0a 100644 --- a/superset-frontend/packages/superset-ui-core/test/query/api/legacy/getFormData.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/query/api/legacy/getFormData.test.ts @@ -22,9 +22,9 @@ import { getFormData } from '../../../../src/query/api/legacy'; import setupClientForTest from '../setupClientForTest'; describe('getFormData()', () => { - beforeAll(setupClientForTest); + beforeAll(() => setupClientForTest()); - afterEach(fetchMock.restore); + afterEach(() => fetchMock.restore()); const mockData = { datasource: '1__table', diff --git a/superset-frontend/packages/superset-ui-core/test/query/api/setupClientForTest.ts b/superset-frontend/packages/superset-ui-core/test/query/api/setupClientForTest.ts index 6df7cd84f591d..bc0c9783937ed 100644 --- a/superset-frontend/packages/superset-ui-core/test/query/api/setupClientForTest.ts +++ b/superset-frontend/packages/superset-ui-core/test/query/api/setupClientForTest.ts @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +// eslint-disable-next-line import/no-extraneous-dependencies -- The below fetch-mock import shouldn't be considered as direct dependency import fetchMock from 'fetch-mock'; import { SupersetClient } from '@superset-ui/core'; diff --git a/superset-frontend/packages/superset-ui-core/test/query/api/v1/getChartData.test.ts b/superset-frontend/packages/superset-ui-core/test/query/api/v1/getChartData.test.ts index 24d8dcbf91f76..1f6b3ce429951 100644 --- a/superset-frontend/packages/superset-ui-core/test/query/api/v1/getChartData.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/query/api/v1/getChartData.test.ts @@ -21,8 +21,8 @@ import { buildQueryContext, ApiV1 } from '@superset-ui/core'; import setupClientForTest from '../setupClientForTest'; describe('API v1 > getChartData()', () => { - beforeAll(setupClientForTest); - afterEach(fetchMock.restore); + beforeAll(() => setupClientForTest()); + afterEach(() => fetchMock.restore()); it('returns a promise of ChartDataResponse', async () => { const response = { diff --git a/superset-frontend/packages/superset-ui-core/test/query/api/v1/makeApi.test.ts b/superset-frontend/packages/superset-ui-core/test/query/api/v1/makeApi.test.ts index f8cd445250455..286ef35cc03b3 100644 --- a/superset-frontend/packages/superset-ui-core/test/query/api/v1/makeApi.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/query/api/v1/makeApi.test.ts @@ -22,8 +22,8 @@ import { makeApi, SupersetApiError } from '../../../../src/query'; import setupClientForTest from '../setupClientForTest'; describe('makeApi()', () => { - beforeAll(setupClientForTest); - afterEach(fetchMock.restore); + beforeAll(() => setupClientForTest()); + afterEach(() => fetchMock.restore()); it('should expose method and endpoint', () => { const api = makeApi({ diff --git a/superset-frontend/packages/superset-ui-core/test/time-comparison/fetchTimeRange.test.ts b/superset-frontend/packages/superset-ui-core/test/time-comparison/fetchTimeRange.test.ts index df1e2bc7d9b0d..8aedfc371d158 100644 --- a/superset-frontend/packages/superset-ui-core/test/time-comparison/fetchTimeRange.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/time-comparison/fetchTimeRange.test.ts @@ -25,7 +25,7 @@ import { formatTimeRangeComparison, } from '../../src/time-comparison/fetchTimeRange'; -afterEach(fetchMock.restore); +afterEach(() => fetchMock.restore()); test('generates proper time range string', () => { expect( @@ -56,7 +56,7 @@ test('generates a readable time range', () => { }); test('returns a formatted time range from response', async () => { - fetchMock.get("glob:*/api/v1/time_range/?q='Last+day'", { + fetchMock.get('glob:*/api/v1/time_range/?q=%27Last+day%27', { result: [ { since: '2021-04-13T00:00:00', @@ -73,7 +73,7 @@ test('returns a formatted time range from response', async () => { }); test('returns a formatted time range from empty response', async () => { - fetchMock.get("glob:*/api/v1/time_range/?q='Last+day'", { + fetchMock.get('glob:*/api/v1/time_range/?q=%27Last+day%27', { result: [], }); @@ -84,7 +84,7 @@ test('returns a formatted time range from empty response', async () => { }); test('returns a formatted error message from response', async () => { - fetchMock.getOnce("glob:*/api/v1/time_range/?q='Last+day'", { + fetchMock.get('glob:*/api/v1/time_range/?q=%27Last+day%27', { throws: new Response(JSON.stringify({ message: 'Network error' })), }); let timeRange = await fetchTimeRange('Last day'); @@ -92,8 +92,8 @@ test('returns a formatted error message from response', async () => { error: 'Network error', }); - fetchMock.getOnce( - "glob:*/api/v1/time_range/?q='Last+day'", + fetchMock.get( + 'glob:*/api/v1/time_range/?q=%27Last+day%27', { throws: new Error('Internal Server Error'), }, @@ -104,8 +104,8 @@ test('returns a formatted error message from response', async () => { error: 'Internal Server Error', }); - fetchMock.getOnce( - "glob:*/api/v1/time_range/?q='Last+day'", + fetchMock.get( + 'glob:*/api/v1/time_range/?q=%27Last+day%27', { throws: new Response(JSON.stringify({ statusText: 'Network error' }), { statusText: 'Network error', @@ -117,11 +117,11 @@ test('returns a formatted error message from response', async () => { expect(timeRange).toEqual({ error: 'Network error', }); -}); +}, 10000); test('fetchTimeRange with shift', async () => { fetchMock.getOnce( - "glob:*/api/v1/time_range/?q=!((timeRange:'Last+day'),(shift%3A'last%20month'%2CtimeRange%3A'Last%20day'))", + 'glob:*/api/v1/time_range/?q=!((timeRange:%27Last+day%27),(shift%3A%27last%20month%27%2CtimeRange%3A%27Last%20day%27))', { result: [ { diff --git a/superset-frontend/plugins/legacy-plugin-chart-partition/package.json b/superset-frontend/plugins/legacy-plugin-chart-partition/package.json index 0802eb23f6104..bce6238ef05eb 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-partition/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-partition/package.json @@ -30,7 +30,7 @@ "peerDependencies": { "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", - "@testing-library/jest-dom": "^5.17.0", + "@testing-library/jest-dom": "*", "@testing-library/react": "^12.1.5", "react": "^16.13.1", "react-dom": "^16.13.1" diff --git a/superset-frontend/plugins/plugin-chart-table/package.json b/superset-frontend/plugins/plugin-chart-table/package.json index 9bf34bfa180ff..da9d4e0b8985f 100644 --- a/superset-frontend/plugins/plugin-chart-table/package.json +++ b/superset-frontend/plugins/plugin-chart-table/package.json @@ -40,10 +40,10 @@ "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", "@testing-library/dom": "^8.20.1", - "@testing-library/jest-dom": "^5.11.6", + "@testing-library/jest-dom": "*", "@testing-library/react": "^12.1.5", - "@testing-library/react-hooks": "^5.0.3", - "@testing-library/user-event": "^12.7.0", + "@testing-library/react-hooks": "*", + "@testing-library/user-event": "*", "@types/classnames": "*", "@types/react": "*", "match-sorter": "^6.3.3", diff --git a/superset-frontend/spec/helpers/testing-library.tsx b/superset-frontend/spec/helpers/testing-library.tsx index 625531f926915..fade497a37e00 100644 --- a/superset-frontend/spec/helpers/testing-library.tsx +++ b/superset-frontend/spec/helpers/testing-library.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import '@testing-library/jest-dom/extend-expect'; +import '@testing-library/jest-dom'; import { ReactNode, ReactElement } from 'react'; import { render, diff --git a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx index a1251e8bcfa4e..ec77f08242010 100644 --- a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx +++ b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx @@ -24,7 +24,7 @@ import * as uiCore from '@superset-ui/core'; import { Provider } from 'react-redux'; import { supersetTheme, ThemeProvider } from '@superset-ui/core'; import { render, screen, act } from '@testing-library/react'; -import '@testing-library/jest-dom/extend-expect'; +import '@testing-library/jest-dom'; import userEvent from '@testing-library/user-event'; import * as utils from 'src/utils/common'; import ShareSqlLabQuery from 'src/SqlLab/components/ShareSqlLabQuery'; diff --git a/superset-frontend/src/SqlLab/components/SouthPane/SouthPane.test.tsx b/superset-frontend/src/SqlLab/components/SouthPane/SouthPane.test.tsx index 38ffa445c1612..3fc6df96fba4c 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/SouthPane.test.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/SouthPane.test.tsx @@ -18,7 +18,7 @@ */ import { render } from 'spec/helpers/testing-library'; import SouthPane from 'src/SqlLab/components/SouthPane'; -import '@testing-library/jest-dom/extend-expect'; +import '@testing-library/jest-dom'; import { STATUS_OPTIONS } from 'src/SqlLab/constants'; import { initialState, table, defaultQueryEditor } from 'src/SqlLab/fixtures'; import { denormalizeTimestamp } from '@superset-ui/core'; diff --git a/superset-frontend/src/components/AlteredSliceTag/AlteredSliceTag.test.jsx b/superset-frontend/src/components/AlteredSliceTag/AlteredSliceTag.test.jsx index a378201eabbef..a30d09e1b5941 100644 --- a/superset-frontend/src/components/AlteredSliceTag/AlteredSliceTag.test.jsx +++ b/superset-frontend/src/components/AlteredSliceTag/AlteredSliceTag.test.jsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import '@testing-library/jest-dom/extend-expect'; +import '@testing-library/jest-dom'; import { render, screen } from 'spec/helpers/testing-library'; import userEvent from '@testing-library/user-event'; import AlteredSliceTag, { diff --git a/superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.test.tsx b/superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.test.tsx index 9a6953902f6ef..38f4355679541 100644 --- a/superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.test.tsx +++ b/superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.test.tsx @@ -18,7 +18,7 @@ */ import { render } from '@testing-library/react'; -import '@testing-library/jest-dom/extend-expect'; +import '@testing-library/jest-dom'; import { ErrorLevel, ErrorSource, diff --git a/superset-frontend/src/components/ErrorMessage/MarshmallowErrorMessage.test.tsx b/superset-frontend/src/components/ErrorMessage/MarshmallowErrorMessage.test.tsx index 969e0c9d0ab74..6b2e9af5e9d47 100644 --- a/superset-frontend/src/components/ErrorMessage/MarshmallowErrorMessage.test.tsx +++ b/superset-frontend/src/components/ErrorMessage/MarshmallowErrorMessage.test.tsx @@ -17,8 +17,8 @@ * under the License. */ +import '@testing-library/jest-dom'; import { render, screen, fireEvent } from '@testing-library/react'; -import '@testing-library/jest-dom/extend-expect'; import { ErrorLevel, ErrorTypeEnum, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx index dbb1c2fc479a1..a56e969f1be68 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx @@ -17,7 +17,7 @@ * under the License. */ import { Preset } from '@superset-ui/core'; -import userEvent, { specialChars } from '@testing-library/user-event'; +import userEvent from '@testing-library/user-event'; import fetchMock from 'fetch-mock'; import chartQueries from 'spec/fixtures/mockChartQueries'; import { dashboardLayout } from 'spec/fixtures/mockDashboardLayout'; @@ -287,7 +287,7 @@ test('validates the column', async () => { test.skip('validates the default value', async () => { defaultRender(noTemporalColumnsState()); expect(await screen.findByText('birth_names')).toBeInTheDocument(); - userEvent.type(screen.getByRole('combobox'), `Column A${specialChars.enter}`); + userEvent.type(screen.getByRole('combobox'), `Column A{Enter}`); userEvent.click(getCheckbox(DEFAULT_VALUE_REGEX)); await waitFor(() => { expect( diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/tests/CurrentCalendarFrame.test.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/tests/CurrentCalendarFrame.test.tsx index 2b1f0754b410f..a3c6de5fc0d61 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/tests/CurrentCalendarFrame.test.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/tests/CurrentCalendarFrame.test.tsx @@ -17,7 +17,7 @@ * under the License. */ import { render } from '@testing-library/react'; -import '@testing-library/jest-dom/extend-expect'; // For advanced DOM assertions +import '@testing-library/jest-dom'; // For advanced DOM assertions import { CurrentCalendarFrame } from '../components/CurrentCalendarFrame'; import { CurrentWeek } from '../types'; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.test.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.test.tsx index 2657e5429531a..c2ab5fbf9a18a 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.test.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.test.tsx @@ -18,7 +18,7 @@ */ import { render, fireEvent } from '@testing-library/react'; -import '@testing-library/jest-dom/extend-expect'; +import '@testing-library/jest-dom'; import { Provider } from 'react-redux'; import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; diff --git a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/OAuth2ClientField.test.tsx b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/OAuth2ClientField.test.tsx index 1752eb1960727..6e86835facbc4 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/OAuth2ClientField.test.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/OAuth2ClientField.test.tsx @@ -18,7 +18,7 @@ */ import { render, fireEvent } from '@testing-library/react'; -import '@testing-library/jest-dom/extend-expect'; +import '@testing-library/jest-dom'; import { ThemeProvider, supersetTheme } from '@superset-ui/core'; import { DatabaseObject } from 'src/features/databases/types'; import { OAuth2ClientField } from './OAuth2ClientField'; diff --git a/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx b/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx index 49b80fc96112e..2f8eafeb7b0cb 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx @@ -1409,6 +1409,8 @@ describe('DatabaseModal', () => { const importDbButton = screen.getByTestId( 'import-database-btn', ) as HTMLInputElement; + importDbButton.type = 'file'; + importDbButton.files = {} as FileList; expect(importDbButton).toBeVisible(); const testFile = new File([new ArrayBuffer(1)], 'model_export.zip'); diff --git a/superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx b/superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx index 8a6f4fe92fb31..39ce9506af2e9 100644 --- a/superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx +++ b/superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx @@ -616,7 +616,7 @@ test('CSV, form post', async () => { const inputElement = document.querySelector('input[type="file"]'); if (inputElement) { - userEvent.upload(inputElement, file); + userEvent.upload(inputElement as HTMLElement, file); } const selectDatabase = screen.getByRole('combobox', { @@ -673,7 +673,7 @@ test('Excel, form post', async () => { const inputElement = document.querySelector('input[type="file"]'); if (inputElement) { - userEvent.upload(inputElement, file); + userEvent.upload(inputElement as HTMLElement, file); } const selectDatabase = screen.getByRole('combobox', { @@ -734,7 +734,7 @@ test('Columnar, form post', async () => { const inputElement = document.querySelector('input[type="file"]'); if (inputElement) { - userEvent.upload(inputElement, file); + userEvent.upload(inputElement as HTMLElement, file); } const selectDatabase = screen.getByRole('combobox', {