diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index fa6664d315dd6..d7da0cd0bd30d 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -229,7 +229,7 @@ "enzyme-adapter-react-16": "^1.15.7", "esbuild": "^0.20.0", "esbuild-loader": "^4.2.2", - "eslint": "^8.56.0", + "eslint": "^8.57.1", "eslint-config-airbnb": "^19.0.4", "eslint-config-prettier": "^7.2.0", "eslint-import-resolver-typescript": "^3.7.0", @@ -237,7 +237,7 @@ "eslint-plugin-file-progress": "^1.5.0", "eslint-plugin-import": "^2.24.2", "eslint-plugin-jest": "^27.8.0", - "eslint-plugin-jest-dom": "^3.6.5", + "eslint-plugin-jest-dom": "^5.5.0", "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-lodash": "^7.4.0", "eslint-plugin-no-only-tests": "^3.3.0", @@ -5450,7 +5450,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.56.0", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true, "license": "MIT", "engines": { @@ -5554,11 +5556,14 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", "dev": true, "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", + "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", "minimatch": "^3.0.5" }, @@ -5567,11 +5572,13 @@ } }, "node_modules/@humanwhocodes/config-array/node_modules/debug": { - "version": "4.3.4", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -5583,7 +5590,9 @@ } }, "node_modules/@humanwhocodes/config-array/node_modules/ms": { - "version": "2.1.2", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, "license": "MIT" }, @@ -5600,7 +5609,10 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.2", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", "dev": true, "license": "BSD-3-Clause" }, @@ -23832,15 +23844,18 @@ } }, "node_modules/eslint": { - "version": "8.56.0", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -24212,103 +24227,29 @@ } }, "node_modules/eslint-plugin-jest-dom": { - "version": "3.6.5", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest-dom/-/eslint-plugin-jest-dom-5.5.0.tgz", + "integrity": "sha512-CRlXfchTr7EgC3tDI7MGHY6QjdJU5Vv2RPaeeGtkXUHnKZf04kgzMPIJUXt4qKCvYWVVIEo9ut9Oq1vgXAykEA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.9.6", - "@testing-library/dom": "^7.28.1", + "@babel/runtime": "^7.16.3", "requireindex": "^1.2.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0", + "node": "^12.22.0 || ^14.17.0 || >=16.0.0", "npm": ">=6", "yarn": ">=1" }, "peerDependencies": { - "eslint": ">=6.8" - } - }, - "node_modules/eslint-plugin-jest-dom/node_modules/@jest/types": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", - "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0" - }, - "engines": { - "node": ">= 10.14.2" - } - }, - "node_modules/eslint-plugin-jest-dom/node_modules/@testing-library/dom": { - "version": "7.31.2", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-7.31.2.tgz", - "integrity": "sha512-3UqjCpey6HiTZT92vODYLPxTBWlM8ZOOjr3LX5F37/VRipW2M1kX6I/Cm4VXzteZqfGfagg8yXywpcOgQBlNsQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/runtime": "^7.12.5", - "@types/aria-query": "^4.2.0", - "aria-query": "^4.2.2", - "chalk": "^4.1.0", - "dom-accessibility-api": "^0.5.6", - "lz-string": "^1.4.4", - "pretty-format": "^26.6.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-plugin-jest-dom/node_modules/@types/aria-query": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.2.tgz", - "integrity": "sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig==", - "dev": true - }, - "node_modules/eslint-plugin-jest-dom/node_modules/@types/istanbul-reports": { - "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": "*" - } - }, - "node_modules/eslint-plugin-jest-dom/node_modules/@types/yargs": { - "version": "15.0.19", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.19.tgz", - "integrity": "sha512-2XUaGVmyQjgyAZldf0D0c14vvo/yv0MhQBSTJcejMMaitsn3nxCB6TmH4G0ZQf+uxROOa9mpanoSm8h6SG/1ZA==", - "dev": true, - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/eslint-plugin-jest-dom/node_modules/pretty-format": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", - "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", - "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^17.0.1" + "@testing-library/dom": "^8.0.0 || ^9.0.0 || ^10.0.0", + "eslint": "^6.8.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" }, - "engines": { - "node": ">= 10" + "peerDependenciesMeta": { + "@testing-library/dom": { + "optional": true + } } }, - "node_modules/eslint-plugin-jest-dom/node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true - }, "node_modules/eslint-plugin-jsx-a11y": { "version": "6.5.1", "dev": true, @@ -61527,7 +61468,9 @@ } }, "@eslint/js": { - "version": "8.56.0", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true }, "@fal-works/esbuild-plugin-global-externals": { @@ -61620,23 +61563,29 @@ } }, "@humanwhocodes/config-array": { - "version": "0.11.14", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", "dev": true, "requires": { - "@humanwhocodes/object-schema": "^2.0.2", + "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", "minimatch": "^3.0.5" }, "dependencies": { "debug": { - "version": "4.3.4", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "requires": { - "ms": "2.1.2" + "ms": "^2.1.3" } }, "ms": { - "version": "2.1.2", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true } } @@ -61646,7 +61595,9 @@ "dev": true }, "@humanwhocodes/object-schema": { - "version": "2.0.2", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "dev": true }, "@hutson/parse-repository-url": { @@ -76262,14 +76213,16 @@ } }, "eslint": { - "version": "8.56.0", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -76668,85 +76621,13 @@ } }, "eslint-plugin-jest-dom": { - "version": "3.6.5", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest-dom/-/eslint-plugin-jest-dom-5.5.0.tgz", + "integrity": "sha512-CRlXfchTr7EgC3tDI7MGHY6QjdJU5Vv2RPaeeGtkXUHnKZf04kgzMPIJUXt4qKCvYWVVIEo9ut9Oq1vgXAykEA==", "dev": true, "requires": { - "@babel/runtime": "^7.9.6", - "@testing-library/dom": "^7.28.1", + "@babel/runtime": "^7.16.3", "requireindex": "^1.2.0" - }, - "dependencies": { - "@jest/types": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", - "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0" - } - }, - "@testing-library/dom": { - "version": "7.31.2", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-7.31.2.tgz", - "integrity": "sha512-3UqjCpey6HiTZT92vODYLPxTBWlM8ZOOjr3LX5F37/VRipW2M1kX6I/Cm4VXzteZqfGfagg8yXywpcOgQBlNsQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/runtime": "^7.12.5", - "@types/aria-query": "^4.2.0", - "aria-query": "^4.2.2", - "chalk": "^4.1.0", - "dom-accessibility-api": "^0.5.6", - "lz-string": "^1.4.4", - "pretty-format": "^26.6.2" - } - }, - "@types/aria-query": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.2.tgz", - "integrity": "sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig==", - "dev": true - }, - "@types/istanbul-reports": { - "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": "*" - } - }, - "@types/yargs": { - "version": "15.0.19", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.19.tgz", - "integrity": "sha512-2XUaGVmyQjgyAZldf0D0c14vvo/yv0MhQBSTJcejMMaitsn3nxCB6TmH4G0ZQf+uxROOa9mpanoSm8h6SG/1ZA==", - "dev": true, - "requires": { - "@types/yargs-parser": "*" - } - }, - "pretty-format": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", - "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^17.0.1" - } - }, - "react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true - } } }, "eslint-plugin-jsx-a11y": { diff --git a/superset-frontend/package.json b/superset-frontend/package.json index 70c7d03ca1fd8..092f0c6833dd7 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -304,7 +304,7 @@ "eslint-plugin-file-progress": "^1.5.0", "eslint-plugin-import": "^2.24.2", "eslint-plugin-jest": "^27.8.0", - "eslint-plugin-jest-dom": "^3.6.5", + "eslint-plugin-jest-dom": "^5.5.0", "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-lodash": "^7.4.0", "eslint-plugin-no-only-tests": "^3.3.0", diff --git a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/EstimateQueryCostButton.test.tsx b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/EstimateQueryCostButton.test.tsx index 9a4dd6e04f9da..7668020cd3587 100644 --- a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/EstimateQueryCostButton.test.tsx +++ b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/EstimateQueryCostButton.test.tsx @@ -57,7 +57,7 @@ describe('EstimateQueryCostButton', () => { it('renders EstimateQueryCostButton', async () => { const { queryByText } = setup({}, mockStore(initialState)); - expect(queryByText('Estimate cost')).toBeTruthy(); + expect(queryByText('Estimate cost')).toBeInTheDocument(); }); it('renders label for selected query', async () => { @@ -66,7 +66,7 @@ describe('EstimateQueryCostButton', () => { mockStore(initialState), ); - expect(queryByText('Estimate selected query cost')).toBeTruthy(); + expect(queryByText('Estimate selected query cost')).toBeInTheDocument(); }); it('renders label for selected query from unsaved', async () => { @@ -84,7 +84,7 @@ describe('EstimateQueryCostButton', () => { }), ); - expect(queryByText('Estimate selected query cost')).toBeTruthy(); + expect(queryByText('Estimate selected query cost')).toBeInTheDocument(); }); it('renders estimation error result', async () => { @@ -103,10 +103,10 @@ describe('EstimateQueryCostButton', () => { }), ); - expect(queryByText('Estimate cost')).toBeTruthy(); + expect(queryByText('Estimate cost')).toBeInTheDocument(); fireEvent.click(getByText('Estimate cost')); - expect(queryByText('Estimate error')).toBeTruthy(); + expect(queryByText('Estimate error')).toBeInTheDocument(); }); it('renders estimation success result', async () => { @@ -126,9 +126,9 @@ describe('EstimateQueryCostButton', () => { }), ); - expect(queryByText('Estimate cost')).toBeTruthy(); + expect(queryByText('Estimate cost')).toBeInTheDocument(); fireEvent.click(getByText('Estimate cost')); - expect(queryByText('Total cost')).toBeTruthy(); + expect(queryByText('Total cost')).toBeInTheDocument(); }); }); diff --git a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx index eddd1acb90e04..e619f6a5f9239 100644 --- a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx +++ b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx @@ -54,7 +54,7 @@ describe('ExploreCtasResultsButton', () => { it('renders', async () => { const { queryByText } = setup({}, mockStore(initialState)); - expect(queryByText('Explore')).toBeTruthy(); + expect(queryByText('Explore')).toBeInTheDocument(); }); it('visualize results', async () => { diff --git a/superset-frontend/src/SqlLab/components/ExploreResultsButton/ExploreResultsButton.test.tsx b/superset-frontend/src/SqlLab/components/ExploreResultsButton/ExploreResultsButton.test.tsx index 7ab859512a346..a8eaaf5da7447 100644 --- a/superset-frontend/src/SqlLab/components/ExploreResultsButton/ExploreResultsButton.test.tsx +++ b/superset-frontend/src/SqlLab/components/ExploreResultsButton/ExploreResultsButton.test.tsx @@ -37,14 +37,14 @@ describe('ExploreResultsButton', () => { database: { allows_subquery: true }, }); - expect(queryByText('Create Chart')).toBeTruthy(); + expect(queryByText('Create Chart')).toBeInTheDocument(); expect(screen.getByRole('button', { name: 'Create Chart' })).toBeEnabled(); }); it('renders disabled if subquery not allowed', async () => { const { queryByText } = setup(jest.fn()); - expect(queryByText('Create Chart')).toBeTruthy(); + expect(queryByText('Create Chart')).toBeInTheDocument(); expect(screen.getByRole('button', { name: 'Create Chart' })).toBeDisabled(); }); }); diff --git a/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx b/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx index 0045e993eb82d..565cebe0a5160 100644 --- a/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx +++ b/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx @@ -400,7 +400,7 @@ describe('ResultSet', () => { name: /fetch data preview/i, }), ).toBeVisible(); - expect(screen.queryByRole('table')).toBe(null); + expect(screen.queryByRole('table')).not.toBeInTheDocument(); }); test('Async queries - renders "Refetch results" button when a query has no results', () => { @@ -429,7 +429,7 @@ describe('ResultSet', () => { name: /refetch results/i, }), ).toBeVisible(); - expect(screen.queryByRole('table')).toBe(null); + expect(screen.queryByRole('table')).not.toBeInTheDocument(); }); test('Async queries - renders on the first call', () => { @@ -454,12 +454,12 @@ describe('ResultSet', () => { screen.queryByRole('button', { name: /fetch data preview/i, }), - ).toBe(null); + ).not.toBeInTheDocument(); expect( screen.queryByRole('button', { name: /refetch results/i, }), - ).toBe(null); + ).not.toBeInTheDocument(); }); test('should allow download as CSV when user has permission to export data', async () => { diff --git a/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx b/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx index 9507c280a0f0c..03fad47bbe012 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx @@ -59,9 +59,9 @@ const setup = (queryEditor: QueryEditor, store?: Store) => describe('SqlEditorTabHeader', () => { it('renders name', () => { const { queryByText } = setup(defaultQueryEditor, mockStore(initialState)); - expect(queryByText(defaultQueryEditor.name)).toBeTruthy(); - expect(queryByText(extraQueryEditor1.name)).toBeFalsy(); - expect(queryByText(extraQueryEditor2.name)).toBeFalsy(); + expect(queryByText(defaultQueryEditor.name)).toBeInTheDocument(); + expect(queryByText(extraQueryEditor1.name)).not.toBeInTheDocument(); + expect(queryByText(extraQueryEditor2.name)).not.toBeInTheDocument(); }); it('renders name from unsaved changes', () => { @@ -79,10 +79,10 @@ describe('SqlEditorTabHeader', () => { }, }), ); - expect(queryByText(expectedTitle)).toBeTruthy(); - expect(queryByText(defaultQueryEditor.name)).toBeFalsy(); - expect(queryByText(extraQueryEditor1.name)).toBeFalsy(); - expect(queryByText(extraQueryEditor2.name)).toBeFalsy(); + expect(queryByText(expectedTitle)).toBeInTheDocument(); + expect(queryByText(defaultQueryEditor.name)).not.toBeInTheDocument(); + expect(queryByText(extraQueryEditor1.name)).not.toBeInTheDocument(); + expect(queryByText(extraQueryEditor2.name)).not.toBeInTheDocument(); }); it('renders current name for unrelated unsaved changes', () => { @@ -100,10 +100,10 @@ describe('SqlEditorTabHeader', () => { }, }), ); - expect(queryByText(defaultQueryEditor.name)).toBeTruthy(); - expect(queryByText(unrelatedTitle)).toBeFalsy(); - expect(queryByText(extraQueryEditor1.name)).toBeFalsy(); - expect(queryByText(extraQueryEditor2.name)).toBeFalsy(); + expect(queryByText(defaultQueryEditor.name)).toBeInTheDocument(); + expect(queryByText(unrelatedTitle)).not.toBeInTheDocument(); + expect(queryByText(extraQueryEditor1.name)).not.toBeInTheDocument(); + expect(queryByText(extraQueryEditor2.name)).not.toBeInTheDocument(); }); describe('with dropdown menus', () => { diff --git a/superset-frontend/src/SqlLab/components/TabbedSqlEditors/TabbedSqlEditors.test.tsx b/superset-frontend/src/SqlLab/components/TabbedSqlEditors/TabbedSqlEditors.test.tsx index d4474fba286e2..f1468fe05a704 100644 --- a/superset-frontend/src/SqlLab/components/TabbedSqlEditors/TabbedSqlEditors.test.tsx +++ b/superset-frontend/src/SqlLab/components/TabbedSqlEditors/TabbedSqlEditors.test.tsx @@ -118,7 +118,9 @@ test('should removeQueryEditor', async () => { fireEvent.click(closeButton); } await waitFor(() => expect(getAllByRole('tab').length).toEqual(tabCount - 1)); - expect(queryByText(initialState.sqlLab.queryEditors[0].name)).toBeFalsy(); + expect( + queryByText(initialState.sqlLab.queryEditors[0].name), + ).not.toBeInTheDocument(); }); test('should add new query editor', async () => { const { getAllByLabelText, getAllByRole } = setup(undefined, initialState); diff --git a/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.test.tsx b/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.test.tsx index b1afd8ad36cb7..88b8defa263cc 100644 --- a/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.test.tsx +++ b/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.test.tsx @@ -64,7 +64,7 @@ test('not renders tooltip on hover with hideTooltip props', async () => { }); userEvent.hover(screen.getByText('Copy')); const tooltip = screen.queryByRole('tooltip'); - expect(tooltip).toBe(null); + expect(tooltip).not.toBeInTheDocument(); }); test('triggers onCopyEnd', async () => { diff --git a/superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx b/superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx index 415d7f053dfce..b7ce92be3fa61 100644 --- a/superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx +++ b/superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx @@ -50,8 +50,8 @@ describe('FilterableTable', () => { }; const { getByText, queryByText } = render(); expect(getByText(props.filterText)).toBeInTheDocument(); - expect(queryByText('b2')).toBeFalsy(); - expect(queryByText('b3')).toBeFalsy(); + expect(queryByText('b2')).not.toBeInTheDocument(); + expect(queryByText('b3')).not.toBeInTheDocument(); }); it('filters on a number', () => { const props = { @@ -60,8 +60,8 @@ describe('FilterableTable', () => { }; const { getByText, queryByText } = render(); expect(getByText('b2')).toBeInTheDocument(); - expect(queryByText('b1')).toBeFalsy(); - expect(queryByText('b3')).toBeFalsy(); + expect(queryByText('b1')).not.toBeInTheDocument(); + expect(queryByText('b3')).not.toBeInTheDocument(); }); }); diff --git a/superset-frontend/src/components/Popover/Popover.test.tsx b/superset-frontend/src/components/Popover/Popover.test.tsx index b1dd3aeb18230..cf4cb65da4bfd 100644 --- a/superset-frontend/src/components/Popover/Popover.test.tsx +++ b/superset-frontend/src/components/Popover/Popover.test.tsx @@ -30,12 +30,12 @@ test('should render', () => { test('should render a title when visible', () => { render(); - expect(screen.getByText('Popover title')).toBeTruthy(); + expect(screen.getByText('Popover title')).toBeInTheDocument(); }); test('should render some content when visible', () => { render(); - expect(screen.getByText('Content sample')).toBeTruthy(); + expect(screen.getByText('Content sample')).toBeInTheDocument(); }); test('it should not render a title or content when not visible', () => { diff --git a/superset-frontend/src/components/TableSelector/TableSelector.test.tsx b/superset-frontend/src/components/TableSelector/TableSelector.test.tsx index cfd12674ecca2..242bf33253bd6 100644 --- a/superset-frontend/src/components/TableSelector/TableSelector.test.tsx +++ b/superset-frontend/src/components/TableSelector/TableSelector.test.tsx @@ -113,7 +113,9 @@ test('skips select all options', async () => { expect( await screen.findByRole('option', { name: 'table_a' }), ).toBeInTheDocument(); - expect(screen.queryByRole('option', { name: /Select All/i })).toBeFalsy(); + expect( + screen.queryByRole('option', { name: /Select All/i }), + ).not.toBeInTheDocument(); }); test('renders table options without Select All option', async () => { diff --git a/superset-frontend/src/dashboard/components/AnchorLink/AnchorLink.test.tsx b/superset-frontend/src/dashboard/components/AnchorLink/AnchorLink.test.tsx index 5aeb451561143..86230bebad5ab 100644 --- a/superset-frontend/src/dashboard/components/AnchorLink/AnchorLink.test.tsx +++ b/superset-frontend/src/dashboard/components/AnchorLink/AnchorLink.test.tsx @@ -55,7 +55,7 @@ describe('AnchorLink', () => { { useRedux: true }, ); expect(container.querySelector(`#${props.id}`)).toBeInTheDocument(); - expect(queryByRole('button')).toBe(null); + expect(queryByRole('button')).not.toBeInTheDocument(); }); it('should render short link button', () => { diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx index 43e207d8c8821..1a0b73165ada2 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx @@ -128,7 +128,7 @@ describe('DashboardBuilder', () => { it('should render a DragDroppable DashboardHeader', () => { const { queryByTestId } = setup(); const header = queryByTestId('dashboard-header-container'); - expect(header).toBeTruthy(); + expect(header).toBeInTheDocument(); }); it('should render a Sticky top-level Tabs if the dashboard has tabs', async () => { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/FilterScope.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/FilterScope.test.tsx index aece899a16078..cca776af15647 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/FilterScope.test.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/FilterScope.test.tsx @@ -83,7 +83,7 @@ describe('FilterScope', () => { render(); fireEvent.click(screen.getByText('Scoping')); fireEvent.click(screen.getByLabelText('Apply to specific panels')); - expect(screen.getByRole('tree')).not.toBe(null); + expect(screen.getByRole('tree')).toBeInTheDocument(); fireEvent.click(getTreeSwitcher(2)); fireEvent.click(screen.getByText('CHART_ID2')); await waitFor(() => @@ -100,7 +100,7 @@ describe('FilterScope', () => { render(); fireEvent.click(screen.getByText('Scoping')); fireEvent.click(screen.getByLabelText('Apply to specific panels')); - expect(screen.getByRole('tree')).not.toBe(null); + expect(screen.getByRole('tree')).toBeInTheDocument(); fireEvent.click(getTreeSwitcher(2)); fireEvent.click(screen.getByText('CHART_ID2')); fireEvent.click(screen.getByText('tab1')); diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanel.test.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanel.test.tsx index c24bd876f11b7..bdd93d38f034c 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanel.test.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanel.test.tsx @@ -240,7 +240,7 @@ test('should not render a save dataset modal when datasource is not query or dat render(, { useRedux: true, useDnd: true }); expect(await screen.findByText(/metrics/i)).toBeInTheDocument(); - expect(screen.queryByText(/create a dataset/i)).toBe(null); + expect(screen.queryByText(/create a dataset/i)).not.toBeInTheDocument(); }); test('should render only droppable metrics and columns', async () => { diff --git a/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx b/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx index 4576e1a118330..c565781406a64 100644 --- a/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx +++ b/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx @@ -159,7 +159,7 @@ test('renders chart in standalone mode', () => { explore: { ...reduxState.explore, standalone: true }, }, }); - expect(queryByTestId('standalone-app')).toBeTruthy(); + expect(queryByTestId('standalone-app')).toBeInTheDocument(); }); test('generates a different form_data param when one is provided and is mounting', async () => { diff --git a/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeControl.test.tsx b/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeControl.test.tsx index 264e6968c8d27..caad3f93d9507 100644 --- a/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeControl.test.tsx +++ b/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeControl.test.tsx @@ -56,7 +56,7 @@ test('should render', async () => { test('should display a label', async () => { setup(); - expect(await screen.findByText('Color scheme')).toBeTruthy(); + expect(await screen.findByText('Color scheme')).toBeInTheDocument(); }); test('should not display an alert icon if hasCustomLabelsColor=false', async () => { diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/AdhocFilterEditPopoverSimpleTabContent.test.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/AdhocFilterEditPopoverSimpleTabContent.test.tsx index 4bbc3af2f6cab..0095377570872 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/AdhocFilterEditPopoverSimpleTabContent.test.tsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/AdhocFilterEditPopoverSimpleTabContent.test.tsx @@ -547,6 +547,6 @@ describe('AdhocFilterEditPopoverSimpleTabContent Advanced data Type Test', () => userEvent.type(operatorValueField, '{enter}'); }); - expect(screen.getByText('EQUALS')).toBeTruthy(); + expect(screen.getByText('EQUALS')).toBeInTheDocument(); }); }); diff --git a/superset-frontend/src/explore/components/controls/OptionControls/OptionControls.test.tsx b/superset-frontend/src/explore/components/controls/OptionControls/OptionControls.test.tsx index f48bad338889a..375b5f9c9035a 100644 --- a/superset-frontend/src/explore/components/controls/OptionControls/OptionControls.test.tsx +++ b/superset-frontend/src/explore/components/controls/OptionControls/OptionControls.test.tsx @@ -62,7 +62,7 @@ test('should render', async () => { test('should display a label', async () => { setup(); - expect(await screen.findByText('Test label')).toBeTruthy(); + expect(await screen.findByText('Test label')).toBeInTheDocument(); }); test('should display a certification icon if saved metric is certified', async () => { @@ -73,7 +73,7 @@ test('should display a certification icon if saved metric is certified', async ( }, }); await waitFor(() => { - expect(screen.queryByText('Test label')).toBeFalsy(); + expect(screen.queryByText('Test label')).not.toBeInTheDocument(); expect(container.querySelector('.metric-option > svg')).toBeInTheDocument(); }); }); diff --git a/superset-frontend/src/features/alerts/AlertReportModal.test.tsx b/superset-frontend/src/features/alerts/AlertReportModal.test.tsx index fa09b777e3ffd..d0adc43318ca3 100644 --- a/superset-frontend/src/features/alerts/AlertReportModal.test.tsx +++ b/superset-frontend/src/features/alerts/AlertReportModal.test.tsx @@ -484,7 +484,7 @@ test('removes ignore cache checkbox when chart is selected', async () => { screen.queryByRole('checkbox', { name: /ignore cache when generating report/i, }), - ).toBe(null); + ).not.toBeInTheDocument(); }); test('does not show screenshot width when csv is selected', async () => {