You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2025/09/28 04:45:50 UTC
(superset) branch consolidate-linting created (now acb3c53909)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a change to branch consolidate-linting
in repository https://gitbox.apache.org/repos/asf/superset.git
at acb3c53909 chore(frontend): Consolidate ESLint configurations
This branch includes the following new commits:
new acb3c53909 chore(frontend): Consolidate ESLint configurations
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(superset) 01/01: chore(frontend): Consolidate ESLint configurations
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch consolidate-linting
in repository https://gitbox.apache.org/repos/asf/superset.git
commit acb3c53909c681cf1e31cf0064fe7a78588ced48
Author: Evan Rusackas <ev...@rusackas.com>
AuthorDate: Sat Sep 27 21:44:51 2025 -0700
chore(frontend): Consolidate ESLint configurations
- Remove redundant ESLint configs from spec/, packages/superset-ui-core/,
packages/generator-superset/, and spec/javascripts/dashboard/
- Consolidate test-specific rules into main .eslintrc.js with dedicated
override blocks
- Add jest/consistent-test-it rule for consistent test naming
- Update test files to use consistent 'it' instead of 'test'
- Keep cypress-base/.eslintrc separate as it will be removed with Cypress
deprecation
This reduces ESLint config files from 6 to 2, simplifying maintenance
while preserving necessary distinctions for different file types.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <no...@anthropic.com>
---
superset-frontend/.eslintrc.js | 30 ++++++
superset-frontend/package-lock.json | 2 +-
.../packages/generator-superset/.eslintrc | 25 -----
.../test/operators/aggregateOperator.test.ts | 10 +-
.../packages/superset-ui-core/.eslintrc | 68 -------------
.../test/MixedTimeseries/transformProps.test.ts | 4 +-
.../test/Timeseries/transformers.test.ts | 16 ++--
superset-frontend/spec/.eslintrc | 40 --------
.../spec/javascripts/dashboard/.eslintrc | 30 ------
.../src/SqlLab/actions/sqlLab.test.js | 4 +-
.../components/QueryTable/QueryTable.test.tsx | 10 +-
.../SqlLab/components/ResultSet/ResultSet.test.tsx | 42 ++++----
.../RunQueryActionButton.test.tsx | 16 ++--
.../SaveDatasetActionButton.test.tsx | 4 +-
.../TabbedSqlEditors/TabbedSqlEditors.test.tsx | 10 +-
.../components/TablePreview/TablePreview.test.tsx | 4 +-
.../ErrorMessage/MarshmallowErrorMessage.test.tsx | 8 +-
.../src/components/GridTable/HeaderMenu.test.tsx | 10 +-
.../src/components/Tag/utils.test.tsx | 14 +--
.../src/components/TagsList/TagsList.test.tsx | 10 +-
.../components/FiltersBadge/FiltersBadge.test.tsx | 8 +-
.../PropertiesModal/PropertiesModal.test.tsx | 20 ++--
.../DownloadMenuItems/DownloadScreenshot.test.tsx | 12 +--
.../ScopingModal/ChartsScopingListPanel.test.tsx | 8 +-
.../ScopingModal/ScopingModal.test.tsx | 10 +-
.../nativeFilters/FilterBar/utils.test.ts | 30 +++---
.../FiltersConfigForm/getControlItemsMap.test.tsx | 4 +-
.../FiltersConfigModal/NativeFiltersModal.test.tsx | 4 +-
superset-frontend/src/embedded/utils.test.ts | 6 +-
.../src/explore/actions/exploreActions.test.js | 2 +-
.../src/explore/actions/saveModalActions.test.ts | 12 +--
.../components/ControlPanelsContainer.test.tsx | 8 +-
.../DataTablesPane/test/DataTablesPane.test.tsx | 16 ++--
.../test/ResultsPaneOnDashboard.test.tsx | 12 +--
.../DataTablesPane/test/SamplesPane.test.tsx | 6 +-
.../DatasourcePanel/DatasourcePanel.test.tsx | 2 +-
.../ExploreChartHeader/ExploreChartHeader.test.tsx | 52 +++++-----
.../ExploreChartPanel/ExploreChartPanel.test.jsx | 14 +--
.../ColorBreakpointOption.test.tsx | 16 ++--
.../ColorBreakpointPopoverControl.test.tsx | 32 +++----
.../ColorBreakpointPopoverTrigger.test.tsx | 28 +++---
.../ColorBreakpointsControl.test.tsx | 22 ++---
.../DndFilterSelect.test.tsx | 4 +-
.../DndColumnSelectControl/Option.test.tsx | 8 +-
.../AdhocFilterControl/AdhocFilterControl.test.tsx | 4 +-
.../controlUtils/standardizedFormData.test.ts | 14 +--
.../src/features/dashboards/DashboardCard.test.tsx | 10 +-
.../databases/DatabaseModal/index.test.tsx | 106 ++++++++++-----------
.../UploadDataModel/UploadDataModal.test.tsx | 44 ++++-----
.../AddDataset/DatasetPanel/DatasetPanel.test.tsx | 12 +--
.../datasets/AddDataset/Footer/Footer.test.tsx | 16 ++--
.../datasets/AddDataset/Header/Header.test.tsx | 6 +-
.../src/features/tags/BulkTagModal.test.tsx | 12 +--
.../src/features/themes/ThemeModal.test.tsx | 24 ++---
.../components/Select/SelectFilterPlugin.test.tsx | 26 ++---
.../src/hooks/apiResources/schemas.test.ts | 8 +-
.../src/hooks/apiResources/tables.test.ts | 10 +-
.../src/hooks/useDebounceValue.test.ts | 2 +-
superset-frontend/src/pages/Chart/Chart.test.tsx | 10 +-
59 files changed, 432 insertions(+), 565 deletions(-)
diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js
index bd87c8c6a4..d676330c7d 100644
--- a/superset-frontend/.eslintrc.js
+++ b/superset-frontend/.eslintrc.js
@@ -272,6 +272,10 @@ module.exports = {
{
files: ['packages/**'],
rules: {
+ 'import/no-extraneous-dependencies': [
+ 'error',
+ { devDependencies: true },
+ ],
'no-restricted-imports': [
'error',
{
@@ -323,6 +327,12 @@ module.exports = {
'*.stories.tsx',
'*.stories.jsx',
'fixtures.*',
+ '**/test/**/*',
+ '**/tests/**/*',
+ 'spec/**/*',
+ '**/fixtures/**/*',
+ '**/__mocks__/**/*',
+ '**/spec/**/*',
],
excludedFiles: 'cypress-base/cypress/**/*',
plugins: ['jest', 'jest-dom', 'no-only-tests', 'testing-library'],
@@ -346,7 +356,9 @@ module.exports = {
devDependencies: true,
},
],
+ 'jest/consistent-test-it': 'error',
'no-only-tests/no-only-tests': 'error',
+ 'prefer-promise-reject-errors': 0,
'max-classes-per-file': 0,
// temporary rules to help with migration - please re-enable!
'testing-library/await-async-queries': 0,
@@ -385,6 +397,12 @@ module.exports = {
'*.stories.tsx',
'*.stories.jsx',
'fixtures.*',
+ '**/test/**/*',
+ '**/tests/**/*',
+ 'spec/**/*',
+ '**/fixtures/**/*',
+ '**/__mocks__/**/*',
+ '**/spec/**/*',
'cypress-base/cypress/**/*',
'Stories.tsx',
'packages/superset-ui-core/src/theme/index.tsx',
@@ -397,6 +415,18 @@ module.exports = {
'react/no-void-elements': 0,
},
},
+ {
+ // Override specifically for packages stories and overview files
+ // This must come LAST to override other rules
+ files: [
+ 'packages/**/*.stories.*',
+ 'packages/**/*.overview.*',
+ 'packages/**/fixtures.*',
+ ],
+ rules: {
+ 'import/no-extraneous-dependencies': 'off',
+ },
+ },
],
// eslint-disable-next-line no-dupe-keys
rules: {
diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json
index ad6ac17411..5442463535 100644
--- a/superset-frontend/package-lock.json
+++ b/superset-frontend/package-lock.json
@@ -61644,7 +61644,7 @@
"@storybook/types": "8.4.7",
"@types/react-loadable": "^5.5.11",
"core-js": "3.40.0",
- "gh-pages": "^6.2.0",
+ "gh-pages": "^6.3.0",
"jquery": "^3.7.1",
"memoize-one": "^5.2.1",
"react": "^17.0.2",
diff --git a/superset-frontend/packages/generator-superset/.eslintrc b/superset-frontend/packages/generator-superset/.eslintrc
deleted file mode 100644
index fd46989cba..0000000000
--- a/superset-frontend/packages/generator-superset/.eslintrc
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-{
- "settings": {
- "import/resolver": {
- "typescript": {}
- }
- }
-}
diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/operators/aggregateOperator.test.ts b/superset-frontend/packages/superset-ui-chart-controls/test/operators/aggregateOperator.test.ts
index 52e3e45407..ddc8d5785a 100644
--- a/superset-frontend/packages/superset-ui-chart-controls/test/operators/aggregateOperator.test.ts
+++ b/superset-frontend/packages/superset-ui-chart-controls/test/operators/aggregateOperator.test.ts
@@ -40,7 +40,7 @@ describe('aggregationOperator', () => {
granularity: 'month',
};
- test('should return undefined for LAST_VALUE aggregation', () => {
+ it('should return undefined for LAST_VALUE aggregation', () => {
const formDataWithLastValue = {
...formData,
aggregation: 'LAST_VALUE',
@@ -51,7 +51,7 @@ describe('aggregationOperator', () => {
).toBeUndefined();
});
- test('should return undefined when metrics is empty', () => {
+ it('should return undefined when metrics is empty', () => {
const queryObjectWithoutMetrics = {
...queryObject,
metrics: [],
@@ -67,7 +67,7 @@ describe('aggregationOperator', () => {
).toBeUndefined();
});
- test('should apply sum aggregation to all metrics', () => {
+ it('should apply sum aggregation to all metrics', () => {
const formDataWithSum = {
...formData,
aggregation: 'sum',
@@ -91,7 +91,7 @@ describe('aggregationOperator', () => {
});
});
- test('should apply mean aggregation to all metrics', () => {
+ it('should apply mean aggregation to all metrics', () => {
const formDataWithMean = {
...formData,
aggregation: 'mean',
@@ -115,7 +115,7 @@ describe('aggregationOperator', () => {
});
});
- test('should use default aggregation when not specified', () => {
+ it('should use default aggregation when not specified', () => {
expect(aggregationOperator(formData, queryObject)).toBeUndefined();
});
});
diff --git a/superset-frontend/packages/superset-ui-core/.eslintrc b/superset-frontend/packages/superset-ui-core/.eslintrc
deleted file mode 100644
index e0ff7c67bb..0000000000
--- a/superset-frontend/packages/superset-ui-core/.eslintrc
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-{
- "plugins": ["jest", "jest-dom", "no-only-tests", "testing-library"],
- "env": {
- "jest/globals": true
- },
- "settings": {
- "jest": {
- "version": "detect"
- }
- },
- "extends": [
- "plugin:jest/recommended",
- "plugin:jest-dom/recommended",
- "plugin:testing-library/react"
- ],
- "overrides": [
- {
- "files": [
- "**/*.stories.*",
- "**/*.overview.*",
- "**/fixtures.*"
- ],
- "rules": {
- "import/no-extraneous-dependencies": "off"
- }
- }
- ],
- "rules": {
- "import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
- "jest/consistent-test-it": "error",
- "no-only-tests/no-only-tests": "error",
- "prefer-promise-reject-errors": 0,
-
- "testing-library/no-node-access": "off",
- "testing-library/prefer-screen-queries": "off",
- "testing-library/no-container": "off",
- "testing-library/await-async-queries": "off",
- "testing-library/await-async-utils": "off",
- "testing-library/no-await-sync-events": "off",
- "testing-library/no-render-in-lifecycle": "off",
- "testing-library/no-unnecessary-act": "off",
- "testing-library/no-wait-for-multiple-assertions": "off",
- "testing-library/await-async-events": "off",
- "testing-library/no-wait-for-side-effects": "off",
- "testing-library/prefer-presence-queries": "off",
- "testing-library/render-result-naming-convention": "off",
- "testing-library/prefer-find-by": "off",
- "testing-library/no-manual-cleanup": "off"
- }
-}
diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts
index 436062b7ef..4a6a280702 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts
@@ -116,7 +116,7 @@ const chartPropsConfig = {
theme: supersetTheme,
};
-it('should transform chart props for viz with showQueryIdentifiers=false', () => {
+test('should transform chart props for viz with showQueryIdentifiers=false', () => {
const chartPropsConfigWithoutIdentifiers = {
...chartPropsConfig,
formData: {
@@ -139,7 +139,7 @@ it('should transform chart props for viz with showQueryIdentifiers=false', () =>
expect(seriesIds).not.toContain('sum__num (Query B), boy');
});
-it('should transform chart props for viz with showQueryIdentifiers=true', () => {
+test('should transform chart props for viz with showQueryIdentifiers=true', () => {
const chartPropsConfigWithIdentifiers = {
...chartPropsConfig,
formData: {
diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts
index 8f04e1c403..954221d56c 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts
@@ -32,7 +32,7 @@ const mockColorScale = jest.fn(
describe('transformSeries', () => {
const series = { name: 'test-series' };
- test('should use the colorScaleKey if timeShiftColor is enabled', () => {
+ it('should use the colorScaleKey if timeShiftColor is enabled', () => {
const opts = {
timeShiftColor: true,
colorScaleKey: 'test-key',
@@ -44,7 +44,7 @@ describe('transformSeries', () => {
expect((result as any)?.itemStyle.color).toBe('color-for-test-key-1');
});
- test('should use seriesKey if timeShiftColor is not enabled', () => {
+ it('should use seriesKey if timeShiftColor is not enabled', () => {
const opts = {
timeShiftColor: false,
seriesKey: 'series-key',
@@ -56,7 +56,7 @@ describe('transformSeries', () => {
expect((result as any)?.itemStyle.color).toBe('color-for-series-key-2');
});
- test('should apply border styles for bar series with connectNulls', () => {
+ it('should apply border styles for bar series with connectNulls', () => {
const opts = {
seriesType: EchartsTimeseriesSeriesType.Bar,
connectNulls: true,
@@ -72,7 +72,7 @@ describe('transformSeries', () => {
);
});
- test('should not apply border styles for non-bar series', () => {
+ it('should not apply border styles for non-bar series', () => {
const opts = {
seriesType: EchartsTimeseriesSeriesType.Line,
connectNulls: true,
@@ -88,7 +88,7 @@ describe('transformSeries', () => {
});
describe('transformNegativeLabelsPosition', () => {
- test('label position bottom of negative value no Horizontal', () => {
+ it('label position bottom of negative value no Horizontal', () => {
const isHorizontal = false;
const series: SeriesOption = {
data: [
@@ -112,7 +112,7 @@ describe('transformNegativeLabelsPosition', () => {
expect((result as any)[4].label).toBe(undefined);
});
- test('label position left of negative value is Horizontal', () => {
+ it('label position left of negative value is Horizontal', () => {
const isHorizontal = true;
const series: SeriesOption = {
data: [
@@ -137,7 +137,7 @@ describe('transformNegativeLabelsPosition', () => {
expect((result as any)[4].label.position).toBe('outside');
});
- test('label position to line type', () => {
+ it('label position to line type', () => {
const isHorizontal = false;
const series: SeriesOption = {
data: [
@@ -165,7 +165,7 @@ describe('transformNegativeLabelsPosition', () => {
expect((result as any)[4].label).toBe(undefined);
});
- test('label position to bar type and stack', () => {
+ it('label position to bar type and stack', () => {
const isHorizontal = false;
const series: SeriesOption = {
data: [
diff --git a/superset-frontend/spec/.eslintrc b/superset-frontend/spec/.eslintrc
deleted file mode 100644
index 7e3683e803..0000000000
--- a/superset-frontend/spec/.eslintrc
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-{
- "plugins": ["jest", "jest-dom", "no-only-tests", "testing-library"],
- "env": {
- "jest/globals": true
- },
- "settings": {
- "jest": {
- "version": "detect"
- }
- },
- "extends": [
- "plugin:jest/recommended",
- "plugin:jest-dom/recommended",
- "plugin:testing-library/react"
- ],
- "rules": {
- "import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
- "jest/consistent-test-it": "error",
- "no-only-tests/no-only-tests": "error",
- "prefer-promise-reject-errors": 0
- }
-}
diff --git a/superset-frontend/spec/javascripts/dashboard/.eslintrc b/superset-frontend/spec/javascripts/dashboard/.eslintrc
deleted file mode 100644
index 7a8a576a8c..0000000000
--- a/superset-frontend/spec/javascripts/dashboard/.eslintrc
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "extends": "prettier",
- "plugins": ["prettier"],
- "rules": {
- "prefer-template": 2,
- "new-cap": 2,
- "no-restricted-syntax": 2,
- "guard-for-in": 2,
- "prefer-arrow-callback": 2,
- "func-names": 2,
- "react/jsx-no-bind": 2,
- "no-confusing-arrow": 2,
- "jsx-a11y/no-static-element-interactions": 2,
- "jsx-a11y/anchor-has-content": 2,
- "react/require-default-props": 2,
- "no-plusplus": 2,
- "no-mixed-operators": 0,
- "no-continue": 2,
- "no-bitwise": 2,
- "no-multi-assign": 2,
- "no-restricted-properties": 2,
- "no-prototype-builtins": 2,
- "class-methods-use-this": 2,
- "import/no-named-as-default": 2,
- "react/no-unescaped-entities": 2,
- "react/no-string-refs": 2,
- "react/jsx-indent": 0,
- "prettier/prettier": "error"
- }
-}
diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.test.js b/superset-frontend/src/SqlLab/actions/sqlLab.test.js
index fd0ea8b13f..069033041e 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.test.js
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.test.js
@@ -50,7 +50,7 @@ jest.mock('@superset-ui/core', () => ({
}));
describe('getUpToDateQuery', () => {
- test('should return the up to date query editor state', () => {
+ it('should return the up to date query editor state', () => {
const outOfUpdatedQueryEditor = {
...defaultQueryEditor,
schema: null,
@@ -168,7 +168,7 @@ describe('async actions', () => {
const expectedSql = 'SELECT 1';
fetchMock.post(formatQueryEndpoint, { result: expectedSql });
- test('posts to the correct url', async () => {
+ it('posts to the correct url', async () => {
const store = mockStore(initialState);
store.dispatch(actions.formatQuery(query, queryId));
await waitFor(() =>
diff --git a/superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx b/superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx
index b3d33f9e3d..57c60baf42 100644
--- a/superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx
+++ b/superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx
@@ -30,15 +30,15 @@ const mockedProps = {
};
describe('QueryTable', () => {
- test('is valid', () => {
+ it('is valid', () => {
expect(isValidElement(<QueryTable displayLimit={100} />)).toBe(true);
});
- test('is valid with props', () => {
+ it('is valid with props', () => {
expect(isValidElement(<QueryTable {...mockedProps} />)).toBe(true);
});
- test('renders a proper table', () => {
+ it('renders a proper table', () => {
const mockStore = configureStore([thunk]);
const { container } = render(<QueryTable {...mockedProps} />, {
store: mockStore({ user }),
@@ -55,7 +55,7 @@ describe('QueryTable', () => {
).toHaveLength(2);
});
- test('renders empty table when no queries provided', () => {
+ it('renders empty table when no queries provided', () => {
const mockStore = configureStore([thunk]);
const { container } = render(
<QueryTable {...{ ...mockedProps, queries: [] }} />,
@@ -73,7 +73,7 @@ describe('QueryTable', () => {
).toHaveLength(0);
});
- test('renders with custom displayLimit', () => {
+ it('renders with custom displayLimit', () => {
const mockStore = configureStore([thunk]);
const customProps = {
...mockedProps,
diff --git a/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx b/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx
index 3c36850b7a..900ec41210 100644
--- a/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx
+++ b/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx
@@ -154,7 +154,7 @@ describe('ResultSet', () => {
await new Promise(resolve => setTimeout(resolve, 0));
});
- test('renders a Table', async () => {
+ it('renders a Table', async () => {
const { getByTestId } = setup(
mockedProps,
mockStore({
@@ -174,7 +174,7 @@ describe('ResultSet', () => {
});
});
- test('should render success query', async () => {
+ it('should render success query', async () => {
const query = queries[0];
const { queryAllByText, getByTestId } = setup(
mockedProps,
@@ -206,7 +206,7 @@ describe('ResultSet', () => {
expect(exploreButton).toBeInTheDocument();
});
- test('should render empty results', async () => {
+ it('should render empty results', async () => {
const query = {
...queries[0],
results: { data: [] },
@@ -232,7 +232,7 @@ describe('ResultSet', () => {
expect(alert).toHaveTextContent('The query returned no data');
});
- test('should call reRunQuery if timed out', async () => {
+ it('should call reRunQuery if timed out', async () => {
const query = {
...queries[0],
errorMessage: 'Your session timed out',
@@ -260,7 +260,7 @@ describe('ResultSet', () => {
);
});
- test('should not call reRunQuery if no error', async () => {
+ it('should not call reRunQuery if no error', async () => {
const query = queries[0];
const store = mockStore({
...initialState,
@@ -277,7 +277,7 @@ describe('ResultSet', () => {
expect(fetchMock.calls(reRunQueryEndpoint)).toHaveLength(0);
});
- test('should render cached query', async () => {
+ it('should render cached query', async () => {
const store = mockStore(cachedQueryState);
const { rerender } = setup(
{ ...mockedProps, queryId: cachedQuery.id },
@@ -291,7 +291,7 @@ describe('ResultSet', () => {
expect(store.getActions()[0].type).toEqual('CLEAR_QUERY_RESULTS');
});
- test('should render stopped query', async () => {
+ it('should render stopped query', async () => {
await waitFor(() => {
setup(
{ ...mockedProps, queryId: stoppedQuery.id },
@@ -303,7 +303,7 @@ describe('ResultSet', () => {
expect(alert).toBeInTheDocument();
});
- test('should render running/pending/fetching query', async () => {
+ it('should render running/pending/fetching query', async () => {
const { getByTestId } = setup(
{ ...mockedProps, queryId: runningQuery.id },
mockStore(runningQueryState),
@@ -312,7 +312,7 @@ describe('ResultSet', () => {
expect(progressBar).toBeInTheDocument();
});
- test('should render fetching w/ 100 progress query', async () => {
+ it('should render fetching w/ 100 progress query', async () => {
const { getByRole, getByText } = setup(
mockedProps,
mockStore(fetchingQueryState),
@@ -322,7 +322,7 @@ describe('ResultSet', () => {
expect(getByText('fetching')).toBeInTheDocument();
});
- test('should render a failed query with an errors object', async () => {
+ it('should render a failed query with an errors object', async () => {
const { errors } = failedQueryWithErrors;
await waitFor(() => {
@@ -335,7 +335,7 @@ describe('ResultSet', () => {
expect(errorMessages).toHaveLength(errors.length);
});
- test('should render a timeout error with a retrial button', async () => {
+ it('should render a timeout error with a retrial button', async () => {
await waitFor(() => {
setup(
{ ...mockedProps, queryId: failedQueryWithFrontendTimeoutErrors.id },
@@ -347,7 +347,7 @@ describe('ResultSet', () => {
).toBeInTheDocument();
});
- test('renders if there is no limit in query.results but has queryLimit', async () => {
+ it('renders if there is no limit in query.results but has queryLimit', async () => {
const query = {
...queries[0],
};
@@ -370,7 +370,7 @@ describe('ResultSet', () => {
expect(getByRole('grid')).toBeInTheDocument();
});
- test('renders if there is a limit in query.results but not queryLimit', async () => {
+ it('renders if there is a limit in query.results but not queryLimit', async () => {
const props = { ...mockedProps, queryId: queryWithNoQueryLimit.id };
const { getByRole } = setup(
props,
@@ -388,7 +388,7 @@ describe('ResultSet', () => {
expect(getByRole('grid')).toBeInTheDocument();
});
- test('Async queries - renders "Fetch data preview" button when data preview has no results', () => {
+ it('Async queries - renders "Fetch data preview" button when data preview has no results', () => {
const asyncRefetchDataPreviewQuery = {
...queries[0],
state: 'success',
@@ -416,7 +416,7 @@ describe('ResultSet', () => {
expect(screen.queryByRole('grid')).not.toBeInTheDocument();
});
- test('Async queries - renders "Refetch results" button when a query has no results', () => {
+ it('Async queries - renders "Refetch results" button when a query has no results', () => {
const asyncRefetchResultsTableQuery = {
...queries[0],
state: 'success',
@@ -445,7 +445,7 @@ describe('ResultSet', () => {
expect(screen.queryByRole('grid')).not.toBeInTheDocument();
});
- test('Async queries - renders on the first call', () => {
+ it('Async queries - renders on the first call', () => {
const query = {
...queries[0],
};
@@ -475,7 +475,7 @@ describe('ResultSet', () => {
).not.toBeInTheDocument();
});
- test('should allow download as CSV when user has permission to export data', async () => {
+ it('should allow download as CSV when user has permission to export data', async () => {
const { queryByTestId } = setup(
mockedProps,
mockStore({
@@ -497,7 +497,7 @@ describe('ResultSet', () => {
expect(queryByTestId('export-csv-button')).toBeInTheDocument();
});
- test('should display a popup message when the CSV content is limited to the dropdown limit', async () => {
+ it('should display a popup message when the CSV content is limited to the dropdown limit', async () => {
const queryLimit = 2;
const { getByTestId, findByRole } = setup(
mockedProps,
@@ -538,7 +538,7 @@ describe('ResultSet', () => {
});
});
- test('should not allow download as CSV when user does not have permission to export data', async () => {
+ it('should not allow download as CSV when user does not have permission to export data', async () => {
const { queryByTestId } = setup(
mockedProps,
mockStore({
@@ -555,7 +555,7 @@ describe('ResultSet', () => {
expect(queryByTestId('export-csv-button')).not.toBeInTheDocument();
});
- test('should allow copy to clipboard when user has permission to export data', async () => {
+ it('should allow copy to clipboard when user has permission to export data', async () => {
const { queryByTestId } = setup(
mockedProps,
mockStore({
@@ -577,7 +577,7 @@ describe('ResultSet', () => {
expect(queryByTestId('copy-to-clipboard-button')).toBeInTheDocument();
});
- test('should not allow copy to clipboard when user does not have permission to export data', async () => {
+ it('should not allow copy to clipboard when user does not have permission to export data', async () => {
const { queryByTestId } = setup(
mockedProps,
mockStore({
diff --git a/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.tsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.tsx
index 798a98b3ff..2ac34b4bb7 100644
--- a/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.tsx
+++ b/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.tsx
@@ -53,17 +53,17 @@ const setup = (props?: Partial<RunQueryActionButtonProps>, store?: Store) =>
...(store && { store }),
});
-it('renders a single Button', () => {
+test('renders a single Button', () => {
const { getByRole } = setup({}, mockStore(initialState));
expect(getByRole('button')).toBeInTheDocument();
});
-it('renders a label for Run Query', () => {
+test('renders a label for Run Query', () => {
const { getByText } = setup({}, mockStore(initialState));
expect(getByText('Run')).toBeInTheDocument();
});
-it('renders a label for Selected Query', () => {
+test('renders a label for Selected Query', () => {
const { getByText } = setup(
{},
mockStore({
@@ -80,7 +80,7 @@ it('renders a label for Selected Query', () => {
expect(getByText('Run selection')).toBeInTheDocument();
});
-it('disable button when sql from unsaved changes is empty', () => {
+test('disable button when sql from unsaved changes is empty', () => {
const { getByRole } = setup(
{},
mockStore({
@@ -98,7 +98,7 @@ it('disable button when sql from unsaved changes is empty', () => {
expect(button).toBeDisabled();
});
-it('disable button when selectedText only contains blank contents', () => {
+test('disable button when selectedText only contains blank contents', () => {
const { getByRole } = setup(
{},
mockStore({
@@ -116,7 +116,7 @@ it('disable button when selectedText only contains blank contents', () => {
expect(button).toBeDisabled();
});
-it('enable default button for unrelated unsaved changes', () => {
+test('enable default button for unrelated unsaved changes', () => {
const { getByRole } = setup(
{},
mockStore({
@@ -134,7 +134,7 @@ it('enable default button for unrelated unsaved changes', () => {
expect(button).toBeEnabled();
});
-it('dispatch runQuery on click', async () => {
+test('dispatch runQuery on click', async () => {
const runQuery = jest.fn();
const { getByRole } = setup({ runQuery }, mockStore(initialState));
const button = getByRole('button');
@@ -143,7 +143,7 @@ it('dispatch runQuery on click', async () => {
await waitFor(() => expect(runQuery).toHaveBeenCalledTimes(1));
});
-it('dispatch stopQuery on click while running state', async () => {
+test('dispatch stopQuery on click while running state', async () => {
const stopQuery = jest.fn();
const { getByRole } = setup(
{ queryState: 'running', stopQuery },
diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/SaveDatasetActionButton.test.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/SaveDatasetActionButton.test.tsx
index e9f8cbd7b9..2885594f39 100644
--- a/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/SaveDatasetActionButton.test.tsx
+++ b/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/SaveDatasetActionButton.test.tsx
@@ -25,7 +25,7 @@ const overlayMenu = (
);
describe('SaveDatasetActionButton', () => {
- test('renders a split save button', async () => {
+ it('renders a split save button', async () => {
render(
<SaveDatasetActionButton
setShowSave={() => true}
@@ -43,7 +43,7 @@ describe('SaveDatasetActionButton', () => {
expect(caretBtn).toBeVisible();
});
- test('renders a "save dataset" dropdown menu item when user clicks caret button', async () => {
+ it('renders a "save dataset" dropdown menu item when user clicks caret button', async () => {
render(
<SaveDatasetActionButton
setShowSave={() => true}
diff --git a/superset-frontend/src/SqlLab/components/TabbedSqlEditors/TabbedSqlEditors.test.tsx b/superset-frontend/src/SqlLab/components/TabbedSqlEditors/TabbedSqlEditors.test.tsx
index cb720332eb..efddbda54b 100644
--- a/superset-frontend/src/SqlLab/components/TabbedSqlEditors/TabbedSqlEditors.test.tsx
+++ b/superset-frontend/src/SqlLab/components/TabbedSqlEditors/TabbedSqlEditors.test.tsx
@@ -67,7 +67,7 @@ describe('componentDidMount', () => {
replaceState.mockReset();
uriStub.mockReset();
});
- test('should handle id', async () => {
+ it('should handle id', async () => {
const id = 1;
fetchMock.get(`glob:*/api/v1/sqllab/permalink/kv:${id}`, {
label: 'test permalink',
@@ -88,7 +88,7 @@ describe('componentDidMount', () => {
);
fetchMock.reset();
});
- test('should handle permalink', async () => {
+ it('should handle permalink', async () => {
const key = '9sadkfl';
fetchMock.get(`glob:*/api/v1/sqllab/permalink/${key}`, {
label: 'test permalink',
@@ -109,7 +109,7 @@ describe('componentDidMount', () => {
);
fetchMock.reset();
});
- test('should handle savedQueryId', () => {
+ it('should handle savedQueryId', () => {
uriStub.mockReturnValue({ savedQueryId: 1 });
setup(store);
expect(replaceState).toHaveBeenCalledWith(
@@ -118,7 +118,7 @@ describe('componentDidMount', () => {
'/sqllab',
);
});
- test('should handle sql', () => {
+ it('should handle sql', () => {
uriStub.mockReturnValue({ sql: 1, dbid: 1 });
setup(store);
expect(replaceState).toHaveBeenCalledWith(
@@ -127,7 +127,7 @@ describe('componentDidMount', () => {
'/sqllab',
);
});
- test('should handle custom url params', () => {
+ it('should handle custom url params', () => {
uriStub.mockReturnValue({
sql: 1,
dbid: 1,
diff --git a/superset-frontend/src/SqlLab/components/TablePreview/TablePreview.test.tsx b/superset-frontend/src/SqlLab/components/TablePreview/TablePreview.test.tsx
index 5f3a7f23c3..ec6d78654f 100644
--- a/superset-frontend/src/SqlLab/components/TablePreview/TablePreview.test.tsx
+++ b/superset-frontend/src/SqlLab/components/TablePreview/TablePreview.test.tsx
@@ -136,7 +136,7 @@ test('renders preview', async () => {
});
describe('table actions', () => {
- test('refreshes table metadata when triggered', async () => {
+ it('refreshes table metadata when triggered', async () => {
const { getByRole, getByText } = render(<TablePreview {...mockedProps} />, {
useRedux: true,
initialState,
@@ -152,7 +152,7 @@ describe('table actions', () => {
);
});
- test('shows CREATE VIEW statement', async () => {
+ it('shows CREATE VIEW statement', async () => {
const { getByRole, getByText } = render(<TablePreview {...mockedProps} />, {
useRedux: true,
initialState,
diff --git a/superset-frontend/src/components/ErrorMessage/MarshmallowErrorMessage.test.tsx b/superset-frontend/src/components/ErrorMessage/MarshmallowErrorMessage.test.tsx
index c2f0a938ba..bcba29bb47 100644
--- a/superset-frontend/src/components/ErrorMessage/MarshmallowErrorMessage.test.tsx
+++ b/superset-frontend/src/components/ErrorMessage/MarshmallowErrorMessage.test.tsx
@@ -43,25 +43,25 @@ describe('MarshmallowErrorMessage', () => {
level: 'error' as ErrorLevel,
};
- test('renders without crashing', () => {
+ it('renders without crashing', () => {
render(<MarshmallowErrorMessage error={mockError} />);
expect(screen.getByText('Validation failed')).toBeInTheDocument();
});
- test('renders the provided subtitle', () => {
+ it('renders the provided subtitle', () => {
render(
<MarshmallowErrorMessage error={mockError} subtitle="Error Alert" />,
);
expect(screen.getByText('Error Alert')).toBeInTheDocument();
});
- test('renders extracted invalid values', () => {
+ it('renders extracted invalid values', () => {
render(<MarshmallowErrorMessage error={mockError} />);
expect(screen.getByText("can't be blank:")).toBeInTheDocument();
expect(screen.getByText('is too low: 10')).toBeInTheDocument();
});
- test('renders the JSONTree when details are expanded', () => {
+ it('renders the JSONTree when details are expanded', () => {
render(<MarshmallowErrorMessage error={mockError} />);
fireEvent.click(screen.getByText('Details'));
expect(screen.getByText('"can\'t be blank"')).toBeInTheDocument();
diff --git a/superset-frontend/src/components/GridTable/HeaderMenu.test.tsx b/superset-frontend/src/components/GridTable/HeaderMenu.test.tsx
index 67b67e6b3f..5c89fc6dba 100644
--- a/superset-frontend/src/components/GridTable/HeaderMenu.test.tsx
+++ b/superset-frontend/src/components/GridTable/HeaderMenu.test.tsx
@@ -153,7 +153,7 @@ test('renders unhide when invisible column exists', async () => {
});
describe('for main menu', () => {
- test('renders Copy to Clipboard', async () => {
+ it('renders Copy to Clipboard', async () => {
const { getByText } = setup({ ...mockedProps, isMain: true });
userEvent.click(getByText('Copy the current data'));
await waitFor(() =>
@@ -166,7 +166,7 @@ describe('for main menu', () => {
});
});
- test('renders Download to CSV', async () => {
+ it('renders Download to CSV', async () => {
const { getByText } = setup({ ...mockedProps, isMain: true });
userEvent.click(getByText('Download to CSV'));
await waitFor(() =>
@@ -177,7 +177,7 @@ describe('for main menu', () => {
});
});
- test('renders autosize column', async () => {
+ it('renders autosize column', async () => {
const { getByText } = setup({ ...mockedProps, isMain: true });
userEvent.click(getByText('Autosize all columns'));
await waitFor(() =>
@@ -185,7 +185,7 @@ describe('for main menu', () => {
);
});
- test('renders all unhide all hidden columns when multiple invisible columns exist', async () => {
+ it('renders all unhide all hidden columns when multiple invisible columns exist', async () => {
setup({
...mockedProps,
isMain: true,
@@ -201,7 +201,7 @@ describe('for main menu', () => {
);
});
- test('reset columns configuration', async () => {
+ it('reset columns configuration', async () => {
const { getByText } = setup({
...mockedProps,
isMain: true,
diff --git a/superset-frontend/src/components/Tag/utils.test.tsx b/superset-frontend/src/components/Tag/utils.test.tsx
index 9b79de5504..ad8bc17a6c 100644
--- a/superset-frontend/src/components/Tag/utils.test.tsx
+++ b/superset-frontend/src/components/Tag/utils.test.tsx
@@ -21,7 +21,7 @@ import rison from 'rison';
import { tagToSelectOption, loadTags } from 'src/components/Tag/utils';
describe('tagToSelectOption', () => {
- test('converts a Tag object with table_name to a SelectTagsValue', () => {
+ it('converts a Tag object with table_name to a SelectTagsValue', () => {
const tag = {
id: 1,
name: 'TagName',
@@ -47,7 +47,7 @@ describe('loadTags', () => {
fetchMock.restore();
});
- test('constructs correct API query with custom tag filter', async () => {
+ it('constructs correct API query with custom tag filter', async () => {
const mockTags = [
{ id: 1, name: 'analytics', type: 1 },
{ id: 2, name: 'finance', type: 1 },
@@ -86,7 +86,7 @@ describe('loadTags', () => {
});
});
- test('returns correctly transformed data', async () => {
+ it('returns correctly transformed data', async () => {
const mockTags = [
{ id: 1, name: 'analytics', type: 1 },
{ id: 2, name: 'finance', type: 1 },
@@ -108,7 +108,7 @@ describe('loadTags', () => {
});
});
- test('handles search parameter correctly', async () => {
+ it('handles search parameter correctly', async () => {
fetchMock.get('glob:*/api/v1/tag/*', {
result: [],
count: 0,
@@ -131,7 +131,7 @@ describe('loadTags', () => {
});
});
- test('handles pagination parameters correctly', async () => {
+ it('handles pagination parameters correctly', async () => {
fetchMock.get('glob:*/api/v1/tag/*', {
result: [],
count: 0,
@@ -150,7 +150,7 @@ describe('loadTags', () => {
expect(decodedQuery.page_size).toBe(10);
});
- test('always includes custom tag filter regardless of other parameters', async () => {
+ it('always includes custom tag filter regardless of other parameters', async () => {
fetchMock.get('glob:*/api/v1/tag/*', {
result: [],
count: 0,
@@ -180,7 +180,7 @@ describe('loadTags', () => {
});
});
- test('maintains correct order specification', async () => {
+ it('maintains correct order specification', async () => {
fetchMock.get('glob:*/api/v1/tag/*', {
result: [],
count: 0,
diff --git a/superset-frontend/src/components/TagsList/TagsList.test.tsx b/superset-frontend/src/components/TagsList/TagsList.test.tsx
index a5fabce8c2..c8e4f3c5d0 100644
--- a/superset-frontend/src/components/TagsList/TagsList.test.tsx
+++ b/superset-frontend/src/components/TagsList/TagsList.test.tsx
@@ -80,7 +80,7 @@ test('should render 3 elements when maxTags is set to 3', async () => {
});
describe('Tag type filtering', () => {
- test('should render only custom type tags (type: 1)', async () => {
+ it('should render only custom type tags (type: 1)', async () => {
const mixedTypeTags = [
{ name: 'custom-tag', type: 1, id: 1 }, // Custom - should show
{ name: 'type:chart', type: 2, id: 2 }, // Type - should be filtered out
@@ -104,7 +104,7 @@ describe('Tag type filtering', () => {
expect(tagsListItems[1]).toHaveTextContent('custom-tag');
});
- test('should show tags when type is undefined (fallback case)', async () => {
+ it('should show tags when type is undefined (fallback case)', async () => {
const undefinedTypeTags = [
{ name: 'legacy-tag', id: 1 }, // No type property - should show due to fallback
{ name: 'custom-tag', type: 1, id: 2 }, // Custom - should show
@@ -127,7 +127,7 @@ describe('Tag type filtering', () => {
expect(tagsListItems[1]).toHaveTextContent('legacy-tag');
});
- test('should handle legacy TagTypes.custom string format', async () => {
+ it('should handle legacy TagTypes.custom string format', async () => {
const legacyFormatTags = [
{ name: 'legacy-custom', type: 'TagTypes.custom', id: 1 }, // Legacy string format - should show
{ name: 'modern-custom', type: 1, id: 2 }, // Modern enum - should show
@@ -150,7 +150,7 @@ describe('Tag type filtering', () => {
expect(tagsListItems[1]).toHaveTextContent('modern-custom');
});
- test('should show empty list when all tags are filtered out', async () => {
+ it('should show empty list when all tags are filtered out', async () => {
const nonCustomTags = [
{ name: 'type:chart', type: 2, id: 1 }, // Type tag
{ name: 'owner:admin', type: 3, id: 2 }, // Owner tag
@@ -175,7 +175,7 @@ describe('Tag type filtering', () => {
expect(tagsListItems).toHaveLength(0);
});
- test('should handle mixed scenarios with truncation', async () => {
+ it('should handle mixed scenarios with truncation', async () => {
const largeMixedTagSet = [
{ name: 'custom-1', type: 1, id: 1 }, // Custom - should show
{ name: 'system-1', type: 2, id: 2 }, // System - filtered out
diff --git a/superset-frontend/src/dashboard/components/FiltersBadge/FiltersBadge.test.tsx b/superset-frontend/src/dashboard/components/FiltersBadge/FiltersBadge.test.tsx
index 74ff06f196..db7804187b 100644
--- a/superset-frontend/src/dashboard/components/FiltersBadge/FiltersBadge.test.tsx
+++ b/superset-frontend/src/dashboard/components/FiltersBadge/FiltersBadge.test.tsx
@@ -55,7 +55,7 @@ buildActiveFilters({
});
describe('for dashboard filters', () => {
- test('does not show number when there are no active filters', () => {
+ it('does not show number when there are no active filters', () => {
const store = getMockStoreWithFilters();
// start with basic dashboard state, dispatch an event to simulate query completion
store.dispatch({
@@ -74,7 +74,7 @@ describe('for dashboard filters', () => {
expect(queryByTestId('applied-filter-count')).not.toBeInTheDocument();
});
- test('shows the indicator when filters have been applied', () => {
+ it('shows the indicator when filters have been applied', () => {
const store = getMockStoreWithFilters();
// start with basic dashboard state, dispatch an event to simulate query completion
store.dispatch({
@@ -97,7 +97,7 @@ describe('for dashboard filters', () => {
});
describe('for native filters', () => {
- test('does not show number when there are no active filters', () => {
+ it('does not show number when there are no active filters', () => {
const store = getMockStoreWithNativeFilters();
// start with basic dashboard state, dispatch an event to simulate query completion
store.dispatch({
@@ -116,7 +116,7 @@ describe('for native filters', () => {
expect(queryByTestId('applied-filter-count')).not.toBeInTheDocument();
});
- test('shows the indicator when filters have been applied', () => {
+ it('shows the indicator when filters have been applied', () => {
const store = getMockStoreWithNativeFilters();
// start with basic dashboard state, dispatch an event to simulate query completion
store.dispatch({
diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/PropertiesModal.test.tsx b/superset-frontend/src/dashboard/components/PropertiesModal/PropertiesModal.test.tsx
index 599d271d36..bd5d822f0e 100644
--- a/superset-frontend/src/dashboard/components/PropertiesModal/PropertiesModal.test.tsx
+++ b/superset-frontend/src/dashboard/components/PropertiesModal/PropertiesModal.test.tsx
@@ -168,7 +168,7 @@ afterAll(() => {
describe('PropertiesModal', () => {
jest.setTimeout(15000); // ✅ Applies to all tests in this suite
- test('should render - FeatureFlag disabled', async () => {
+ it('should render - FeatureFlag disabled', async () => {
mockedIsFeatureEnabled.mockReturnValue(false);
const props = createProps();
render(<PropertiesModal {...props} />, {
@@ -210,7 +210,7 @@ describe('PropertiesModal', () => {
);
});
- test('should render - FeatureFlag enabled', async () => {
+ it('should render - FeatureFlag enabled', async () => {
mockedIsFeatureEnabled.mockReturnValue(true);
const props = createProps();
render(<PropertiesModal {...props} />, {
@@ -254,7 +254,7 @@ describe('PropertiesModal', () => {
);
});
- test('should open advance', async () => {
+ it('should open advance', async () => {
mockedIsFeatureEnabled.mockReturnValue(true);
const props = createProps();
render(<PropertiesModal {...props} />, {
@@ -271,7 +271,7 @@ describe('PropertiesModal', () => {
expect(screen.getAllByRole('combobox')).toHaveLength(3);
});
- test('should close modal', async () => {
+ it('should close modal', async () => {
mockedIsFeatureEnabled.mockReturnValue(true);
const props = createProps();
render(<PropertiesModal {...props} />, {
@@ -288,7 +288,7 @@ describe('PropertiesModal', () => {
expect(props.onHide).toHaveBeenCalledTimes(2);
});
- test('submitting with onlyApply:false', async () => {
+ it('submitting with onlyApply:false', async () => {
const put = jest.spyOn(SupersetCore.SupersetClient, 'put');
put.mockResolvedValue({
json: {
@@ -331,7 +331,7 @@ describe('PropertiesModal', () => {
});
});
- test('submitting with onlyApply:true', async () => {
+ it('submitting with onlyApply:true', async () => {
mockedIsFeatureEnabled.mockReturnValue(false);
const props = createProps();
props.onlyApply = true;
@@ -351,7 +351,7 @@ describe('PropertiesModal', () => {
});
});
- test('Empty "Certified by" should clear "Certification details"', async () => {
+ it('Empty "Certified by" should clear "Certification details"', async () => {
const props = createProps();
const noCertifiedByProps = {
...props,
@@ -366,7 +366,7 @@ describe('PropertiesModal', () => {
).toHaveValue('');
});
- test('should show all roles', async () => {
+ it('should show all roles', async () => {
mockedIsFeatureEnabled.mockReturnValue(true);
const props = createProps();
@@ -399,7 +399,7 @@ describe('PropertiesModal', () => {
expect(options[0]).toHaveTextContent('Admin');
});
- test('should show active owners with dashboard rbac', async () => {
+ it('should show active owners with dashboard rbac', async () => {
mockedIsFeatureEnabled.mockReturnValue(true);
const props = createProps();
@@ -432,7 +432,7 @@ describe('PropertiesModal', () => {
expect(options[0]).toHaveTextContent('Superset Admin');
});
- test('should show active owners without dashboard rbac', async () => {
+ it('should show active owners without dashboard rbac', async () => {
mockedIsFeatureEnabled.mockReturnValue(false);
const props = createProps();
diff --git a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadScreenshot.test.tsx b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadScreenshot.test.tsx
index 5707c6734a..370b77086e 100644
--- a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadScreenshot.test.tsx
+++ b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadScreenshot.test.tsx
@@ -73,18 +73,18 @@ describe('DownloadScreenshot component', () => {
jest.restoreAllMocks();
});
- test('renders correctly with the given text', () => {
+ it('renders correctly with the given text', () => {
renderComponent();
expect(screen.getByText('Download')).toBeInTheDocument();
});
- test('button renders with role="button"', async () => {
+ it('button renders with role="button"', async () => {
renderComponent();
const button = screen.getByRole('button', { name: 'Download' });
expect(button).toBeInTheDocument();
});
- test('displays error message when API call fails', async () => {
+ it('displays error message when API call fails', async () => {
const props = defaultProps();
fetchMock.post(
@@ -106,7 +106,7 @@ describe('DownloadScreenshot component', () => {
});
});
- test('displays success message when API call succeeds', async () => {
+ it('displays success message when API call succeeds', async () => {
const props = defaultProps();
fetchMock.post(
`glob:*/api/v1/dashboard/${props.dashboardId}/cache_dashboard_screenshot/`,
@@ -141,7 +141,7 @@ describe('DownloadScreenshot component', () => {
});
});
- test('throws error when no image cache key is provided', async () => {
+ it('throws error when no image cache key is provided', async () => {
const props = defaultProps();
fetchMock.post(
`glob:*/api/v1/dashboard/${props.dashboardId}/cache_dashboard_screenshot/`,
@@ -165,7 +165,7 @@ describe('DownloadScreenshot component', () => {
});
});
- test('displays success message when image retrieval succeeds', async () => {
+ it('displays success message when image retrieval succeeds', async () => {
const props = defaultProps();
fetchMock.post(
`glob:*/api/v1/dashboard/${props.dashboardId}/cache_dashboard_screenshot/`,
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.test.tsx
index 78da010203..84cd70a0e7 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.test.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.test.tsx
@@ -119,7 +119,7 @@ const setup = (props = DEFAULT_PROPS) =>
initialState: INITIAL_STATE,
});
-it('Renders charts scoping list panel', () => {
+test('Renders charts scoping list panel', () => {
setup();
expect(screen.getByText('Add custom scoping')).toBeVisible();
expect(screen.getByText('All charts/global scoping')).toBeVisible();
@@ -131,7 +131,7 @@ it('Renders charts scoping list panel', () => {
expect(screen.queryByText('[new custom scoping]')).not.toBeInTheDocument();
});
-it('Renders custom scoping item', () => {
+test('Renders custom scoping item', () => {
setup({
...DEFAULT_PROPS,
activeChartId: -1,
@@ -158,7 +158,7 @@ it('Renders custom scoping item', () => {
expect(screen.getByText('[new custom scoping]')).toHaveClass('active');
});
-it('Uses callbacks on click', () => {
+test('Uses callbacks on click', () => {
setup();
userEvent.click(screen.getByText('Add custom scoping'));
@@ -177,7 +177,7 @@ it('Uses callbacks on click', () => {
expect(DEFAULT_PROPS.removeCustomScope).toHaveBeenCalledWith(4);
});
-it('Renders charts scoping list panel with FilterTitle rendered with role="button"', () => {
+test('Renders charts scoping list panel with FilterTitle rendered with role="button"', () => {
setup();
expect(screen.getByText('All charts/global scoping')).toBeVisible();
expect(screen.getByText('All charts/global scoping')).toHaveAttribute(
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModal.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModal.test.tsx
index ce2411ce04..16276e702c 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModal.test.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModal.test.tsx
@@ -158,14 +158,14 @@ afterEach(() => {
fetchMock.restore();
});
-it('renders modal', () => {
+test('renders modal', () => {
setup();
expect(screen.getByRole('dialog')).toBeInTheDocument();
expect(screen.getByTestId('scoping-tree-panel')).toBeInTheDocument();
expect(screen.getByTestId('scoping-list-panel')).toBeInTheDocument();
});
-it('switch currently edited chart scoping', async () => {
+test('switch currently edited chart scoping', async () => {
setup();
const withinScopingList = within(screen.getByTestId('scoping-list-panel'));
expect(withinScopingList.getByText('All charts/global scoping')).toHaveClass(
@@ -180,7 +180,7 @@ it('switch currently edited chart scoping', async () => {
});
});
-it('scoping tree global and custom checks', () => {
+test('scoping tree global and custom checks', () => {
setup();
expect(
@@ -200,7 +200,7 @@ it('scoping tree global and custom checks', () => {
).toHaveLength(2);
});
-it('add new custom scoping', async () => {
+test('add new custom scoping', async () => {
setup();
userEvent.click(screen.getByText('Add custom scoping'));
@@ -226,7 +226,7 @@ it('add new custom scoping', async () => {
).toHaveLength(2);
});
-it('edit scope and save', async () => {
+test('edit scope and save', async () => {
setup();
// unselect chart 2 in global scoping
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/utils.test.ts b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/utils.test.ts
index 37c20e1e7c..642f857646 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/utils.test.ts
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/utils.test.ts
@@ -26,7 +26,7 @@ import {
describe('FilterBar Utils - Validation and Apply Logic', () => {
describe('checkIsValidateError', () => {
- test('should return true when no filters have validation errors', () => {
+ it('should return true when no filters have validation errors', () => {
const dataMask: DataMaskStateWithId = {
'filter-1': {
id: 'filter-1',
@@ -49,7 +49,7 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
expect(checkIsValidateError(dataMask)).toBe(true);
});
- test('should return false when any filter has validation error', () => {
+ it('should return false when any filter has validation error', () => {
const dataMask: DataMaskStateWithId = {
'filter-1': {
id: 'filter-1',
@@ -72,12 +72,12 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
expect(checkIsValidateError(dataMask)).toBe(false);
});
- test('should handle empty dataMask', () => {
+ it('should handle empty dataMask', () => {
const dataMask: DataMaskStateWithId = {};
expect(checkIsValidateError(dataMask)).toBe(true);
});
- test('should handle filters without filterState', () => {
+ it('should handle filters without filterState', () => {
const dataMask: DataMaskStateWithId = {
'filter-1': {
id: 'filter-1',
@@ -90,7 +90,7 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
});
describe('checkIsMissingRequiredValue', () => {
- test('should return true for required filter with undefined value', () => {
+ it('should return true for required filter with undefined value', () => {
const filter = {
id: 'test-filter',
controlValues: {
@@ -105,7 +105,7 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
expect(checkIsMissingRequiredValue(filter, filterState)).toBe(true);
});
- test('should return true for required filter with null value', () => {
+ it('should return true for required filter with null value', () => {
const filter = {
id: 'test-filter',
controlValues: {
@@ -120,7 +120,7 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
expect(checkIsMissingRequiredValue(filter, filterState)).toBe(true);
});
- test('should return false for required filter with valid value', () => {
+ it('should return false for required filter with valid value', () => {
const filter = {
id: 'test-filter',
controlValues: {
@@ -135,7 +135,7 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
expect(checkIsMissingRequiredValue(filter, filterState)).toBe(false);
});
- test('should return false for non-required filter with undefined value', () => {
+ it('should return false for non-required filter with undefined value', () => {
const filter = {
id: 'test-filter',
controlValues: {
@@ -150,7 +150,7 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
expect(checkIsMissingRequiredValue(filter, filterState)).toBe(false);
});
- test('should return false for filter without controlValues', () => {
+ it('should return false for filter without controlValues', () => {
const filter = {
id: 'test-filter',
} as Filter;
@@ -166,7 +166,7 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
});
describe('checkIsApplyDisabled', () => {
- test('should return true when filters have validation errors', () => {
+ it('should return true when filters have validation errors', () => {
const dataMaskSelected: DataMaskStateWithId = {
'filter-1': {
id: 'filter-1',
@@ -204,7 +204,7 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
).toBe(true);
});
- test('should return false when selected and applied states differ', () => {
+ it('should return false when selected and applied states differ', () => {
const dataMaskSelected: DataMaskStateWithId = {
'filter-1': {
id: 'filter-1',
@@ -244,7 +244,7 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
).toBe(false);
});
- test('should return true when selected and applied states are identical', () => {
+ it('should return true when selected and applied states are identical', () => {
const dataMaskSelected: DataMaskStateWithId = {
'filter-1': {
id: 'filter-1',
@@ -284,7 +284,7 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
).toBe(true);
});
- test('should return true when required filter is missing value in selected state', () => {
+ it('should return true when required filter is missing value in selected state', () => {
const dataMaskSelected: DataMaskStateWithId = {
'filter-1': {
id: 'filter-1',
@@ -322,7 +322,7 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
).toBe(true);
});
- test('should handle filter count mismatch', () => {
+ it('should handle filter count mismatch', () => {
const dataMaskSelected: DataMaskStateWithId = {
'filter-1': {
id: 'filter-1',
@@ -369,7 +369,7 @@ describe('FilterBar Utils - Validation and Apply Logic', () => {
).toBe(true);
});
- test('should handle validation status recalculation scenario', () => {
+ it('should handle validation status recalculation scenario', () => {
// Scenario: Filter was required and had error, then user selected value
// The validateStatus should be cleared and Apply should be enabled
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.test.tsx
index 6be6b3e051..e92432a1f2 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.test.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.test.tsx
@@ -219,7 +219,7 @@ describe('ColumnSelect filterValues behavior', () => {
]);
});
- test('only renders filterable columns when doesColumnMatchFilterType returns true', () => {
+ it('only renders filterable columns when doesColumnMatchFilterType returns true', () => {
(doesColumnMatchFilterType as jest.Mock).mockReturnValue(true);
const props = {
...createProps(),
@@ -234,7 +234,7 @@ describe('ColumnSelect filterValues behavior', () => {
expect(screen.queryByText('col2')).not.toBeInTheDocument();
});
- test('renders no columns when doesColumnMatchFilterType returns false', () => {
+ it('renders no columns when doesColumnMatchFilterType returns false', () => {
(doesColumnMatchFilterType as jest.Mock).mockReturnValue(false);
const props = {
...createProps(),
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/NativeFiltersModal.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/NativeFiltersModal.test.tsx
index dafb1988c9..ddc4fb672d 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/NativeFiltersModal.test.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/NativeFiltersModal.test.tsx
@@ -79,14 +79,14 @@ test('the form validates required fields', async () => {
});
describe('createNewOnOpen', () => {
- test('does not show alert when there is no unsaved filters', async () => {
+ it('does not show alert when there is no unsaved filters', async () => {
const onCancel = jest.fn();
const { getByRole } = setup({ onCancel, createNewOnOpen: false });
fireEvent.click(getByRole('button', { name: 'Cancel' }));
expect(onCancel).toHaveBeenCalledTimes(1);
});
- test('shows correct alert message for unsaved filters', async () => {
+ it('shows correct alert message for unsaved filters', async () => {
const onCancel = jest.fn();
const { getByRole, getByTestId } = setup({
onCancel,
diff --git a/superset-frontend/src/embedded/utils.test.ts b/superset-frontend/src/embedded/utils.test.ts
index 06ce75afa0..ed52a84799 100644
--- a/superset-frontend/src/embedded/utils.test.ts
+++ b/superset-frontend/src/embedded/utils.test.ts
@@ -49,7 +49,7 @@ const dataMask: DataMaskStateWithId = {
},
};
-it('datamask didnt change - both triggers set to false', () => {
+test('datamask didnt change - both triggers set to false', () => {
const previousDataMask = cloneDeep(dataMask);
expect(getDataMaskChangeTrigger(dataMask, previousDataMask)).toEqual({
crossFiltersChanged: false,
@@ -57,7 +57,7 @@ it('datamask didnt change - both triggers set to false', () => {
});
});
-it('a native filter changed - nativeFiltersChanged set to true', () => {
+test('a native filter changed - nativeFiltersChanged set to true', () => {
const previousDataMask = cloneDeep(dataMask);
previousDataMask['NATIVE_FILTER-1'].filterState!.value = 'test';
expect(getDataMaskChangeTrigger(dataMask, previousDataMask)).toEqual({
@@ -66,7 +66,7 @@ it('a native filter changed - nativeFiltersChanged set to true', () => {
});
});
-it('a cross filter changed - crossFiltersChanged set to true', () => {
+test('a cross filter changed - crossFiltersChanged set to true', () => {
const previousDataMask = cloneDeep(dataMask);
previousDataMask['1'].filterState!.value = 'test';
expect(getDataMaskChangeTrigger(dataMask, previousDataMask)).toEqual({
diff --git a/superset-frontend/src/explore/actions/exploreActions.test.js b/superset-frontend/src/explore/actions/exploreActions.test.js
index 77c204cf3f..3d75a6d1c5 100644
--- a/superset-frontend/src/explore/actions/exploreActions.test.js
+++ b/superset-frontend/src/explore/actions/exploreActions.test.js
@@ -217,7 +217,7 @@ describe('reducers', () => {
);
});
- test('setStashFormData works as expected with fieldNames', () => {
+ it('setStashFormData works as expected with fieldNames', () => {
const newState = exploreReducer(
defaultState,
actions.setStashFormData(true, ['y_axis_format']),
diff --git a/superset-frontend/src/explore/actions/saveModalActions.test.ts b/superset-frontend/src/explore/actions/saveModalActions.test.ts
index b7081d3486..d3482b5f21 100644
--- a/superset-frontend/src/explore/actions/saveModalActions.test.ts
+++ b/superset-frontend/src/explore/actions/saveModalActions.test.ts
@@ -491,7 +491,7 @@ describe('getSlicePayload', () => {
dashboards: [],
};
- test('should return the correct payload when no adhoc_filters are present in formDataWithNativeFilters', () => {
+ it('should return the correct payload when no adhoc_filters are present in formDataWithNativeFilters', () => {
const result = getSlicePayload(
sliceName,
formDataWithNativeFilters,
@@ -515,7 +515,7 @@ describe('getSlicePayload', () => {
);
});
- test('should return the correct payload when adhoc_filters are present in formDataWithNativeFilters', () => {
+ it('should return the correct payload when adhoc_filters are present in formDataWithNativeFilters', () => {
const formDataWithAdhocFilters: QueryFormData = {
...formDataWithNativeFilters,
adhoc_filters: [
@@ -551,7 +551,7 @@ describe('getSlicePayload', () => {
);
});
- test('should return the correct payload when formDataWithNativeFilters has a filter with isExtra set to true', () => {
+ it('should return the correct payload when formDataWithNativeFilters has a filter with isExtra set to true', () => {
const formDataWithAdhocFiltersWithExtra: QueryFormData = {
...formDataWithNativeFilters,
adhoc_filters: [
@@ -587,7 +587,7 @@ describe('getSlicePayload', () => {
);
});
- test('should return the correct payload when formDataWithNativeFilters has a filter with isExtra set to true in mixed chart', () => {
+ it('should return the correct payload when formDataWithNativeFilters has a filter with isExtra set to true in mixed chart', () => {
const formDataFromSliceWithAdhocFilterB: QueryFormData = {
...formDataFromSlice,
adhoc_filters_b: [
@@ -641,7 +641,7 @@ describe('getSlicePayload', () => {
);
});
- test('should return the correct payload when formDataFromSliceWithAdhocFilter has no time range filters in mixed chart', () => {
+ it('should return the correct payload when formDataFromSliceWithAdhocFilter has no time range filters in mixed chart', () => {
const formDataFromSliceWithAdhocFilterB: QueryFormData = {
...formDataFromSlice,
adhoc_filters: [],
@@ -690,7 +690,7 @@ describe('getSlicePayload', () => {
expect(hasTemporalRange).toBe(true);
});
- test('should reset isExtra flag to false for temporal filter when saving as a new chart', () => {
+ it('should reset isExtra flag to false for temporal filter when saving as a new chart', () => {
const formDataWithTemporalFilterWithExtra: QueryFormData = {
...formDataWithNativeFilters,
adhoc_filters: [
diff --git a/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx b/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx
index 7e93adf01b..efea069871 100644
--- a/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx
+++ b/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx
@@ -106,7 +106,7 @@ describe('ControlPanelsContainer', () => {
} as ControlPanelsContainerProps;
}
- test('renders ControlPanelSections', async () => {
+ it('renders ControlPanelSections', async () => {
render(<ControlPanelsContainer {...getDefaultProps()} />, {
useRedux: true,
});
@@ -120,7 +120,7 @@ describe('ControlPanelsContainer', () => {
).toHaveLength(5);
});
- test('renders ControlPanelSections no Customize Tab', async () => {
+ it('renders ControlPanelSections no Customize Tab', async () => {
getChartControlPanelRegistry().registerValue('table', {
controlPanelSections: [
{
@@ -153,7 +153,7 @@ describe('ControlPanelsContainer', () => {
).toHaveLength(2);
});
- test('visibility of panels is correctly applied', async () => {
+ it('visibility of panels is correctly applied', async () => {
getChartControlPanelRegistry().registerValue('table', {
controlPanelSections: [
{
@@ -203,7 +203,7 @@ describe('ControlPanelsContainer', () => {
);
});
- test('hidden state of controls is correctly applied', async () => {
+ it('hidden state of controls is correctly applied', async () => {
getChartControlPanelRegistry().registerValue('table', {
controlPanelSections: [
{
diff --git a/superset-frontend/src/explore/components/DataTablesPane/test/DataTablesPane.test.tsx b/superset-frontend/src/explore/components/DataTablesPane/test/DataTablesPane.test.tsx
index 10151718ee..3f17250846 100644
--- a/superset-frontend/src/explore/components/DataTablesPane/test/DataTablesPane.test.tsx
+++ b/superset-frontend/src/explore/components/DataTablesPane/test/DataTablesPane.test.tsx
@@ -40,7 +40,7 @@ describe('DataTablesPane', () => {
localStorage.clear();
});
- test('Rendering DataTablesPane correctly', async () => {
+ it('Rendering DataTablesPane correctly', async () => {
const props = createDataTablesPaneProps(0);
render(<DataTablesPane {...props} />, { useRedux: true });
expect(await screen.findByText('Results')).toBeVisible();
@@ -48,7 +48,7 @@ describe('DataTablesPane', () => {
expect(screen.getByLabelText('Expand data panel')).toBeVisible();
});
- test('Collapse/Expand buttons', async () => {
+ it('Collapse/Expand buttons', async () => {
const props = createDataTablesPaneProps(0);
render(<DataTablesPane {...props} />, {
useRedux: true,
@@ -63,7 +63,7 @@ describe('DataTablesPane', () => {
).not.toBeInTheDocument();
});
- test('Should show tabs: View results', async () => {
+ it('Should show tabs: View results', async () => {
const props = createDataTablesPaneProps(0);
render(<DataTablesPane {...props} />, {
useRedux: true,
@@ -74,7 +74,7 @@ describe('DataTablesPane', () => {
localStorage.clear();
});
- test('Should show tabs: View samples', async () => {
+ it('Should show tabs: View samples', async () => {
const props = createDataTablesPaneProps(0);
render(<DataTablesPane {...props} />, {
useRedux: true,
@@ -84,7 +84,7 @@ describe('DataTablesPane', () => {
expect(await screen.findByLabelText('Collapse data panel')).toBeVisible();
});
- test('Should copy data table content correctly', async () => {
+ it('Should copy data table content correctly', async () => {
fetchMock.post(
'glob:*/api/v1/chart/data?form_data=%7B%22slice_id%22%3A456%7D',
{
@@ -115,7 +115,7 @@ describe('DataTablesPane', () => {
fetchMock.restore();
});
- test('Should not allow copy data table content when canDownload=false', async () => {
+ it('Should not allow copy data table content when canDownload=false', async () => {
fetchMock.post(
'glob:*/api/v1/chart/data?form_data=%7B%22slice_id%22%3A456%7D',
{
@@ -143,7 +143,7 @@ describe('DataTablesPane', () => {
fetchMock.restore();
});
- test('Search table', async () => {
+ it('Search table', async () => {
fetchMock.post(
'glob:*/api/v1/chart/data?form_data=%7B%22slice_id%22%3A789%7D',
{
@@ -179,7 +179,7 @@ describe('DataTablesPane', () => {
fetchMock.restore();
});
- test('Displaying the data pane is under featureflag', () => {
+ it('Displaying the data pane is under featureflag', () => {
// @ts-ignore
global.featureFlags = {
[FeatureFlag.DatapanelClosedByDefault]: true,
diff --git a/superset-frontend/src/explore/components/DataTablesPane/test/ResultsPaneOnDashboard.test.tsx b/superset-frontend/src/explore/components/DataTablesPane/test/ResultsPaneOnDashboard.test.tsx
index 8e4f51cde4..8bb7aeb4e1 100644
--- a/superset-frontend/src/explore/components/DataTablesPane/test/ResultsPaneOnDashboard.test.tsx
+++ b/superset-frontend/src/explore/components/DataTablesPane/test/ResultsPaneOnDashboard.test.tsx
@@ -94,7 +94,7 @@ describe('ResultsPaneOnDashboard', () => {
jest.resetAllMocks();
});
- test('render', async () => {
+ it('render', async () => {
const props = createResultsPaneOnDashboardProps({ sliceId: 121 });
const { findByText } = render(<ResultsPaneOnDashboard {...props} />, {
useRedux: true,
@@ -104,7 +104,7 @@ describe('ResultsPaneOnDashboard', () => {
).toBeVisible();
});
- test('render errorMessage', async () => {
+ it('render errorMessage', async () => {
const props = createResultsPaneOnDashboardProps({
sliceId: 121,
errorMessage: <p>error</p>,
@@ -115,7 +115,7 @@ describe('ResultsPaneOnDashboard', () => {
expect(await findByText('Run a query to display results')).toBeVisible();
});
- test('error response', async () => {
+ it('error response', async () => {
const props = createResultsPaneOnDashboardProps({
sliceId: 169,
});
@@ -126,7 +126,7 @@ describe('ResultsPaneOnDashboard', () => {
expect(await findByText('Bad request')).toBeVisible();
});
- test('force query, render and search', async () => {
+ it('force query, render and search', async () => {
const props = createResultsPaneOnDashboardProps({
sliceId: 144,
queryForce: true,
@@ -151,7 +151,7 @@ describe('ResultsPaneOnDashboard', () => {
expect(queryByText('Action')).not.toBeInTheDocument();
});
- test('multiple results pane', async () => {
+ it('multiple results pane', async () => {
const FakeChart = () => <span>test</span>;
const metadata = new ChartMetadata({
name: 'test-chart',
@@ -185,7 +185,7 @@ describe('ResultsPaneOnDashboard', () => {
expect(tab2).toBeVisible();
});
- test('dynamic number of results pane', async () => {
+ it('dynamic number of results pane', async () => {
const FakeChart = () => <span>test</span>;
const metadata = new ChartMetadata({
name: 'test-chart',
diff --git a/superset-frontend/src/explore/components/DataTablesPane/test/SamplesPane.test.tsx b/superset-frontend/src/explore/components/DataTablesPane/test/SamplesPane.test.tsx
index de19b718eb..30a3322171 100644
--- a/superset-frontend/src/explore/components/DataTablesPane/test/SamplesPane.test.tsx
+++ b/superset-frontend/src/explore/components/DataTablesPane/test/SamplesPane.test.tsx
@@ -67,7 +67,7 @@ describe('SamplesPane', () => {
jest.resetAllMocks();
});
- test('render', async () => {
+ it('render', async () => {
const props = createSamplesPaneProps({ datasourceId: 34 });
const { findByText } = render(<SamplesPane {...props} />);
expect(
@@ -78,7 +78,7 @@ describe('SamplesPane', () => {
});
});
- test('error response', async () => {
+ it('error response', async () => {
const props = createSamplesPaneProps({
datasourceId: 36,
});
@@ -89,7 +89,7 @@ describe('SamplesPane', () => {
expect(await findByText('Error: Bad request')).toBeVisible();
});
- test('force query, render and search', async () => {
+ it('force query, render and search', async () => {
const props = createSamplesPaneProps({
datasourceId: 35,
queryForce: true,
diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanel.test.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanel.test.tsx
index 19a91463d3..e63ac41fef 100644
--- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanel.test.tsx
+++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanel.test.tsx
@@ -207,7 +207,7 @@ describe('DatasourcePanel', () => {
await new Promise(resolve => setTimeout(resolve, 0));
});
- test('should search and render matching columns', async () => {
+ it('should search and render matching columns', async () => {
const { unmount } = render(
<ExploreContainer>
<DatasourcePanel {...props} />
diff --git a/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx b/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx
index 6f083fc9bf..7d9d1a1712 100644
--- a/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx
+++ b/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx
@@ -152,7 +152,7 @@ describe('ExploreChartHeader', () => {
});
});
- test('Cancelling changes to the properties should reset previous properties', async () => {
+ it('Cancelling changes to the properties should reset previous properties', async () => {
const props = createProps();
render(<ExploreHeader {...props} />, { useRedux: true });
const newChartName = 'New chart name';
@@ -179,7 +179,7 @@ describe('ExploreChartHeader', () => {
expect(await screen.findByDisplayValue(prevChartName)).toBeInTheDocument();
});
- test('renders the metadata bar when saved', async () => {
+ it('renders the metadata bar when saved', async () => {
const props = createProps({ showTitlePanelItems: true });
render(<ExploreHeader {...props} />, { useRedux: true });
expect(await screen.findByText('Added to 1 dashboard')).toBeInTheDocument();
@@ -188,7 +188,7 @@ describe('ExploreChartHeader', () => {
expect(await screen.findByText('2 days ago')).toBeInTheDocument();
});
- test('Changes "Added to X dashboards" to plural when more than 1 dashboard', async () => {
+ it('Changes "Added to X dashboards" to plural when more than 1 dashboard', async () => {
const props = createProps({ showTitlePanelItems: true });
render(
<ExploreHeader
@@ -208,7 +208,7 @@ describe('ExploreChartHeader', () => {
).toBeInTheDocument();
});
- test('does not render the metadata bar when not saved', async () => {
+ it('does not render the metadata bar when not saved', async () => {
const props = createProps({ showTitlePanelItems: true, slice: null });
render(<ExploreHeader {...props} />, { useRedux: true });
await waitFor(() =>
@@ -218,7 +218,7 @@ describe('ExploreChartHeader', () => {
);
});
- test('Save chart', async () => {
+ it('Save chart', async () => {
const setSaveChartModalVisibilitySpy = jest.spyOn(
saveModalActions,
'setSaveChartModalVisibility',
@@ -254,7 +254,7 @@ describe('ExploreChartHeader', () => {
setSaveChartModalVisibilityMock.mockClear();
});
- test('Save disabled', async () => {
+ it('Save disabled', async () => {
const triggerManualSave = jest.fn();
(useUnsavedChangesPrompt as jest.Mock).mockReturnValue({
@@ -279,7 +279,7 @@ describe('ExploreChartHeader', () => {
expect(triggerManualSave).not.toHaveBeenCalled();
});
- test('should render UnsavedChangesModal when showModal is true', async () => {
+ it('should render UnsavedChangesModal when showModal is true', async () => {
const props = createProps();
(useUnsavedChangesPrompt as jest.Mock).mockReturnValue({
@@ -301,7 +301,7 @@ describe('ExploreChartHeader', () => {
).toBeInTheDocument();
});
- test('should call handleSaveAndCloseModal when clicking Save in UnsavedChangesModal', async () => {
+ it('should call handleSaveAndCloseModal when clicking Save in UnsavedChangesModal', async () => {
const handleSaveAndCloseModal = jest.fn();
(useUnsavedChangesPrompt as jest.Mock).mockReturnValue({
@@ -325,7 +325,7 @@ describe('ExploreChartHeader', () => {
expect(handleSaveAndCloseModal).toHaveBeenCalled();
});
- test('should call handleConfirmNavigation when clicking Discard in UnsavedChangesModal', async () => {
+ it('should call handleConfirmNavigation when clicking Discard in UnsavedChangesModal', async () => {
const handleConfirmNavigation = jest.fn();
(useUnsavedChangesPrompt as jest.Mock).mockReturnValue({
@@ -349,7 +349,7 @@ describe('ExploreChartHeader', () => {
expect(handleConfirmNavigation).toHaveBeenCalled();
});
- test('should call setShowModal(false) when clicking close button in UnsavedChangesModal', async () => {
+ it('should call setShowModal(false) when clicking close button in UnsavedChangesModal', async () => {
const setShowModal = jest.fn();
(useUnsavedChangesPrompt as jest.Mock).mockReturnValue({
@@ -386,7 +386,7 @@ describe('Additional actions tests', () => {
});
});
- test('Should render a button', async () => {
+ it('Should render a button', async () => {
const props = createProps();
render(<ExploreHeader {...props} />, { useRedux: true });
expect(
@@ -394,7 +394,7 @@ describe('Additional actions tests', () => {
).toBeInTheDocument();
});
- test('Should open a menu', async () => {
+ it('Should open a menu', async () => {
const props = createProps();
render(<ExploreHeader {...props} />, {
useRedux: true,
@@ -416,7 +416,7 @@ describe('Additional actions tests', () => {
expect(screen.queryByText('Manage email report')).not.toBeInTheDocument();
});
- test('Should open download submenu', async () => {
+ it('Should open download submenu', async () => {
const props = createProps();
render(<ExploreHeader {...props} />, {
useRedux: true,
@@ -435,7 +435,7 @@ describe('Additional actions tests', () => {
expect(await screen.findByText('Download as image')).toBeInTheDocument();
});
- test('Should open share submenu', async () => {
+ it('Should open share submenu', async () => {
const props = createProps();
render(<ExploreHeader {...props} />, {
useRedux: true,
@@ -458,7 +458,7 @@ describe('Additional actions tests', () => {
expect(await screen.findByText('Share chart by email')).toBeInTheDocument();
});
- test('Should call onOpenPropertiesModal when click on "Edit chart properties"', async () => {
+ it('Should call onOpenPropertiesModal when click on "Edit chart properties"', async () => {
const props = createProps();
render(<ExploreHeader {...props} />, {
useRedux: true,
@@ -473,7 +473,7 @@ describe('Additional actions tests', () => {
).toBeInTheDocument();
});
- test('Should call getChartDataRequest when click on "View query"', async () => {
+ it('Should call getChartDataRequest when click on "View query"', async () => {
const props = createProps();
const getChartDataRequest = jest.spyOn(chartAction, 'getChartDataRequest');
render(<ExploreHeader {...props} />, {
@@ -490,7 +490,7 @@ describe('Additional actions tests', () => {
await waitFor(() => expect(getChartDataRequest).toHaveBeenCalledTimes(1));
});
- test('Should call onOpenInEditor when click on "Run in SQL Lab"', async () => {
+ it('Should call onOpenInEditor when click on "Run in SQL Lab"', async () => {
const props = createProps();
render(<ExploreHeader {...props} />, {
useRedux: true,
@@ -529,7 +529,7 @@ describe('Additional actions tests', () => {
await new Promise(resolve => setTimeout(resolve, 0));
});
- test('Should call downloadAsImage when click on "Download as image"', async () => {
+ it('Should call downloadAsImage when click on "Download as image"', async () => {
const props = createProps();
const spy = jest.spyOn(downloadAsImage, 'default');
render(<ExploreHeader {...props} />, {
@@ -554,7 +554,7 @@ describe('Additional actions tests', () => {
});
});
- test('Should not export to CSV if canDownload=false', async () => {
+ it('Should not export to CSV if canDownload=false', async () => {
const props = createProps();
render(<ExploreHeader {...props} />, {
useRedux: true,
@@ -567,7 +567,7 @@ describe('Additional actions tests', () => {
spyExportChart.restore();
});
- test('Should export to CSV if canDownload=true', async () => {
+ it('Should export to CSV if canDownload=true', async () => {
const props = createProps();
props.canDownload = true;
render(<ExploreHeader {...props} />, {
@@ -582,7 +582,7 @@ describe('Additional actions tests', () => {
spyExportChart.restore();
});
- test('Should not export to JSON if canDownload=false', async () => {
+ it('Should not export to JSON if canDownload=false', async () => {
const props = createProps();
render(<ExploreHeader {...props} />, {
useRedux: true,
@@ -595,7 +595,7 @@ describe('Additional actions tests', () => {
spyExportChart.restore();
});
- test('Should export to JSON if canDownload=true', async () => {
+ it('Should export to JSON if canDownload=true', async () => {
const props = createProps();
props.canDownload = true;
render(<ExploreHeader {...props} />, {
@@ -609,7 +609,7 @@ describe('Additional actions tests', () => {
expect(spyExportChart.callCount).toBe(1);
});
- test('Should not export to pivoted CSV if canDownloadCSV=false and viz_type=pivot_table_v2', async () => {
+ it('Should not export to pivoted CSV if canDownloadCSV=false and viz_type=pivot_table_v2', async () => {
const props = createProps();
props.chart.latestQueryFormData.viz_type = VizType.PivotTable;
render(<ExploreHeader {...props} />, {
@@ -625,7 +625,7 @@ describe('Additional actions tests', () => {
expect(spyExportChart.callCount).toBe(0);
});
- test('Should export to pivoted CSV if canDownloadCSV=true and viz_type=pivot_table_v2', async () => {
+ it('Should export to pivoted CSV if canDownloadCSV=true and viz_type=pivot_table_v2', async () => {
const props = createProps();
props.canDownload = true;
props.chart.latestQueryFormData.viz_type = VizType.PivotTable;
@@ -642,7 +642,7 @@ describe('Additional actions tests', () => {
expect(spyExportChart.callCount).toBe(1);
});
- test('Should not export to Excel if canDownload=false', async () => {
+ it('Should not export to Excel if canDownload=false', async () => {
const props = createProps();
render(<ExploreHeader {...props} />, {
useRedux: true,
@@ -655,7 +655,7 @@ describe('Additional actions tests', () => {
spyExportChart.restore();
});
- test('Should export to Excel if canDownload=true', async () => {
+ it('Should export to Excel if canDownload=true', async () => {
const props = createProps();
props.canDownload = true;
render(<ExploreHeader {...props} />, {
diff --git a/superset-frontend/src/explore/components/ExploreChartPanel/ExploreChartPanel.test.jsx b/superset-frontend/src/explore/components/ExploreChartPanel/ExploreChartPanel.test.jsx
index 185fdbd65f..11397cbaa9 100644
--- a/superset-frontend/src/explore/components/ExploreChartPanel/ExploreChartPanel.test.jsx
+++ b/superset-frontend/src/explore/components/ExploreChartPanel/ExploreChartPanel.test.jsx
@@ -69,12 +69,12 @@ const createProps = (overrides = {}) => ({
describe('ChartContainer', () => {
jest.setTimeout(10000);
- test('renders when vizType is line', () => {
+ it('renders when vizType is line', () => {
const props = createProps();
expect(isValidElement(<ChartContainer {...props} />)).toBe(true);
});
- test('renders with alert banner', async () => {
+ it('renders with alert banner', async () => {
const props = createProps({
chartIsStale: true,
chart: { chartStatus: 'rendered', queriesResponse: [{}] },
@@ -93,7 +93,7 @@ describe('ChartContainer', () => {
).toBeVisible();
});
- test('doesnt render alert banner when no changes in control panel were made (chart is not stale)', async () => {
+ it('doesnt render alert banner when no changes in control panel were made (chart is not stale)', async () => {
const props = createProps({
chartIsStale: false,
});
@@ -104,7 +104,7 @@ describe('ChartContainer', () => {
).not.toBeInTheDocument();
});
- test('doesnt render alert banner when chart not created yet (no queries response)', async () => {
+ it('doesnt render alert banner when chart not created yet (no queries response)', async () => {
const props = createProps({
chartIsStale: true,
chart: { queriesResponse: [] },
@@ -116,7 +116,7 @@ describe('ChartContainer', () => {
).not.toBeInTheDocument();
});
- test('renders prompt to fill required controls when required control removed', async () => {
+ it('renders prompt to fill required controls when required control removed', async () => {
const props = createProps({
chartIsStale: true,
chart: { chartStatus: 'rendered', queriesResponse: [{}] },
@@ -128,7 +128,7 @@ describe('ChartContainer', () => {
).toBeVisible();
});
- test('should render cached button and call expected actions', async () => {
+ it('should render cached button and call expected actions', async () => {
const setForceQuery = jest.fn();
const postChartFormData = jest.fn();
const updateQueryFormData = jest.fn();
@@ -150,7 +150,7 @@ describe('ChartContainer', () => {
expect(updateQueryFormData).toHaveBeenCalledTimes(1);
});
- test('should hide cached button', async () => {
+ it('should hide cached button', async () => {
const props = createProps({
chart: {
chartStatus: 'rendered',
diff --git a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointOption.test.tsx b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointOption.test.tsx
index 5049aaca7e..4af9b8265c 100644
--- a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointOption.test.tsx
+++ b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointOption.test.tsx
@@ -53,29 +53,29 @@ describe('ColorBreakpointOption', () => {
jest.clearAllMocks();
});
- test('should render', async () => {
+ it('should render', async () => {
const { container } = renderComponent();
await waitFor(() => expect(container).toBeInTheDocument());
});
- test('should render the breakpoint range text', async () => {
+ it('should render the breakpoint range text', async () => {
renderComponent();
expect(await screen.findByText('0 - 100')).toBeInTheDocument();
});
- test('should render the remove button', async () => {
+ it('should render the remove button', async () => {
renderComponent();
const removeBtn = await screen.findByTestId('remove-control-button');
expect(removeBtn).toBeInTheDocument();
});
- test('should render the color preview', async () => {
+ it('should render the color preview', async () => {
renderComponent();
const colorPreview = await screen.findByTestId('color-preview');
expect(colorPreview).toBeInTheDocument();
});
- test('should call onClose when remove button is clicked', async () => {
+ it('should call onClose when remove button is clicked', async () => {
const onClose = jest.fn();
renderComponent({ onClose });
@@ -85,7 +85,7 @@ describe('ColorBreakpointOption', () => {
expect(onClose).toHaveBeenCalledWith(0);
});
- test('should open popover when clicked', async () => {
+ it('should open popover when clicked', async () => {
renderComponent();
const breakpointOption = await screen.findByTestId(
@@ -96,7 +96,7 @@ describe('ColorBreakpointOption', () => {
expect(screen.getByRole('dialog')).toBeInTheDocument();
});
- test('should render different color values correctly', async () => {
+ it('should render different color values correctly', async () => {
const blueBreakpoint: ColorBreakpointType = {
id: 1,
color: { r: 0, g: 0, b: 255, a: 1 },
@@ -111,7 +111,7 @@ describe('ColorBreakpointOption', () => {
expect(colorPreview).toBeInTheDocument();
});
- test('should handle decimal values', async () => {
+ it('should handle decimal values', async () => {
const decimalBreakpoint: ColorBreakpointType = {
id: 2,
color: { r: 128, g: 128, b: 128, a: 1 },
diff --git a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverControl.test.tsx b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverControl.test.tsx
index edec0a8c5e..4040654200 100644
--- a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverControl.test.tsx
+++ b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverControl.test.tsx
@@ -55,7 +55,7 @@ describe('ColorBreakpointPopoverControl', () => {
jest.clearAllMocks();
});
- test('should render with default props', () => {
+ it('should render with default props', () => {
renderComponent();
expect(screen.getByText('Color for breakpoint')).toBeInTheDocument();
@@ -63,21 +63,21 @@ describe('ColorBreakpointPopoverControl', () => {
expect(screen.getByText('Max value')).toBeInTheDocument();
});
- test('should render close and save buttons', () => {
+ it('should render close and save buttons', () => {
renderComponent();
expect(screen.getByTestId('close-button')).toBeInTheDocument();
expect(screen.getByTestId('save-button')).toBeInTheDocument();
});
- test('should render with existing breakpoint values', () => {
+ it('should render with existing breakpoint values', () => {
renderComponent();
expect(screen.getByDisplayValue('0')).toBeInTheDocument();
expect(screen.getByDisplayValue('100')).toBeInTheDocument();
});
- test('should call onClose when close button is clicked', async () => {
+ it('should call onClose when close button is clicked', async () => {
const onClose = jest.fn();
renderComponent({ onClose });
@@ -87,14 +87,14 @@ describe('ColorBreakpointPopoverControl', () => {
expect(onClose).toHaveBeenCalled();
});
- test('should disable save button when form is incomplete', () => {
+ it('should disable save button when form is incomplete', () => {
renderComponent({ value: undefined });
const saveButton = screen.getByTestId('save-button');
expect(saveButton).toBeDisabled();
});
- test('should enable save button when form is complete', async () => {
+ it('should enable save button when form is complete', async () => {
renderComponent({ value: mockEmptyBreakpoint });
const minInput = screen.getByTestId('min-value-input');
@@ -109,7 +109,7 @@ describe('ColorBreakpointPopoverControl', () => {
});
});
- test('should call onSave with correct values when save button is clicked', async () => {
+ it('should call onSave with correct values when save button is clicked', async () => {
const onSave = jest.fn();
const onClose = jest.fn();
@@ -148,7 +148,7 @@ describe('ColorBreakpointPopoverControl', () => {
expect(onClose).toHaveBeenCalled();
});
- test('should disable save button when min value >= max value', async () => {
+ it('should disable save button when min value >= max value', async () => {
renderComponent({ value: undefined });
const minInput = screen.getByTestId('min-value-input');
@@ -161,7 +161,7 @@ describe('ColorBreakpointPopoverControl', () => {
expect(saveButton).toBeDisabled();
});
- test('should disable save button when breakpoint overlaps with existing ones', async () => {
+ it('should disable save button when breakpoint overlaps with existing ones', async () => {
const existingBreakpoints: ColorBreakpointType[] = [
{
id: 0,
@@ -192,7 +192,7 @@ describe('ColorBreakpointPopoverControl', () => {
expect(saveButton).toBeDisabled();
});
- test('should handle non-numeric input validation', async () => {
+ it('should handle non-numeric input validation', async () => {
renderComponent({ value: undefined });
const minInput = screen.getByTestId('min-value-input');
@@ -207,7 +207,7 @@ describe('ColorBreakpointPopoverControl', () => {
});
});
- test('should update min value when input changes', async () => {
+ it('should update min value when input changes', async () => {
renderComponent();
const minInput = screen.getByDisplayValue('0');
@@ -217,7 +217,7 @@ describe('ColorBreakpointPopoverControl', () => {
expect(screen.getByDisplayValue('20')).toBeInTheDocument();
});
- test('should update max value when input changes', async () => {
+ it('should update max value when input changes', async () => {
renderComponent();
const maxInput = screen.getByDisplayValue('100');
@@ -227,7 +227,7 @@ describe('ColorBreakpointPopoverControl', () => {
expect(screen.getByDisplayValue('200')).toBeInTheDocument();
});
- test('should handle zero values correctly', async () => {
+ it('should handle zero values correctly', async () => {
renderComponent({
value: mockEmptyBreakpoint,
});
@@ -244,7 +244,7 @@ describe('ColorBreakpointPopoverControl', () => {
});
});
- test('should handle negative values correctly', async () => {
+ it('should handle negative values correctly', async () => {
renderComponent({
value: mockEmptyBreakpoint,
});
@@ -261,7 +261,7 @@ describe('ColorBreakpointPopoverControl', () => {
});
});
- test('should handle decimal values correctly', async () => {
+ it('should handle decimal values correctly', async () => {
renderComponent({
value: mockEmptyBreakpoint,
});
@@ -278,7 +278,7 @@ describe('ColorBreakpointPopoverControl', () => {
});
});
- test('should not show overlap error when editing existing breakpoint', async () => {
+ it('should not show overlap error when editing existing breakpoint', async () => {
const existingBreakpoints: ColorBreakpointType[] = [
{
id: 0,
diff --git a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverTrigger.test.tsx b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverTrigger.test.tsx
index 7bd36f9723..8fa1ce1a14 100644
--- a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverTrigger.test.tsx
+++ b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverTrigger.test.tsx
@@ -58,17 +58,17 @@ describe('ColorBreakpointPopoverTrigger', () => {
jest.clearAllMocks();
});
- test('should render', () => {
+ it('should render', () => {
const { container } = renderComponent();
expect(container).toBeInTheDocument();
});
- test('should render children', () => {
+ it('should render children', () => {
renderComponent();
expect(screen.getByText('Click to add new breakpoint')).toBeInTheDocument();
});
- test('should render the popover on click when uncontrolled', async () => {
+ it('should render the popover on click when uncontrolled', async () => {
renderComponent();
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
@@ -79,7 +79,7 @@ describe('ColorBreakpointPopoverTrigger', () => {
expect(screen.queryByRole('dialog')).toBeInTheDocument();
});
- test('should be visible when controlled and visible is true', async () => {
+ it('should be visible when controlled and visible is true', async () => {
const controlledProps = {
isControlled: true,
visible: true,
@@ -91,7 +91,7 @@ describe('ColorBreakpointPopoverTrigger', () => {
expect(await screen.findByRole('dialog')).toBeInTheDocument();
});
- test('should NOT be visible when controlled and visible is false', () => {
+ it('should NOT be visible when controlled and visible is false', () => {
const controlledProps = {
isControlled: true,
visible: false,
@@ -102,7 +102,7 @@ describe('ColorBreakpointPopoverTrigger', () => {
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
});
- test('should call toggleVisibility when controlled and popover state changes', async () => {
+ it('should call toggleVisibility when controlled and popover state changes', async () => {
const toggleVisibility = jest.fn();
const controlledProps = {
isControlled: true,
@@ -118,7 +118,7 @@ describe('ColorBreakpointPopoverTrigger', () => {
expect(toggleVisibility).toHaveBeenCalledWith(true);
});
- test('should render popover content with form elements', async () => {
+ it('should render popover content with form elements', async () => {
renderComponent();
const triggerButton = screen.getByText('Click to add new breakpoint');
@@ -129,7 +129,7 @@ describe('ColorBreakpointPopoverTrigger', () => {
expect(screen.getByText('Max value')).toBeInTheDocument();
});
- test('should close popover when save is called', async () => {
+ it('should close popover when save is called', async () => {
renderComponent({ value: mockEmptyBreakpoint });
const triggerButton = screen.getByText('Click to add new breakpoint');
@@ -149,7 +149,7 @@ describe('ColorBreakpointPopoverTrigger', () => {
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
});
- test('should close popover when close button is clicked', async () => {
+ it('should close popover when close button is clicked', async () => {
renderComponent();
const triggerButton = screen.getByText('Click to add new breakpoint');
@@ -161,7 +161,7 @@ describe('ColorBreakpointPopoverTrigger', () => {
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
});
- test('should handle undefined value prop', async () => {
+ it('should handle undefined value prop', async () => {
renderComponent({ value: undefined });
const triggerButton = screen.getByText('Click to add new breakpoint');
@@ -171,7 +171,7 @@ describe('ColorBreakpointPopoverTrigger', () => {
expect(screen.getByText('Color for breakpoint')).toBeInTheDocument();
});
- test('should handle popover open state changes correctly', async () => {
+ it('should handle popover open state changes correctly', async () => {
renderComponent();
const triggerButton = screen.getByText('Click to add new breakpoint');
@@ -183,7 +183,7 @@ describe('ColorBreakpointPopoverTrigger', () => {
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
});
- test('should maintain controlled state when toggleVisibility is provided', async () => {
+ it('should maintain controlled state when toggleVisibility is provided', async () => {
const toggleVisibility = jest.fn();
const controlledProps = {
isControlled: true,
@@ -201,7 +201,7 @@ describe('ColorBreakpointPopoverTrigger', () => {
expect(toggleVisibility).toHaveBeenCalledWith(false);
});
- test('should pass colorBreakpoints to popover content', async () => {
+ it('should pass colorBreakpoints to popover content', async () => {
const colorBreakpoints = [
{ id: 0, color: { r: 255, g: 0, b: 0, a: 1 }, minValue: 0, maxValue: 50 },
{
@@ -220,7 +220,7 @@ describe('ColorBreakpointPopoverTrigger', () => {
expect(screen.queryByRole('dialog')).toBeInTheDocument();
});
- test('should handle destroyOnHidden prop', async () => {
+ it('should handle destroyOnHidden prop', async () => {
renderComponent();
const triggerButton = screen.getByText('Click to add new breakpoint');
diff --git a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointsControl.test.tsx b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointsControl.test.tsx
index cfce7e529a..94c35c8127 100644
--- a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointsControl.test.tsx
+++ b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointsControl.test.tsx
@@ -56,7 +56,7 @@ describe('ColorBreakpointsControl', () => {
expect(screen.getByText('Click to add new breakpoint')).toBeInTheDocument();
});
- test('should render existing breakpoints', () => {
+ it('should render existing breakpoints', () => {
const existingBreakpoint: ColorBreakpointType = {
id: 0,
color: { r: 255, g: 0, b: 0, a: 1 },
@@ -68,12 +68,12 @@ describe('ColorBreakpointsControl', () => {
expect(screen.getByText('0 - 100')).toBeInTheDocument();
});
- test('should handle empty breakpoints array', () => {
+ it('should handle empty breakpoints array', () => {
renderComponent({ value: [] });
expect(screen.getByText('Click to add new breakpoint')).toBeInTheDocument();
});
- test('should handle multiple breakpoints', () => {
+ it('should handle multiple breakpoints', () => {
const breakpoints: ColorBreakpointType[] = [
{
id: 0,
@@ -94,20 +94,20 @@ describe('ColorBreakpointsControl', () => {
expect(screen.getByText('50 - 100')).toBeInTheDocument();
});
- test('should call onChange when component state updates', () => {
+ it('should call onChange when component state updates', () => {
const onChange = jest.fn();
renderComponent({ onChange });
expect(onChange).toHaveBeenCalledWith([]);
});
- test('should show new breakpoint button when no breakpoints exist', () => {
+ it('should show new breakpoint button when no breakpoints exist', () => {
renderComponent();
const ghostButton = screen.getByText('Click to add new breakpoint');
expect(ghostButton).toBeInTheDocument();
});
- test('should handle new breakpoint button click and popover visibility state', async () => {
+ it('should handle new breakpoint button click and popover visibility state', async () => {
renderComponent();
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
@@ -118,7 +118,7 @@ describe('ColorBreakpointsControl', () => {
expect(screen.getByRole('dialog')).toBeInTheDocument();
});
- test('should save new breakpoint and update state', async () => {
+ it('should save new breakpoint and update state', async () => {
const onChange = jest.fn();
renderComponent({ onChange });
@@ -154,7 +154,7 @@ describe('ColorBreakpointsControl', () => {
});
});
- test('should remove breakpoint when delete is triggered', async () => {
+ it('should remove breakpoint when delete is triggered', async () => {
const existingBreakpoint: ColorBreakpointType = {
id: 0,
color: { r: 255, g: 0, b: 0, a: 1 },
@@ -171,7 +171,7 @@ describe('ColorBreakpointsControl', () => {
expect(onChange).toHaveBeenCalledWith([]);
});
- test('should edit existing breakpoint when clicked', async () => {
+ it('should edit existing breakpoint when clicked', async () => {
const existingBreakpoint: ColorBreakpointType = {
id: 0,
color: { r: 255, g: 0, b: 0, a: 1 },
@@ -190,7 +190,7 @@ describe('ColorBreakpointsControl', () => {
expect(screen.getByDisplayValue('100')).toBeInTheDocument();
});
- test('should handle DndSelectLabel props correctly', () => {
+ it('should handle DndSelectLabel props correctly', () => {
renderComponent();
const dndSelectLabel = screen
@@ -199,7 +199,7 @@ describe('ColorBreakpointsControl', () => {
expect(dndSelectLabel).toBeInTheDocument();
});
- test('should assign incremental IDs to new breakpoints', async () => {
+ it('should assign incremental IDs to new breakpoints', async () => {
const onChange = jest.fn();
renderComponent({ onChange });
diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx
index 3a9cb67771..4939076750 100644
--- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx
+++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx
@@ -324,7 +324,7 @@ test('onChange is not called when close is clicked and canDelete is string, warn
});
describe('when disallow_adhoc_metrics is set', () => {
- test('can drop a column type from the simple column selection', () => {
+ it('can drop a column type from the simple column selection', () => {
const adhocMetric = new AdhocMetric({
expression: 'AVG(birth_names.num)',
metric_name: 'avg__num',
@@ -364,7 +364,7 @@ describe('when disallow_adhoc_metrics is set', () => {
expect(within(filterConfigPopup).getByText('column_b')).toBeInTheDocument();
});
- test('cannot drop any other types of selections apart from simple column selection', () => {
+ it('cannot drop any other types of selections apart from simple column selection', () => {
const adhocMetric = new AdhocMetric({
expression: 'AVG(birth_names.num)',
metric_name: 'avg__num',
diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.test.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.test.tsx
index d68e8988f4..e72b070c27 100644
--- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.test.tsx
+++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.test.tsx
@@ -34,7 +34,7 @@ describe('Option', () => {
await new Promise(resolve => setTimeout(resolve, 0));
});
- test('renders with default props', async () => {
+ it('renders with default props', async () => {
const { container, unmount } = render(
<Option index={1} clickClose={jest.fn()}>
Option
@@ -50,7 +50,7 @@ describe('Option', () => {
unmount();
});
- test('renders with caret', async () => {
+ it('renders with caret', async () => {
const { unmount } = render(
<Option index={1} clickClose={jest.fn()} withCaret>
Option
@@ -65,7 +65,7 @@ describe('Option', () => {
unmount();
});
- test('renders with extra triangle', async () => {
+ it('renders with extra triangle', async () => {
const { unmount } = render(
<Option index={1} clickClose={jest.fn()} isExtra>
Option
@@ -77,7 +77,7 @@ describe('Option', () => {
unmount();
});
- test('triggers onClose', async () => {
+ it('triggers onClose', async () => {
const clickClose = jest.fn();
const { unmount } = render(
<Option index={1} clickClose={clickClose}>
diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/AdhocFilterControl.test.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/AdhocFilterControl.test.tsx
index 78109620f0..d30e1b6f0d 100644
--- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/AdhocFilterControl.test.tsx
+++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/AdhocFilterControl.test.tsx
@@ -80,7 +80,7 @@ describe('AdhocFilterControl', () => {
expect(screen.getByTestId('adhoc-filter-control')).toBeInTheDocument();
});
- test('should render existing filters', () => {
+ it('should render existing filters', () => {
const existingFilter = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'column1',
@@ -93,7 +93,7 @@ describe('AdhocFilterControl', () => {
expect(screen.getByText("column1 = 'test'")).toBeInTheDocument();
});
- test('should call onChange when removing a filter', async () => {
+ it('should call onChange when removing a filter', async () => {
const existingFilter = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'column1',
diff --git a/superset-frontend/src/explore/controlUtils/standardizedFormData.test.ts b/superset-frontend/src/explore/controlUtils/standardizedFormData.test.ts
index 6ef2594563..c7614ba37b 100644
--- a/superset-frontend/src/explore/controlUtils/standardizedFormData.test.ts
+++ b/superset-frontend/src/explore/controlUtils/standardizedFormData.test.ts
@@ -272,7 +272,7 @@ describe('should collect control values and create SFD', () => {
});
});
- test('should avoid to overlap', () => {
+ it('should avoid to overlap', () => {
const sharedControlsSet = new Set(Object.keys(sharedKey));
const publicControlsSet = new Set(publicControls);
expect(
@@ -280,7 +280,7 @@ describe('should collect control values and create SFD', () => {
).toEqual([]);
});
- test('should collect all sharedControls', () => {
+ it('should collect all sharedControls', () => {
expect(Object.entries(sharedControlsFormData).length).toBe(
Object.entries(sharedKey).length,
);
@@ -305,7 +305,7 @@ describe('should collect control values and create SFD', () => {
]);
});
- test('should transform all publicControls and sharedControls', () => {
+ it('should transform all publicControls and sharedControls', () => {
expect(Object.entries(publicControlsFormData).length).toBe(
publicControls.length,
);
@@ -338,7 +338,7 @@ describe('should collect control values and create SFD', () => {
]);
});
- test('should inherit standardizedFormData and memorizedFormData is LIFO', () => {
+ it('should inherit standardizedFormData and memorizedFormData is LIFO', () => {
// from source_viz to target_viz
const sfd = new StandardizedFormData(sourceMockFormData);
const { formData, controlsState } = sfd.transform(
@@ -391,7 +391,7 @@ describe('should transform form_data between table and bigNumberTotal', () => {
);
});
- test('get and has', () => {
+ it('get and has', () => {
// table -> bigNumberTotal
const sfd = new StandardizedFormData(tableVizFormData);
const { formData: bntFormData } = sfd.transform(
@@ -409,7 +409,7 @@ describe('should transform form_data between table and bigNumberTotal', () => {
expect(sfd2.get('table').viz_type).toBe(VizType.Table);
});
- test('transform', () => {
+ it('transform', () => {
// table -> bigNumberTotal
const sfd = new StandardizedFormData(tableVizFormData);
const { formData: bntFormData, controlsState: bntControlsState } =
@@ -459,7 +459,7 @@ describe('initial SFD between different datasource', () => {
);
});
- test('initial SFD between different datasource', () => {
+ it('initial SFD between different datasource', () => {
const sfd = new StandardizedFormData(tableVizFormData);
// table -> big number
const { formData: bntFormData, controlsState: bntControlsState } =
diff --git a/superset-frontend/src/features/dashboards/DashboardCard.test.tsx b/superset-frontend/src/features/dashboards/DashboardCard.test.tsx
index 7734ab155c..0d94423403 100644
--- a/superset-frontend/src/features/dashboards/DashboardCard.test.tsx
+++ b/superset-frontend/src/features/dashboards/DashboardCard.test.tsx
@@ -84,27 +84,27 @@ beforeEach(() => {
);
});
-it('Renders the dashboard title', () => {
+test('Renders the dashboard title', () => {
const titleElement = screen.getByText('Sample Dashboard');
expect(titleElement).toBeInTheDocument();
});
-it('Renders the certification details', () => {
+test('Renders the certification details', () => {
const certificationDetailsElement = screen.getByLabelText(/certified/i);
expect(certificationDetailsElement).toBeInTheDocument();
});
-it('Renders the published status', () => {
+test('Renders the published status', () => {
const publishedElement = screen.getByText(/published/i);
expect(publishedElement).toBeInTheDocument();
});
-it('Renders the modified date', () => {
+test('Renders the modified date', () => {
const modifiedDateElement = screen.getByText('Modified 2 days ago');
expect(modifiedDateElement).toBeInTheDocument();
});
-it('should fetch thumbnail when dashboard has no thumbnail URL and feature flag is enabled', async () => {
+test('should fetch thumbnail when dashboard has no thumbnail URL and feature flag is enabled', async () => {
const mockGet = jest.spyOn(SupersetClient, 'get').mockResolvedValue({
json: { result: { thumbnail_url: '/new-thumbnail.png' } },
} as unknown as JsonResponse);
diff --git a/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx b/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx
index 8b75e15467..b43197e012 100644
--- a/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx
+++ b/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx
@@ -327,7 +327,7 @@ describe('DatabaseModal', () => {
});
describe('Visual: New database connection', () => {
- test('renders the initial load of Step 1 correctly', async () => {
+ it('renders the initial load of Step 1 correctly', async () => {
setup();
// ---------- Components ----------
@@ -421,7 +421,7 @@ describe('DatabaseModal', () => {
expect(footer).toBeEmptyDOMElement();
});
- test('renders the "Basic" tab of SQL Alchemy form (step 2 of 2) correctly', async () => {
+ it('renders the "Basic" tab of SQL Alchemy form (step 2 of 2) correctly', async () => {
setup();
// On step 1, click dbButton to access SQL Alchemy form
@@ -534,7 +534,7 @@ describe('DatabaseModal', () => {
});
});
- test('renders the unexpanded "Advanced" tab correctly', async () => {
+ it('renders the unexpanded "Advanced" tab correctly', async () => {
setup();
// On step 1, click dbButton to access step 2
@@ -611,7 +611,7 @@ describe('DatabaseModal', () => {
});
});
- test('renders the "Advanced" - SQL LAB tab correctly (unexpanded)', async () => {
+ it('renders the "Advanced" - SQL LAB tab correctly (unexpanded)', async () => {
setup();
// ---------- Components ----------
@@ -774,7 +774,7 @@ describe('DatabaseModal', () => {
expect(tooltipButtons).toHaveLength(8);
});
- test('renders the "Advanced" - PERFORMANCE tab correctly', async () => {
+ it('renders the "Advanced" - PERFORMANCE tab correctly', async () => {
setup();
// ---------- Components ----------
@@ -831,7 +831,7 @@ describe('DatabaseModal', () => {
});
});
- test('renders the "Advanced" - SECURITY tab correctly', async () => {
+ it('renders the "Advanced" - SECURITY tab correctly', async () => {
setup();
// ---------- Components ----------
@@ -985,7 +985,7 @@ describe('DatabaseModal', () => {
expect(schemasForFileUploadText).toBeInTheDocument();
});
- test('renders the "Advanced" - OTHER tab correctly', async () => {
+ it('renders the "Advanced" - OTHER tab correctly', async () => {
setup();
// ---------- Components ----------
@@ -1046,7 +1046,7 @@ describe('DatabaseModal', () => {
});
});
- test('Dynamic form', async () => {
+ it('Dynamic form', async () => {
setup();
// ---------- Components ----------
@@ -1063,7 +1063,7 @@ describe('DatabaseModal', () => {
});
describe('Functional: Create new database', () => {
- test('directs databases to the appropriate form (dynamic vs. SQL Alchemy)', async () => {
+ it('directs databases to the appropriate form (dynamic vs. SQL Alchemy)', async () => {
setup();
// ---------- Dynamic example (3-step form)
@@ -1097,7 +1097,7 @@ describe('DatabaseModal', () => {
});
describe('SQL Alchemy form flow', () => {
- test('enters step 2 of 2 when proper database is selected', async () => {
+ it('enters step 2 of 2 when proper database is selected', async () => {
setup();
userEvent.click(
@@ -1109,7 +1109,7 @@ describe('DatabaseModal', () => {
expect(await screen.findByText(/step 2 of 2/i)).toBeInTheDocument();
});
- test('runs fetchResource when "Connect" is clicked', () => {
+ it('runs fetchResource when "Connect" is clicked', () => {
/* ---------- 🐞 TODO (lyndsiWilliams): function mock is not currently working 🐞 ----------
// Mock useSingleViewResource
@@ -1127,7 +1127,7 @@ describe('DatabaseModal', () => {
});
describe('step 2 component interaction', () => {
- test('properly interacts with textboxes', async () => {
+ it('properly interacts with textboxes', async () => {
setup();
userEvent.click(
@@ -1152,7 +1152,7 @@ describe('DatabaseModal', () => {
expect(sqlAlchemyURItextBox).toHaveValue('Different text');
});
- test('runs testDatabaseConnection when "TEST CONNECTION" is clicked', () => {
+ it('runs testDatabaseConnection when "TEST CONNECTION" is clicked', () => {
/* ---------- 🐞 TODO (lyndsiWilliams): function mock is not currently working 🐞 ----------
// Mock testDatabaseConnection
@@ -1173,7 +1173,7 @@ describe('DatabaseModal', () => {
});
describe('SSH Tunnel Form interaction', () => {
- test('properly interacts with SSH Tunnel form textboxes for dynamic form', async () => {
+ it('properly interacts with SSH Tunnel form textboxes for dynamic form', async () => {
setup();
userEvent.click(
@@ -1210,7 +1210,7 @@ describe('DatabaseModal', () => {
expect(SSHTunnelPasswordInput).toHaveValue('pass');
});
- test('properly interacts with SSH Tunnel form textboxes', async () => {
+ it('properly interacts with SSH Tunnel form textboxes', async () => {
setup();
userEvent.click(
@@ -1248,7 +1248,7 @@ describe('DatabaseModal', () => {
expect(SSHTunnelPasswordInput).toHaveValue('pass');
});
- test('if the SSH Tunneling toggle is not true, no inputs are displayed', async () => {
+ it('if the SSH Tunneling toggle is not true, no inputs are displayed', async () => {
setup();
userEvent.click(
@@ -1278,7 +1278,7 @@ describe('DatabaseModal', () => {
expect(SSHTunnelPasswordInput).not.toBeInTheDocument();
});
- test('If user changes the login method, the inputs change', async () => {
+ it('If user changes the login method, the inputs change', async () => {
setup();
userEvent.click(
@@ -1318,7 +1318,7 @@ describe('DatabaseModal', () => {
});
describe('Dynamic form flow', () => {
- test('enters step 2 of 3 when proper database is selected', async () => {
+ it('enters step 2 of 3 when proper database is selected', async () => {
setup();
expect(await screen.findByText(/step 1 of 3/i)).toBeInTheDocument();
@@ -1330,7 +1330,7 @@ describe('DatabaseModal', () => {
expect(await screen.findByText(/step 2 of 3/i)).toBeInTheDocument();
});
- test('enters form credentials and runs fetchResource when "Connect" is clicked', async () => {
+ it('enters form credentials and runs fetchResource when "Connect" is clicked', async () => {
setup();
userEvent.click(
@@ -1379,7 +1379,7 @@ describe('DatabaseModal', () => {
});
describe('Import database flow', () => {
- test('imports a file', async () => {
+ it('imports a file', async () => {
setup();
const importDbButton = (await screen.findByTestId(
@@ -1402,7 +1402,7 @@ describe('DatabaseModal', () => {
});
describe('DatabaseModal w/ Deeplinking Engine', () => {
- test('enters step 2 of 3 when proper database is selected', async () => {
+ it('enters step 2 of 3 when proper database is selected', async () => {
setup({ dbEngine: 'PostgreSQL' });
const step2of3text = await screen.findByText(/step 2 of 3/i);
expect(step2of3text).toBeInTheDocument();
@@ -1484,7 +1484,7 @@ describe('DatabaseModal', () => {
useSingleViewResource: jest.fn(),
}));
- test('Error displays when it is an object', async () => {
+ it('Error displays when it is an object', async () => {
setup({ dbEngine: 'PostgreSQL' });
const step2of3text = await screen.findByText(/step 2 of 3/i);
const errorSection = screen.getByText(/Database Creation Error/i);
@@ -1516,7 +1516,7 @@ describe('DatabaseModal', () => {
setResource: jest.fn(),
});
- test('Error displays when it is a string', async () => {
+ it('Error displays when it is a string', async () => {
setup({ dbEngine: 'PostgreSQL' });
const step2of3text = await screen.findByText(/step 2 of 3/i);
@@ -1541,7 +1541,7 @@ describe('DatabaseModal', () => {
setupExtensions();
});
- test('should render an extension component if one is supplied', async () => {
+ it('should render an extension component if one is supplied', async () => {
setup({ dbEngine: 'SQLite' });
expect(
await screen.findByText('ssh_tunnel.form.switch extension component'),
@@ -1551,13 +1551,13 @@ describe('DatabaseModal', () => {
});
describe('dbReducer', () => {
- test('it will reset state to null', () => {
+ it('will reset state to null', () => {
const action: DBReducerActionType = { type: ActionType.Reset };
const currentState = dbReducer(databaseFixture, action);
expect(currentState).toBeNull();
});
- test('it will set state to payload from fetched', () => {
+ it('will set state to payload from fetched', () => {
const action: DBReducerActionType = {
type: ActionType.Fetched,
payload: databaseFixture,
@@ -1572,7 +1572,7 @@ describe('dbReducer', () => {
});
});
- test('it will set state to payload from extra editor', () => {
+ it('will set state to payload from extra editor', () => {
const action: DBReducerActionType = {
type: ActionType.ExtraEditorChange,
payload: { name: 'foo', json: JSON.stringify({ bar: 1 }) },
@@ -1585,7 +1585,7 @@ describe('dbReducer', () => {
});
});
- test('it will set state to payload from editor', () => {
+ it('will set state to payload from editor', () => {
const action: DBReducerActionType = {
type: ActionType.EditorChange,
payload: { name: 'foo', json: JSON.stringify({ bar: 1 }) },
@@ -1598,7 +1598,7 @@ describe('dbReducer', () => {
});
});
- test('it will add extra payload to existing extra data', () => {
+ it('will add extra payload to existing extra data', () => {
const action: DBReducerActionType = {
type: ActionType.ExtraEditorChange,
payload: { name: 'foo', json: JSON.stringify({ bar: 1 }) },
@@ -1618,7 +1618,7 @@ describe('dbReducer', () => {
});
});
- test('it will set state to payload from extra input change', () => {
+ it('will set state to payload from extra input change', () => {
const action: DBReducerActionType = {
type: ActionType.ExtraInputChange,
payload: { name: 'foo', value: 'bar' },
@@ -1632,7 +1632,7 @@ describe('dbReducer', () => {
});
});
- test('it will set state to payload from encrypted extra input change', () => {
+ it('will set state to payload from encrypted extra input change', () => {
const action: DBReducerActionType = {
type: ActionType.EncryptedExtraInputChange,
payload: { name: 'foo', value: 'bar' },
@@ -1646,7 +1646,7 @@ describe('dbReducer', () => {
});
});
- test('it will set state to payload from extra input change when checkbox', () => {
+ it('will set state to payload from extra input change when checkbox', () => {
const action: DBReducerActionType = {
type: ActionType.ExtraInputChange,
payload: { name: 'foo', type: 'checkbox', checked: true },
@@ -1660,7 +1660,7 @@ describe('dbReducer', () => {
});
});
- test('it will set state to payload from extra input change when schema_cache_timeout', () => {
+ it('will set state to payload from extra input change when schema_cache_timeout', () => {
const action: DBReducerActionType = {
type: ActionType.ExtraInputChange,
payload: { name: 'schema_cache_timeout', value: '10' },
@@ -1674,7 +1674,7 @@ describe('dbReducer', () => {
});
});
- test('it will set state to payload from extra input change when table_cache_timeout', () => {
+ it('will set state to payload from extra input change when table_cache_timeout', () => {
const action: DBReducerActionType = {
type: ActionType.ExtraInputChange,
payload: { name: 'table_cache_timeout', value: '10' },
@@ -1688,7 +1688,7 @@ describe('dbReducer', () => {
});
});
- test('it will overwrite state to payload from extra input change when table_cache_timeout', () => {
+ it('will overwrite state to payload from extra input change when table_cache_timeout', () => {
const action: DBReducerActionType = {
type: ActionType.ExtraInputChange,
payload: { name: 'table_cache_timeout', value: '10' },
@@ -1708,7 +1708,7 @@ describe('dbReducer', () => {
});
});
- test(`it will set state to payload from extra
+ it(`will set state to payload from extra
input change when schemas_allowed_for_file_upload`, () => {
const action: DBReducerActionType = {
type: ActionType.ExtraInputChange,
@@ -1723,7 +1723,7 @@ describe('dbReducer', () => {
});
});
- test(`it will overwrite state to payload from extra
+ it(`will overwrite state to payload from extra
input change when schemas_allowed_for_file_upload`, () => {
const action: DBReducerActionType = {
type: ActionType.ExtraInputChange,
@@ -1744,7 +1744,7 @@ describe('dbReducer', () => {
});
});
- test(`it will set state to payload from extra
+ it(`will set state to payload from extra
input change when schemas_allowed_for_file_upload
with blank list`, () => {
const action: DBReducerActionType = {
@@ -1760,7 +1760,7 @@ describe('dbReducer', () => {
});
});
- test('it will set state to payload from input change', () => {
+ it('will set state to payload from input change', () => {
const action: DBReducerActionType = {
type: ActionType.InputChange,
payload: { name: 'foo', value: 'bar' },
@@ -1773,7 +1773,7 @@ describe('dbReducer', () => {
});
});
- test('it will set state to payload from input change for checkbox', () => {
+ it('will set state to payload from input change for checkbox', () => {
const action: DBReducerActionType = {
type: ActionType.InputChange,
payload: { name: 'foo', type: 'checkbox', checked: true },
@@ -1786,7 +1786,7 @@ describe('dbReducer', () => {
});
});
- test('it will change state to payload from input change for checkbox', () => {
+ it('will change state to payload from input change for checkbox', () => {
const action: DBReducerActionType = {
type: ActionType.InputChange,
payload: { name: 'allow_ctas', type: 'checkbox', checked: false },
@@ -1805,7 +1805,7 @@ describe('dbReducer', () => {
});
});
- test('it will add a parameter', () => {
+ it('will add a parameter', () => {
const action: DBReducerActionType = {
type: ActionType.ParametersChange,
payload: { name: 'host', value: '127.0.0.1' },
@@ -1820,7 +1820,7 @@ describe('dbReducer', () => {
});
});
- test('it will add a parameter with existing parameters', () => {
+ it('will add a parameter with existing parameters', () => {
const action: DBReducerActionType = {
type: ActionType.ParametersChange,
payload: { name: 'port', value: '1234' },
@@ -1844,7 +1844,7 @@ describe('dbReducer', () => {
});
});
- test('it will change a parameter with existing parameters', () => {
+ it('will change a parameter with existing parameters', () => {
const action: DBReducerActionType = {
type: ActionType.ParametersChange,
payload: { name: 'host', value: 'localhost' },
@@ -1867,7 +1867,7 @@ describe('dbReducer', () => {
});
});
- test('it will set state to payload from parametersChange with catalog', () => {
+ it('will set state to payload from parametersChange with catalog', () => {
const action: DBReducerActionType = {
type: ActionType.ParametersChange,
payload: { name: 'name', type: 'catalog-0', value: 'bar' },
@@ -1888,7 +1888,7 @@ describe('dbReducer', () => {
});
});
- test('it will add a new catalog array when empty', () => {
+ it('will add a new catalog array when empty', () => {
const action: DBReducerActionType = {
type: ActionType.AddTableCatalogSheet,
};
@@ -1900,7 +1900,7 @@ describe('dbReducer', () => {
});
});
- test('it will add a new catalog array when one exists', () => {
+ it('will add a new catalog array when one exists', () => {
const action: DBReducerActionType = {
type: ActionType.AddTableCatalogSheet,
};
@@ -1918,7 +1918,7 @@ describe('dbReducer', () => {
});
});
- test('it will remove a catalog when one exists', () => {
+ it('will remove a catalog when one exists', () => {
const action: DBReducerActionType = {
type: ActionType.RemoveTableCatalogSheet,
payload: { indexToDelete: 0 },
@@ -1934,7 +1934,7 @@ describe('dbReducer', () => {
});
});
- test('it will add db information when one is selected', () => {
+ it('will add db information when one is selected', () => {
const { backend, ...db } = databaseFixture;
const action: DBReducerActionType = {
type: ActionType.DbSelected,
@@ -1967,7 +1967,7 @@ describe('dbReducer', () => {
});
});
- test('it will add a SSH Tunnel config parameter', () => {
+ it('will add a SSH Tunnel config parameter', () => {
const action: DBReducerActionType = {
type: ActionType.ParametersSSHTunnelChange,
payload: { name: 'server_address', value: '127.0.0.1' },
@@ -1982,7 +1982,7 @@ describe('dbReducer', () => {
});
});
- test('it will add a SSH Tunnel config parameter with existing configs', () => {
+ it('will add a SSH Tunnel config parameter with existing configs', () => {
const action: DBReducerActionType = {
type: ActionType.ParametersSSHTunnelChange,
payload: { name: 'server_port', value: '22' },
@@ -2006,7 +2006,7 @@ describe('dbReducer', () => {
});
});
- test('it will change a SSH Tunnel config parameter with existing configs', () => {
+ it('will change a SSH Tunnel config parameter with existing configs', () => {
const action: DBReducerActionType = {
type: ActionType.ParametersSSHTunnelChange,
payload: { name: 'server_address', value: 'localhost' },
@@ -2029,7 +2029,7 @@ describe('dbReducer', () => {
});
});
- test('it will remove the SSH Tunnel config parameters', () => {
+ it('will remove the SSH Tunnel config parameters', () => {
const action: DBReducerActionType = {
type: ActionType.RemoveSSHTunnelConfig,
};
diff --git a/superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx b/superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx
index b7292087b9..53a2e8676e 100644
--- a/superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx
+++ b/superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx
@@ -125,7 +125,7 @@ const expectElementsNotVisible = (elements: any[]) => {
};
describe('UploadDataModal - General Information Elements', () => {
- test('CSV renders correctly', () => {
+ it('CSV renders correctly', () => {
render(<UploadDataModal {...csvProps} />, { useRedux: true });
const common = getCommonElements();
@@ -151,7 +151,7 @@ describe('UploadDataModal - General Information Elements', () => {
]);
});
- test('Excel renders correctly', () => {
+ it('Excel renders correctly', () => {
render(<UploadDataModal {...excelProps} />, { useRedux: true });
const common = getCommonElements();
@@ -183,7 +183,7 @@ describe('UploadDataModal - General Information Elements', () => {
).not.toBeInTheDocument();
});
- test('Columnar renders correctly', () => {
+ it('Columnar renders correctly', () => {
render(<UploadDataModal {...columnarProps} />, { useRedux: true });
const common = getCommonElements();
@@ -218,7 +218,7 @@ describe('UploadDataModal - File Settings Elements', () => {
await userEvent.click(panelHeader);
};
- test('CSV file settings render correctly', async () => {
+ it('CSV file settings render correctly', async () => {
render(<UploadDataModal {...csvProps} />, { useRedux: true });
expect(
@@ -238,7 +238,7 @@ describe('UploadDataModal - File Settings Elements', () => {
expectElementsVisible(elements);
});
- test('Excel file settings render correctly', async () => {
+ it('Excel file settings render correctly', async () => {
render(<UploadDataModal {...excelProps} />, { useRedux: true });
expect(
@@ -262,7 +262,7 @@ describe('UploadDataModal - File Settings Elements', () => {
]);
});
- test('Columnar file settings render correctly', async () => {
+ it('Columnar file settings render correctly', async () => {
render(<UploadDataModal {...columnarProps} />, { useRedux: true });
expect(
@@ -296,7 +296,7 @@ describe('UploadDataModal - Columns Elements', () => {
await userEvent.click(panelHeader);
};
- test('CSV columns render correctly', async () => {
+ it('CSV columns render correctly', async () => {
render(<UploadDataModal {...csvProps} />, { useRedux: true });
await openColumns();
@@ -314,7 +314,7 @@ describe('UploadDataModal - Columns Elements', () => {
expectElementsVisible(elements);
});
- test('Excel columns render correctly', async () => {
+ it('Excel columns render correctly', async () => {
render(<UploadDataModal {...excelProps} />, { useRedux: true });
await openColumns();
@@ -336,7 +336,7 @@ describe('UploadDataModal - Columns Elements', () => {
).not.toBeInTheDocument();
});
- test('Columnar columns render correctly', async () => {
+ it('Columnar columns render correctly', async () => {
render(<UploadDataModal {...columnarProps} />, { useRedux: true });
await openColumns();
@@ -360,7 +360,7 @@ describe('UploadDataModal - Columns Elements', () => {
});
describe('UploadDataModal - Rows Elements', () => {
- test('CSV/Excel rows render correctly', async () => {
+ it('CSV/Excel rows render correctly', async () => {
render(<UploadDataModal {...csvProps} />, { useRedux: true });
const panelHeader = screen.getByText(/rows/i);
@@ -375,7 +375,7 @@ describe('UploadDataModal - Rows Elements', () => {
expectElementsVisible(elements);
});
- test('Columnar does not render rows', () => {
+ it('Columnar does not render rows', () => {
render(<UploadDataModal {...columnarProps} />, { useRedux: true });
const panelHeader = screen.queryByText(/rows/i);
@@ -384,7 +384,7 @@ describe('UploadDataModal - Rows Elements', () => {
});
describe('UploadDataModal - Database and Schema Population', () => {
- test('database and schema are correctly populated', async () => {
+ it('database and schema are correctly populated', async () => {
render(<UploadDataModal {...csvProps} />, { useRedux: true });
const selectDatabase = screen.getByRole('combobox', {
@@ -413,7 +413,7 @@ describe('UploadDataModal - Database and Schema Population', () => {
});
describe('UploadDataModal - Form Validation', () => {
- test('form validation without required fields', async () => {
+ it('form validation without required fields', async () => {
render(<UploadDataModal {...csvProps} />, { useRedux: true });
const uploadButton = screen.getByRole('button', { name: 'Upload' });
@@ -471,7 +471,7 @@ describe('UploadDataModal - Form Submission', () => {
return fetchMock.calls('glob:*api/v1/database/1/upload/')[0];
};
- test('CSV form submission', async () => {
+ it('CSV form submission', async () => {
render(<UploadDataModal {...csvProps} />, { useRedux: true });
const [, options] = await fillForm('csv', 'test.csv');
@@ -483,7 +483,7 @@ describe('UploadDataModal - Form Submission', () => {
expect((formData.get('file') as File).name).toBe('test.csv');
});
- test('Excel form submission', async () => {
+ it('Excel form submission', async () => {
render(<UploadDataModal {...excelProps} />, { useRedux: true });
const [, options] = await fillForm('excel', 'test.xls', 'text');
@@ -495,7 +495,7 @@ describe('UploadDataModal - Form Submission', () => {
expect((formData.get('file') as File).name).toBe('test.xls');
});
- test('Columnar form submission', async () => {
+ it('Columnar form submission', async () => {
render(<UploadDataModal {...columnarProps} />, { useRedux: true });
const [, options] = await fillForm('columnar', 'test.parquet', 'text');
@@ -517,7 +517,7 @@ describe('File Extension Validation', () => {
});
describe('CSV validation', () => {
- test('returns false for invalid extensions', () => {
+ it('returns false for invalid extensions', () => {
const invalidFiles = ['out', 'out.exe', 'out.csv.exe', '.csv', 'out.xls'];
invalidFiles.forEach(fileName => {
expect(
@@ -526,7 +526,7 @@ describe('File Extension Validation', () => {
});
});
- test('returns true for valid extensions', () => {
+ it('returns true for valid extensions', () => {
const validFiles = ['out.csv', 'out.tsv', 'out.exe.csv', 'out a.csv'];
validFiles.forEach(fileName => {
expect(
@@ -537,7 +537,7 @@ describe('File Extension Validation', () => {
});
describe('Excel validation', () => {
- test('returns false for invalid extensions', () => {
+ it('returns false for invalid extensions', () => {
const invalidFiles = ['out', 'out.exe', 'out.xls.exe', '.csv', 'out.csv'];
invalidFiles.forEach(fileName => {
expect(
@@ -549,7 +549,7 @@ describe('File Extension Validation', () => {
});
});
- test('returns true for valid extensions', () => {
+ it('returns true for valid extensions', () => {
const validFiles = ['out.xls', 'out.xlsx', 'out.exe.xls', 'out a.xls'];
validFiles.forEach(fileName => {
expect(
@@ -563,7 +563,7 @@ describe('File Extension Validation', () => {
});
describe('Columnar validation', () => {
- test('returns false for invalid extensions', () => {
+ it('returns false for invalid extensions', () => {
const invalidFiles = [
'out',
'out.exe',
@@ -581,7 +581,7 @@ describe('File Extension Validation', () => {
});
});
- test('returns true for valid extensions', () => {
+ it('returns true for valid extensions', () => {
const validFiles = [
'out.parquet',
'out.zip',
diff --git a/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.test.tsx b/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.test.tsx
index 03556a5c6f..2936d3bf1f 100644
--- a/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.test.tsx
+++ b/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.test.tsx
@@ -44,7 +44,7 @@ jest.mock(
);
describe('DatasetPanel', () => {
- test('renders a blank state DatasetPanel', () => {
+ it('renders a blank state DatasetPanel', () => {
render(<DatasetPanel hasError={false} columnList={[]} loading={false} />, {
useRouter: true,
});
@@ -67,7 +67,7 @@ describe('DatasetPanel', () => {
expect(sqlLabLink).toBeVisible();
});
- test('renders a no columns screen', () => {
+ it('renders a no columns screen', () => {
render(
<DatasetPanel
tableName="Name"
@@ -88,7 +88,7 @@ describe('DatasetPanel', () => {
expect(noColumnsDescription).toBeVisible();
});
- test('renders a loading screen', () => {
+ it('renders a loading screen', () => {
render(
<DatasetPanel
tableName="Name"
@@ -107,7 +107,7 @@ describe('DatasetPanel', () => {
expect(blankDatasetTitle).toBeVisible();
});
- test('renders an error screen', () => {
+ it('renders an error screen', () => {
render(
<DatasetPanel
tableName="Name"
@@ -126,7 +126,7 @@ describe('DatasetPanel', () => {
expect(errorDescription).toBeVisible();
});
- test('renders a table with columns displayed', async () => {
+ it('renders a table with columns displayed', async () => {
const tableName = 'example_name';
render(
<DatasetPanel
@@ -153,7 +153,7 @@ describe('DatasetPanel', () => {
});
});
- test('renders an info banner if table already has a dataset', async () => {
+ it('renders an info banner if table already has a dataset', async () => {
render(
<DatasetPanel
tableName="example_table"
diff --git a/superset-frontend/src/features/datasets/AddDataset/Footer/Footer.test.tsx b/superset-frontend/src/features/datasets/AddDataset/Footer/Footer.test.tsx
index fa81ce20e0..6556d040e3 100644
--- a/superset-frontend/src/features/datasets/AddDataset/Footer/Footer.test.tsx
+++ b/superset-frontend/src/features/datasets/AddDataset/Footer/Footer.test.tsx
@@ -64,7 +64,7 @@ describe('Footer', () => {
jest.clearAllMocks();
});
- test('renders a Footer with a cancel button and a disabled create button', () => {
+ it('renders a Footer with a cancel button and a disabled create button', () => {
render(<Footer {...mockedProps} />, { useRedux: true });
const saveButton = screen.getByRole('button', {
@@ -79,7 +79,7 @@ describe('Footer', () => {
expect(createButton).toBeDisabled();
});
- test('renders a Create Dataset dropdown button when a table is selected', () => {
+ it('renders a Create Dataset dropdown button when a table is selected', () => {
render(<Footer {...mockPropsWithDataset} />, { useRedux: true });
const createButton = screen.getByRole('button', {
@@ -96,7 +96,7 @@ describe('Footer', () => {
expect(dropdownArrow).toBeInTheDocument();
});
- test('create button becomes disabled when table already has a dataset', () => {
+ it('create button becomes disabled when table already has a dataset', () => {
render(<Footer datasets={['real_info']} {...mockPropsWithDataset} />, {
useRedux: true,
});
@@ -108,7 +108,7 @@ describe('Footer', () => {
expect(createButton).toBeDisabled();
});
- test('shows dropdown menu when dropdown arrow is clicked', async () => {
+ it('shows dropdown menu when dropdown arrow is clicked', async () => {
render(<Footer {...mockPropsWithDataset} />, { useRedux: true });
// Find and click the dropdown trigger (the arrow part)
@@ -121,7 +121,7 @@ describe('Footer', () => {
});
});
- test('navigates to chart creation when main button is clicked', async () => {
+ it('navigates to chart creation when main button is clicked', async () => {
mockCreateResource.mockResolvedValue(123); // Mock successful dataset creation
render(<Footer {...mockPropsWithDataset} />, { useRedux: true });
@@ -145,7 +145,7 @@ describe('Footer', () => {
});
});
- test('navigates to dataset list when "Create dataset only" menu option is clicked', async () => {
+ it('navigates to dataset list when "Create dataset only" menu option is clicked', async () => {
mockCreateResource.mockResolvedValue(123);
render(<Footer {...mockPropsWithDataset} />, { useRedux: true });
@@ -171,7 +171,7 @@ describe('Footer', () => {
});
});
- test('handles dataset creation failure gracefully', async () => {
+ it('handles dataset creation failure gracefully', async () => {
mockCreateResource.mockResolvedValue(null); // Mock failed dataset creation
render(<Footer {...mockPropsWithDataset} />, { useRedux: true });
@@ -189,7 +189,7 @@ describe('Footer', () => {
});
});
- test('passes correct data to createResource with catalog', async () => {
+ it('passes correct data to createResource with catalog', async () => {
const mockPropsWithCatalog = {
...mockPropsWithDataset,
datasetObject: {
diff --git a/superset-frontend/src/features/datasets/AddDataset/Header/Header.test.tsx b/superset-frontend/src/features/datasets/AddDataset/Header/Header.test.tsx
index b09b36857b..23c94f79d9 100644
--- a/superset-frontend/src/features/datasets/AddDataset/Header/Header.test.tsx
+++ b/superset-frontend/src/features/datasets/AddDataset/Header/Header.test.tsx
@@ -25,7 +25,7 @@ describe('Header', () => {
const waitForRender = (props?: any) =>
waitFor(() => render(<Header setDataset={mockSetDataset} {...props} />));
- test('renders a blank state Header', async () => {
+ it('renders a blank state Header', async () => {
await waitForRender();
const datasetName = screen.getByText(/new dataset/i);
@@ -33,14 +33,14 @@ describe('Header', () => {
expect(datasetName).toBeVisible();
});
- test('displays "New dataset" when a table is not selected', async () => {
+ it('displays "New dataset" when a table is not selected', async () => {
await waitForRender();
const datasetName = screen.getByText(/new dataset/i);
expect(datasetName.innerHTML).toBe(DEFAULT_TITLE);
});
- test('displays table name when a table is selected', async () => {
+ it('displays table name when a table is selected', async () => {
// The schema and table name are passed in through props once selected
await waitForRender({ schema: 'testSchema', title: 'testTable' });
diff --git a/superset-frontend/src/features/tags/BulkTagModal.test.tsx b/superset-frontend/src/features/tags/BulkTagModal.test.tsx
index d590dd551e..a1860df078 100644
--- a/superset-frontend/src/features/tags/BulkTagModal.test.tsx
+++ b/superset-frontend/src/features/tags/BulkTagModal.test.tsx
@@ -42,12 +42,12 @@ describe('BulkTagModal', () => {
jest.clearAllMocks();
});
- test('should render', () => {
+ it('should render', () => {
const { container } = render(<BulkTagModal {...mockedProps} />);
expect(container).toBeInTheDocument();
});
- test('renders the correct title and message', () => {
+ it('renders the correct title and message', () => {
render(<BulkTagModal {...mockedProps} />);
expect(
screen.getByText(/you are adding tags to 2 dashboards/i),
@@ -55,20 +55,20 @@ describe('BulkTagModal', () => {
expect(screen.getByText('Bulk tag')).toBeInTheDocument();
});
- test('renders tags input field', async () => {
+ it('renders tags input field', async () => {
render(<BulkTagModal {...mockedProps} />);
const tagsInput = await screen.findByRole('combobox', { name: /tags/i });
expect(tagsInput).toBeInTheDocument();
});
- test('calls onHide when the Cancel button is clicked', () => {
+ it('calls onHide when the Cancel button is clicked', () => {
render(<BulkTagModal {...mockedProps} />);
const cancelButton = screen.getByText('Cancel');
fireEvent.click(cancelButton);
expect(mockedProps.onHide).toHaveBeenCalled();
});
- test('submits the selected tags and shows success toast', async () => {
+ it('submits the selected tags and shows success toast', async () => {
fetchMock.post('glob:*/api/v1/tag/bulk_create', {
result: {
objects_tagged: [1, 2],
@@ -94,7 +94,7 @@ describe('BulkTagModal', () => {
expect(mockedProps.onHide).toHaveBeenCalled();
});
- test('handles API errors gracefully', async () => {
+ it('handles API errors gracefully', async () => {
fetchMock.post('glob:*/api/v1/tag/bulk_create', 500);
render(<BulkTagModal {...mockedProps} />);
diff --git a/superset-frontend/src/features/themes/ThemeModal.test.tsx b/superset-frontend/src/features/themes/ThemeModal.test.tsx
index 57e05b51c0..25b8b88305 100644
--- a/superset-frontend/src/features/themes/ThemeModal.test.tsx
+++ b/superset-frontend/src/features/themes/ThemeModal.test.tsx
@@ -134,13 +134,13 @@ describe('ThemeModal', () => {
fetchMock.restore();
});
- test('should export ThemeModal component', () => {
+ it('should export ThemeModal component', () => {
const ThemeModalModule = jest.requireActual('./ThemeModal');
expect(ThemeModalModule.default).toBeDefined();
expect(typeof ThemeModalModule.default).toBe('object'); // HOC wrapped component
});
- test('should have correct type definitions', () => {
+ it('should have correct type definitions', () => {
expect(mockTheme).toMatchObject({
id: expect.any(Number),
theme_name: expect.any(String),
@@ -153,7 +153,7 @@ describe('ThemeModal', () => {
});
});
- test('should validate JSON data structure', () => {
+ it('should validate JSON data structure', () => {
const isValidJson = (str: string) => {
try {
JSON.parse(str);
@@ -168,7 +168,7 @@ describe('ThemeModal', () => {
expect(isValidJson('{"valid": "json"}')).toBe(true);
});
- test('should handle theme data parsing', () => {
+ it('should handle theme data parsing', () => {
const parsedTheme = JSON.parse(mockTheme.json_data || '{}');
expect(parsedTheme).toMatchObject({
colors: {
@@ -181,7 +181,7 @@ describe('ThemeModal', () => {
});
});
- test('should mock theme context functions', () => {
+ it('should mock theme context functions', () => {
expect(mockThemeContext.setTemporaryTheme).toBeDefined();
expect(mockThemeContext.clearLocalOverrides).toBeDefined();
expect(mockThemeContext.hasDevOverride).toBeDefined();
@@ -190,7 +190,7 @@ describe('ThemeModal', () => {
expect(typeof mockThemeContext.hasDevOverride).toBe('function');
});
- test('should handle API response structure', () => {
+ it('should handle API response structure', () => {
// Test that fetch mock is properly configured
expect(fetchMock.called()).toBe(false);
@@ -205,7 +205,7 @@ describe('ThemeModal', () => {
});
});
- test('should handle create theme API call', () => {
+ it('should handle create theme API call', () => {
const newTheme = {
theme_name: 'New Theme',
json_data: '{"colors": {"primary": "#ff0000"}}',
@@ -221,7 +221,7 @@ describe('ThemeModal', () => {
expect(() => JSON.parse(newTheme.json_data)).not.toThrow();
});
- test('should handle update theme API call', () => {
+ it('should handle update theme API call', () => {
const updatedTheme = {
theme_name: 'Updated Theme',
json_data: '{"colors": {"primary": "#00ff00"}}',
@@ -237,7 +237,7 @@ describe('ThemeModal', () => {
expect(() => JSON.parse(updatedTheme.json_data)).not.toThrow();
});
- test('should validate theme name requirements', () => {
+ it('should validate theme name requirements', () => {
const validateThemeName = (name: string) => !!(name && name.length > 0);
expect(validateThemeName('Valid Theme')).toBe(true);
@@ -245,7 +245,7 @@ describe('ThemeModal', () => {
expect(validateThemeName('Test')).toBe(true);
});
- test('should validate JSON configuration requirements', () => {
+ it('should validate JSON configuration requirements', () => {
const validateJsonData = (jsonData: string) => {
if (!jsonData || jsonData.length === 0) return false;
try {
@@ -262,7 +262,7 @@ describe('ThemeModal', () => {
expect(validateJsonData('{}')).toBe(true);
});
- test('should handle permission-based feature availability', () => {
+ it('should handle permission-based feature availability', () => {
const permissionUtils = jest.requireMock(
'src/dashboard/util/permissionUtils',
);
@@ -276,7 +276,7 @@ describe('ThemeModal', () => {
expect(permissionUtils.isUserAdmin()).toBe(false);
});
- test('should handle theme context override state', () => {
+ it('should handle theme context override state', () => {
expect(mockThemeContext.hasDevOverride()).toBe(false);
// Test with override
diff --git a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
index c867077f3e..69679e10e0 100644
--- a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
+++ b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
@@ -119,7 +119,7 @@ describe('SelectFilterPlugin', () => {
jest.clearAllMocks();
});
- test('Add multiple values with first render', async () => {
+ it('Add multiple values with first render', async () => {
getWrapper();
expect(setDataMask).toHaveBeenCalledWith({
extraFormData: {
@@ -162,7 +162,7 @@ describe('SelectFilterPlugin', () => {
});
});
- test('Remove multiple values when required', () => {
+ it('Remove multiple values when required', () => {
getWrapper();
userEvent.click(
screen.getByRole('img', {
@@ -188,7 +188,7 @@ describe('SelectFilterPlugin', () => {
});
});
- test('Remove multiple values when not required', () => {
+ it('Remove multiple values when not required', () => {
getWrapper({ enableEmptyFilter: false });
userEvent.click(
screen.getByRole('img', {
@@ -206,7 +206,7 @@ describe('SelectFilterPlugin', () => {
});
});
- test('Select single values with inverse', async () => {
+ it('Select single values with inverse', async () => {
getWrapper({ multiSelect: false, inverseSelection: true });
// Get the main filter select (second combobox)
@@ -233,7 +233,7 @@ describe('SelectFilterPlugin', () => {
});
});
- test('Select single null (empty) value', async () => {
+ it('Select single null (empty) value', async () => {
getWrapper();
const filterSelect = screen.getAllByRole('combobox')[0];
userEvent.click(filterSelect);
@@ -257,7 +257,7 @@ describe('SelectFilterPlugin', () => {
});
});
- test('receives the correct filter when search all options', async () => {
+ it('receives the correct filter when search all options', async () => {
getWrapper({ searchAllOptions: true, multiSelect: false });
const filterSelect = screen.getAllByRole('combobox')[0];
userEvent.click(filterSelect);
@@ -278,7 +278,7 @@ describe('SelectFilterPlugin', () => {
);
});
- test('number of fired queries when searching', async () => {
+ it('number of fired queries when searching', async () => {
getWrapper({ searchAllOptions: true });
const filterSelect = screen.getAllByRole('combobox')[0];
userEvent.click(filterSelect);
@@ -288,7 +288,7 @@ describe('SelectFilterPlugin', () => {
expect(setDataMask).toHaveBeenCalledTimes(2);
});
- test('Select big int value', async () => {
+ it('Select big int value', async () => {
const bigValue = 1100924931345932234n;
render(
// @ts-ignore
@@ -335,17 +335,17 @@ describe('SelectFilterPlugin', () => {
).toBeInTheDocument();
});
- test('Is/Is Not select is visible when inverseSelection is true', () => {
+ it('Is/Is Not select is visible when inverseSelection is true', () => {
getWrapper({ inverseSelection: true });
expect(screen.getByText('is not')).toBeInTheDocument();
});
- test('Is/Is Not select is not visible when inverseSelection is false', () => {
+ it('Is/Is Not select is not visible when inverseSelection is false', () => {
getWrapper({ inverseSelection: false });
expect(screen.queryByText('is not')).not.toBeInTheDocument();
});
- test('Is/Is Not select toggles correctly', async () => {
+ it('Is/Is Not select toggles correctly', async () => {
getWrapper({ inverseSelection: true });
const isNotSelect = screen.getByText('is not');
@@ -367,13 +367,13 @@ describe('SelectFilterPlugin', () => {
);
});
- test('Should not allow for new values when creatable is false', () => {
+ it('Should not allow for new values when creatable is false', () => {
getWrapper({ creatable: false });
userEvent.type(screen.getByRole('combobox'), 'new value');
expect(screen.queryByTitle('new value')).not.toBeInTheDocument();
});
- test('Should allow for new values when creatable is true', async () => {
+ it('Should allow for new values when creatable is true', async () => {
getWrapper({ creatable: true });
userEvent.type(screen.getByRole('combobox'), 'new value');
expect(await screen.findByTitle('new value')).toBeInTheDocument();
diff --git a/superset-frontend/src/hooks/apiResources/schemas.test.ts b/superset-frontend/src/hooks/apiResources/schemas.test.ts
index 85751a2fee..bcc870db1f 100644
--- a/superset-frontend/src/hooks/apiResources/schemas.test.ts
+++ b/superset-frontend/src/hooks/apiResources/schemas.test.ts
@@ -58,7 +58,7 @@ describe('useSchemas hook', () => {
store.dispatch(api.util.resetApiState());
});
- test('returns api response mapping json result', async () => {
+ it('returns api response mapping json result', async () => {
const expectDbId = 'db1';
const forceRefresh = false;
const schemaApiRoute = `glob:*/api/v1/database/${expectDbId}/schemas/*`;
@@ -102,7 +102,7 @@ describe('useSchemas hook', () => {
expect(result.current.data).toEqual(expectedResult);
});
- test('returns cached data without api request', async () => {
+ it('returns cached data without api request', async () => {
const expectDbId = 'db1';
const schemaApiRoute = `glob:*/api/v1/database/${expectDbId}/schemas/*`;
fetchMock.get(schemaApiRoute, fakeApiResult);
@@ -125,7 +125,7 @@ describe('useSchemas hook', () => {
expect(fetchMock.calls(schemaApiRoute).length).toBe(1);
});
- test('returns refreshed data after expires', async () => {
+ it('returns refreshed data after expires', async () => {
const expectDbId = 'db1';
const schemaApiRoute = `glob:*/api/v1/database/*/schemas/*`;
fetchMock.get(schemaApiRoute, url =>
@@ -179,7 +179,7 @@ describe('useSchemas hook', () => {
);
});
- test('returns correct schema list by a catalog', async () => {
+ it('returns correct schema list by a catalog', async () => {
const dbId = '1';
const expectCatalog = 'catalog3';
const schemaApiRoute = `glob:*/api/v1/database/*/schemas/*`;
diff --git a/superset-frontend/src/hooks/apiResources/tables.test.ts b/superset-frontend/src/hooks/apiResources/tables.test.ts
index 6dd6e48dc9..714a4bf076 100644
--- a/superset-frontend/src/hooks/apiResources/tables.test.ts
+++ b/superset-frontend/src/hooks/apiResources/tables.test.ts
@@ -76,7 +76,7 @@ describe('useTables hook', () => {
store.dispatch(api.util.resetApiState());
});
- test('returns api response mapping json options', async () => {
+ it('returns api response mapping json options', async () => {
const expectDbId = 'db1';
const expectedSchema = 'schema1';
const catalogApiRoute = `glob:*/api/v1/database/${expectDbId}/catalogs/*`;
@@ -127,7 +127,7 @@ describe('useTables hook', () => {
expect(result.current.data).toEqual(expectedData);
});
- test('skips the deprecated schema option', async () => {
+ it('skips the deprecated schema option', async () => {
const expectDbId = 'db1';
const unexpectedSchema = 'invalid schema';
const catalogApiRoute = `glob:*/api/v1/database/${expectDbId}/catalogs/*`;
@@ -163,7 +163,7 @@ describe('useTables hook', () => {
).toBe(0);
});
- test('returns hasMore when total is larger than result size', async () => {
+ it('returns hasMore when total is larger than result size', async () => {
const expectDbId = 'db1';
const expectedSchema = 'schema2';
const tableApiRoute = `glob:*/api/v1/database/${expectDbId}/tables/?q=*`;
@@ -192,7 +192,7 @@ describe('useTables hook', () => {
expect(result.current.data).toEqual(expectedHasMoreData);
});
- test('returns cached data without api request', async () => {
+ it('returns cached data without api request', async () => {
const expectDbId = 'db1';
const expectedSchema = 'schema1';
const tableApiRoute = `glob:*/api/v1/database/${expectDbId}/tables/?q=*`;
@@ -233,7 +233,7 @@ describe('useTables hook', () => {
expect(fetchMock.calls(tableApiRoute).length).toBe(1);
});
- test('returns refreshed data after expires', async () => {
+ it('returns refreshed data after expires', async () => {
const expectDbId = 'db1';
const expectedSchema = 'schema1';
const tableApiRoute = `glob:*/api/v1/database/${expectDbId}/tables/?q=*`;
diff --git a/superset-frontend/src/hooks/useDebounceValue.test.ts b/superset-frontend/src/hooks/useDebounceValue.test.ts
index 227862f9ca..1a130b214e 100644
--- a/superset-frontend/src/hooks/useDebounceValue.test.ts
+++ b/superset-frontend/src/hooks/useDebounceValue.test.ts
@@ -52,7 +52,7 @@ test('should update debounced value after delay', async () => {
expect(result.current).toBe('world');
});
-it('should cancel previous timeout when value changes', async () => {
+test('should cancel previous timeout when value changes', async () => {
jest.useFakeTimers();
const { result, rerender } = renderHook(
({ value, delay }) => useDebounceValue(value, delay),
diff --git a/superset-frontend/src/pages/Chart/Chart.test.tsx b/superset-frontend/src/pages/Chart/Chart.test.tsx
index 918199d515..99deb0276c 100644
--- a/superset-frontend/src/pages/Chart/Chart.test.tsx
+++ b/superset-frontend/src/pages/Chart/Chart.test.tsx
@@ -70,7 +70,7 @@ describe('ChartPage', () => {
fetchMock.reset();
});
- test('fetches metadata on mount', async () => {
+ it('fetches metadata on mount', async () => {
const exploreApiRoute = 'glob:*/api/v1/explore/*';
const exploreFormData = getExploreFormData({
viz_type: VizType.Table,
@@ -93,7 +93,7 @@ describe('ChartPage', () => {
);
});
- test('displays the dataset name and error when it is prohibited', async () => {
+ it('displays the dataset name and error when it is prohibited', async () => {
const chartApiRoute = `glob:*/api/v1/chart/*`;
const exploreApiRoute = 'glob:*/api/v1/explore/*';
const expectedDatasourceName = 'failed datasource name';
@@ -135,7 +135,7 @@ describe('ChartPage', () => {
expect(fetchMock.calls(exploreApiRoute).length).toBeGreaterThanOrEqual(1);
});
- test('fetches the chart api when explore metadata is prohibited and access from the chart link', async () => {
+ it('fetches the chart api when explore metadata is prohibited and access from the chart link', async () => {
const expectedChartId = 7;
const expectedChartName = 'Unauthorized dataset owned chart name';
(getParsedExploreURLParams as jest.Mock).mockReturnValue(
@@ -195,7 +195,7 @@ describe('ChartPage', () => {
(getFormDataWithExtraFilters as jest.Mock).mockClear();
});
- test('overrides the form_data with dashboardContextFormData', async () => {
+ it('overrides the form_data with dashboardContextFormData', async () => {
const dashboardFormData = getDashboardFormData();
(getFormDataWithExtraFilters as jest.Mock).mockReturnValue(
dashboardFormData,
@@ -226,7 +226,7 @@ describe('ChartPage', () => {
);
});
- test('overrides the form_data with exploreFormData when location is updated', async () => {
+ it('overrides the form_data with exploreFormData when location is updated', async () => {
const dashboardFormData = {
...getDashboardFormData(),
viz_type: VizType.Table,