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/26 07:33:42 UTC
(superset) 02/02: test(frontend): Auto-migrate all 'it' to 'test' using ESLint fix
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch block-describe-and-it
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 8d4f6d57af44b3712391f3e9963385ad85a42c53
Author: Evan Rusackas <ev...@rusackas.com>
AuthorDate: Fri Sep 26 00:26:39 2025 -0700
test(frontend): Auto-migrate all 'it' to 'test' using ESLint fix
- Applied jest/consistent-test-it rule with auto-fix
- Converted 194 test files from 'it' to 'test'
- Following Kent C. Dodds' testing best practices
- Part of migration away from nested describe blocks
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <no...@anthropic.com>
---
.../src/SqlLab/actions/sqlLab.test.js | 108 ++++++++++-----------
.../AceEditorWrapper/AceEditorWrapper.test.tsx | 6 +-
.../src/SqlLab/components/App/App.test.tsx | 10 +-
.../ColumnElement/ColumnElement.test.tsx | 8 +-
.../EstimateQueryCostButton.test.tsx | 10 +-
.../ExploreCtasResultsButton.test.tsx | 6 +-
.../ExploreResultsButton.test.tsx | 4 +-
.../QueryAutoRefresh/QueryAutoRefresh.test.tsx | 22 ++---
.../QueryLimitSelect/QueryLimitSelect.test.tsx | 14 +--
.../RunQueryActionButton.test.tsx | 16 +--
.../SaveDatasetModal/SaveDatasetModal.test.tsx | 26 ++---
.../SqlLab/components/SaveQuery/SaveQuery.test.tsx | 20 ++--
.../ShareSqlLabQuery/ShareSqlLabQuery.test.tsx | 4 +-
.../SqlLab/components/SqlEditor/SqlEditor.test.tsx | 26 ++---
.../SqlEditorTabHeader/SqlEditorTabHeader.test.tsx | 16 +--
.../TemplateParamsEditor.test.tsx | 8 +-
.../src/SqlLab/reducers/getInitialState.test.ts | 16 +--
.../src/SqlLab/reducers/sqlLab.test.js | 56 +++++------
.../src/SqlLab/utils/emptyQueryResults.test.ts | 6 +-
.../src/SqlLab/utils/newQueryTabName.test.ts | 4 +-
.../components/AlteredSliceTag/utils/utils.test.ts | 44 ++++-----
.../components/Chart/ChartErrorMessage.test.tsx | 4 +-
.../src/components/Chart/chartActions.test.js | 32 +++---
.../src/components/Chart/chartReducers.test.js | 4 +-
.../DatasourceModal/DatasourceModal.test.jsx | 14 +--
.../tests/DatasourceEditor.test.jsx | 18 ++--
.../tests/DatasourceEditorCurrency.test.jsx | 2 +-
.../tests/DatasourceEditorRTL.test.jsx | 8 +-
.../src/components/Datasource/utils/utils.test.tsx | 10 +-
.../components/ErrorMessage/ErrorAlert.test.tsx | 8 +-
.../ErrorMessage/InvalidSQLErrorMessage.test.tsx | 10 +-
.../ErrorMessage/OAuth2RedirectMessage.test.tsx | 12 +--
.../src/components/FacePile/FacePile.test.tsx | 18 ++--
.../FilterableTable/FilterableTable.test.tsx | 18 ++--
.../src/components/ListView/ListView.test.jsx | 16 +--
.../src/components/MessageToasts/reducers.test.js | 6 +-
.../ModalTitleWithIcon/ModalTitleWithIcon.test.tsx | 10 +-
.../ResizableSidebar/useStoredSidebarWidth.test.ts | 6 +-
.../SQLEditorWithValidation.test.tsx | 34 +++----
.../src/dashboard/actions/dashboardLayout.test.js | 42 ++++----
.../src/dashboard/actions/dashboardState.test.js | 8 +-
.../components/AnchorLink/AnchorLink.test.tsx | 6 +-
.../src/dashboard/components/Dashboard.test.jsx | 24 ++---
.../DashboardBuilder/DashboardBuilder.test.tsx | 36 +++----
.../src/dashboard/components/MissingChart.test.tsx | 4 +-
.../src/dashboard/components/SliceAdder.test.tsx | 22 ++---
.../components/dnd/DragDroppable.test.jsx | 18 ++--
.../ChartHolder/ChartHolder.test.tsx | 22 ++---
.../gridComponents/Divider/Divider.test.jsx | 8 +-
.../gridComponents/Header/Header.test.jsx | 20 ++--
.../gridComponents/Markdown/Markdown.test.jsx | 20 ++--
.../new/DraggableNewComponent.test.jsx | 10 +-
.../FilterBar/ActionButtons/ActionButtons.test.tsx | 4 +-
.../ScopingModal/ChartsScopingListPanel.test.tsx | 8 +-
.../ScopingModal/ScopingModal.test.tsx | 10 +-
.../nativeFilters/FilterBar/FilterBar.test.tsx | 28 +++---
.../FiltersConfigForm/CollapsibleControl.test.tsx | 18 ++--
.../__tests__/TreeInitialization.test.tsx | 2 +-
.../FilterScope/__tests__/TreeSelection.test.tsx | 4 +-
.../FiltersConfigForm/FilterScope/utils.test.ts | 4 +-
.../components/nativeFilters/selectors.test.ts | 14 +--
.../components/nativeFilters/state.test.ts | 8 +-
.../components/nativeFilters/utils.test.ts | 8 +-
.../resizable/ResizableContainer.test.tsx | 2 +-
.../components/resizable/ResizableHandle.test.tsx | 6 +-
.../dashboard/reducers/dashboardFilters.test.js | 6 +-
.../src/dashboard/reducers/dashboardLayout.test.js | 22 ++---
.../src/dashboard/reducers/dashboardState.test.js | 26 ++---
.../src/dashboard/reducers/dashboardState.test.ts | 6 +-
.../src/dashboard/reducers/sliceEntities.test.js | 8 +-
.../dashboard/util/componentIsResizable.test.ts | 4 +-
.../src/dashboard/util/dnd-reorder.test.js | 18 ++--
.../src/dashboard/util/dropOverflowsParent.test.ts | 14 +--
.../src/dashboard/util/extractUrlParams.test.ts | 6 +-
.../util/findFirstParentContainer.test.js | 4 +-
.../src/dashboard/util/findParentId.test.ts | 6 +-
.../util/findTabIndexByComponentId.test.ts | 6 +-
.../getChartAndLabelComponentIdFromPath.test.js | 2 +-
.../dashboard/util/getChartIdsFromLayout.test.ts | 4 +-
.../src/dashboard/util/getDashboardUrl.test.js | 14 +--
.../util/getDetailedComponentWidth.test.js | 22 ++---
.../dashboard/util/getDirectPathToTabIndex.test.ts | 4 +-
.../src/dashboard/util/getDropPosition.test.js | 34 +++----
.../util/getEffectiveExtraFilters.test.js | 2 +-
.../util/getFilterConfigsFromFormdata.test.js | 8 +-
.../util/getFilterScopeFromNodesTree.test.js | 20 ++--
.../util/getFormDataWithExtraFilters.test.ts | 4 +-
.../util/getLeafComponentIdFromPath.test.js | 4 +-
.../src/dashboard/util/isDashboardEmpty.test.ts | 4 +-
.../src/dashboard/util/isDashboardLoading.test.ts | 8 +-
.../src/dashboard/util/isValidChild.test.ts | 4 +-
.../src/dashboard/util/newComponentFactory.test.js | 4 +-
.../src/dashboard/util/newEntitiesFromDrop.test.js | 6 +-
.../src/dashboard/util/permissionUtils.test.ts | 24 ++---
.../util/updateComponentParentsList.test.js | 8 +-
.../util/useFilterFocusHighlightStyles.test.tsx | 10 +-
superset-frontend/src/embedded/utils.test.ts | 6 +-
.../src/explore/actions/exploreActions.test.js | 8 +-
.../explore/components/EmbedCodeContent.test.jsx | 4 +-
.../ExploreChartPanel/ExploreChartPanel.test.jsx | 2 +-
.../components/controls/CheckboxControl.test.tsx | 4 +-
.../ColorBreakpointsControl.test.tsx | 2 +-
.../controls/ColorPickerControl.test.tsx | 8 +-
.../DatasourceControl/DatasourceControl.test.jsx | 10 +-
.../DateFilterControl/tests/CalendarFrame.test.tsx | 12 +--
.../controls/DateFilterControl/tests/utils.test.ts | 18 ++--
.../FilterControl/AdhocFilter/AdhocFilter.test.js | 28 +++---
.../AdhocFilterControl/AdhocFilterControl.test.tsx | 6 +-
.../AdhocFilterEditPopover.test.jsx | 16 +--
...AdhocFilterEditPopoverSimpleTabContent.test.tsx | 36 +++----
.../controls/MetricControl/AdhocMetric.test.js | 20 ++--
.../MetricControl/AggregateOption.test.tsx | 2 +-
.../MetricControl/FilterDefinitionOption.test.jsx | 6 +-
.../components/controls/SelectControl.test.jsx | 62 ++++++------
.../components/controls/TextAreaControl.test.jsx | 8 +-
.../components/controls/TimeOffsetControl.test.tsx | 4 +-
.../components/controls/ViewportControl.test.jsx | 6 +-
.../VizTypeControl/VizTypeControl.test.jsx | 4 +-
.../VizTypeControl/VizTypeControl.test.tsx | 20 ++--
.../controls/ZoomConfigControl/zoomUtil.test.ts | 20 ++--
.../controls/withAsyncVerification.test.tsx | 4 +-
.../src/explore/controlPanels/Separator.test.ts | 4 +-
.../src/explore/controlUtils/controlUtils.test.tsx | 32 +++---
.../src/explore/exploreUtils/exploreUtils.test.jsx | 38 ++++----
.../explore/exploreUtils/getChartDataUri.test.ts | 4 +-
superset-frontend/src/explore/store.test.jsx | 4 +-
.../alerts/components/NotificationMethod.test.tsx | 36 +++----
.../alerts/components/RecipientIcon.test.tsx | 10 +-
.../features/allEntities/AllEntitiesTable.test.tsx | 8 +-
.../src/features/dashboards/DashboardCard.test.tsx | 10 +-
.../DatabaseConnectionForm/EncryptedField.test.tsx | 34 +++----
.../OAuth2ClientField.test.tsx | 10 +-
.../databases/DatabaseModal/ExtraOptions.test.tsx | 16 +--
.../databases/DatabaseModal/index.test.tsx | 8 +-
.../UploadDataModel/UploadDataModal.test.tsx | 6 +-
.../AddDataset/RightPanel/RightPanel.test.tsx | 2 +-
.../datasets/DatasetLayout/DatasetLayout.test.tsx | 12 +--
.../src/features/home/DashboardTable.test.tsx | 16 +--
.../src/features/home/EmptyState.test.tsx | 4 +-
.../HeaderReportDropdown/index.test.tsx | 16 +--
.../reports/ReportModal/ReportModal.test.tsx | 6 +-
.../features/rls/RowLevelSecurityModal.test.tsx | 12 +--
.../src/features/roles/RoleListAddModal.test.tsx | 10 +-
.../features/roles/RoleListDuplicateModal.test.tsx | 10 +-
.../src/features/roles/RoleListEditModal.test.tsx | 12 +--
superset-frontend/src/features/themes/api.test.ts | 16 +--
.../src/features/themes/types.test.ts | 16 +--
.../components/Range/RangeFilterPlugin.test.tsx | 20 ++--
.../filters/components/Select/buildQuery.test.ts | 14 +--
superset-frontend/src/filters/utils.test.ts | 24 ++---
.../src/hooks/apiResources/apiResources.test.ts | 12 +--
.../src/hooks/apiResources/dashboards.test.ts | 2 +-
.../src/hooks/useDebounceValue.test.ts | 2 +-
.../src/hooks/useThemeMenuItems.test.tsx | 40 ++++----
.../useUnsavedChangesPrompt.test.tsx | 8 +-
.../src/middleware/asyncEvent.test.ts | 14 +--
superset-frontend/src/middleware/logger.test.js | 12 +--
.../pages/AlertReportList/AlertReportList.test.jsx | 20 ++--
.../AnnotationLayerList.test.jsx | 18 ++--
.../pages/ChartList/ChartList.cardview.test.tsx | 32 +++---
.../pages/ChartList/ChartList.listview.test.tsx | 42 ++++----
.../pages/ChartList/ChartList.permissions.test.tsx | 48 ++++-----
.../src/pages/ChartList/ChartList.test.tsx | 40 ++++----
.../pages/CssTemplateList/CssTemplateList.test.jsx | 16 +--
.../src/pages/DashboardList/DashboardList.test.jsx | 18 ++--
.../pages/DatasetCreation/DatasetCreation.test.tsx | 2 +-
.../ExecutionLogList/ExecutionLogList.test.tsx | 6 +-
.../src/pages/GroupsList/GroupsList.test.tsx | 16 +--
.../src/pages/RolesList/RolesList.test.tsx | 16 +--
.../RowLevelSecurityList.test.tsx | 20 ++--
.../pages/SavedQueryList/SavedQueryList.test.tsx | 16 +--
.../src/pages/ThemeList/ThemeList.test.tsx | 18 ++--
.../src/pages/ThemeList/index.test.tsx | 12 +--
.../src/pages/UserInfo/UserInfo.test.tsx | 8 +-
.../UserRegistrations/UserRegistrations.test.tsx | 2 +-
.../src/pages/UsersList/UsersList.test.tsx | 14 +--
.../src/theme/tests/ThemeController.test.ts | 92 +++++++++---------
.../src/theme/tests/ThemeProvider.test.tsx | 18 ++--
.../src/utils/DebouncedMessageQueue.test.ts | 8 +-
superset-frontend/src/utils/cacheWrapper.test.ts | 10 +-
superset-frontend/src/utils/chartRegistry.test.ts | 10 +-
superset-frontend/src/utils/common.test.jsx | 14 +--
.../src/utils/getBootstrapData.test.ts | 10 +-
.../getChartFormDiffs/getChartFormDiffs.test.ts | 16 +--
.../src/utils/getControlsForVizType.test.js | 2 +-
.../src/utils/getControlsForVizType.test.ts | 2 +-
.../src/utils/localStorageHelpers.test.ts | 4 +-
superset-frontend/src/utils/parseCookie.test.ts | 6 +-
superset-frontend/src/utils/safeStringify.test.ts | 12 +--
superset-frontend/src/utils/testUtils.test.ts | 16 +--
superset-frontend/src/utils/urlUtils.test.ts | 16 +--
superset-frontend/src/views/CRUD/hooks.test.tsx | 14 +--
superset-frontend/src/views/routes.test.tsx | 4 +-
.../src/views/theme.bootstrap.test.ts | 14 +--
194 files changed, 1388 insertions(+), 1388 deletions(-)
diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.test.js b/superset-frontend/src/SqlLab/actions/sqlLab.test.js
index aa1ddfb1cd..c0f1c18e5a 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.test.js
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.test.js
@@ -109,7 +109,7 @@ describe('async actions', () => {
return request(dispatch, () => initialState);
};
- it('posts to the correct url', () => {
+ test('posts to the correct url', () => {
expect.assertions(1);
const store = mockStore(initialState);
@@ -118,7 +118,7 @@ describe('async actions', () => {
});
});
- it('posts the correct query object', () => {
+ test('posts the correct query object', () => {
const store = mockStore(initialState);
return store.dispatch(actions.saveQuery(query, queryId)).then(() => {
const call = fetchMock.calls(saveQueryEndpoint)[0];
@@ -131,7 +131,7 @@ describe('async actions', () => {
});
});
- it('calls 3 dispatch actions', () => {
+ test('calls 3 dispatch actions', () => {
expect.assertions(1);
return makeRequest().then(() => {
@@ -139,7 +139,7 @@ describe('async actions', () => {
});
});
- it('calls QUERY_EDITOR_SAVED after making a request', () => {
+ test('calls QUERY_EDITOR_SAVED after making a request', () => {
expect.assertions(1);
return makeRequest().then(() => {
@@ -147,7 +147,7 @@ describe('async actions', () => {
});
});
- it('onSave calls QUERY_EDITOR_SAVED and QUERY_EDITOR_SET_TITLE', () => {
+ test('onSave calls QUERY_EDITOR_SAVED and QUERY_EDITOR_SET_TITLE', () => {
expect.assertions(1);
const store = mockStore(initialState);
@@ -186,7 +186,7 @@ describe('async actions', () => {
return request(dispatch, store.getState);
};
- it('makes the fetch request', () => {
+ test('makes the fetch request', () => {
expect.assertions(1);
return makeRequest().then(() => {
@@ -194,7 +194,7 @@ describe('async actions', () => {
});
});
- it('calls requestQueryResults', () => {
+ test('calls requestQueryResults', () => {
expect.assertions(1);
return makeRequest().then(() => {
@@ -202,7 +202,7 @@ describe('async actions', () => {
});
});
- it.skip('parses large number result without losing precision', () =>
+ test.skip('parses large number result without losing precision', () =>
makeRequest().then(() => {
expect(fetchMock.calls(fetchQueryEndpoint)).toHaveLength(1);
expect(dispatch.callCount).toBe(2);
@@ -211,7 +211,7 @@ describe('async actions', () => {
);
}));
- it('calls querySuccess on fetch success', () => {
+ test('calls querySuccess on fetch success', () => {
expect.assertions(1);
const store = mockStore({});
@@ -226,7 +226,7 @@ describe('async actions', () => {
});
});
- it('calls queryFailed on fetch error', () => {
+ test('calls queryFailed on fetch error', () => {
expect.assertions(1);
fetchMock.get(
@@ -254,7 +254,7 @@ describe('async actions', () => {
return request(dispatch, () => initialState);
};
- it('makes the fetch request', () => {
+ test('makes the fetch request', () => {
expect.assertions(1);
return makeRequest().then(() => {
@@ -262,7 +262,7 @@ describe('async actions', () => {
});
});
- it('calls startQuery', () => {
+ test('calls startQuery', () => {
expect.assertions(1);
return makeRequest().then(() => {
@@ -270,7 +270,7 @@ describe('async actions', () => {
});
});
- it.skip('parses large number result without losing precision', () =>
+ test.skip('parses large number result without losing precision', () =>
makeRequest().then(() => {
expect(fetchMock.calls(runQueryEndpoint)).toHaveLength(1);
expect(dispatch.callCount).toBe(2);
@@ -279,7 +279,7 @@ describe('async actions', () => {
);
}));
- it('calls querySuccess on fetch success', () => {
+ test('calls querySuccess on fetch success', () => {
expect.assertions(1);
const store = mockStore({});
@@ -293,7 +293,7 @@ describe('async actions', () => {
});
});
- it('calls queryFailed on fetch error and logs the error details', () => {
+ test('calls queryFailed on fetch error and logs the error details', () => {
expect.assertions(2);
fetchMock.post(
@@ -342,7 +342,7 @@ describe('async actions', () => {
return request(dispatch, () => initialState);
};
- it('makes the fetch request', async () => {
+ test('makes the fetch request', async () => {
const runQueryEndpointWithParams =
'glob:*/api/v1/sqllab/execute/?foo=bar';
fetchMock.post(
@@ -356,7 +356,7 @@ describe('async actions', () => {
});
describe('reRunQuery', () => {
- it('creates new query with a new id', () => {
+ test('creates new query with a new id', () => {
const id = 'id';
const state = {
sqlLab: {
@@ -385,7 +385,7 @@ describe('async actions', () => {
return request(dispatch);
};
- it('makes the fetch request', () => {
+ test('makes the fetch request', () => {
expect.assertions(1);
return makeRequest().then(() => {
@@ -393,7 +393,7 @@ describe('async actions', () => {
});
});
- it('calls stopQuery', () => {
+ test('calls stopQuery', () => {
expect.assertions(1);
return makeRequest().then(() => {
@@ -401,7 +401,7 @@ describe('async actions', () => {
});
});
- it('sends the correct data', () => {
+ test('sends the correct data', () => {
expect.assertions(1);
return makeRequest().then(() => {
@@ -413,7 +413,7 @@ describe('async actions', () => {
});
describe('cloneQueryToNewTab', () => {
- it('creates new query editor', () => {
+ test('creates new query editor', () => {
expect.assertions(1);
const id = 'id';
@@ -508,7 +508,7 @@ describe('async actions', () => {
supersetClientGetSpy.mockRestore();
});
- it('calls API endpint with correct params', async () => {
+ test('calls API endpint with correct params', async () => {
supersetClientGetSpy.mockResolvedValue({
json: { result: mockSavedQueryApiResponse },
});
@@ -520,7 +520,7 @@ describe('async actions', () => {
});
});
- it('dispatches addQueryEditor with correct params on successful API call', async () => {
+ test('dispatches addQueryEditor with correct params on successful API call', async () => {
supersetClientGetSpy.mockResolvedValue({
json: { result: mockSavedQueryApiResponse },
});
@@ -547,7 +547,7 @@ describe('async actions', () => {
);
});
- it('should dispatch addDangerToast on API error', async () => {
+ test('should dispatch addDangerToast on API error', async () => {
supersetClientGetSpy.mockResolvedValue(new Error());
await makeRequest(1);
@@ -562,7 +562,7 @@ describe('async actions', () => {
});
describe('addQueryEditor', () => {
- it('creates new query editor', () => {
+ test('creates new query editor', () => {
expect.assertions(1);
const store = mockStore(initialState);
@@ -583,7 +583,7 @@ describe('async actions', () => {
});
describe('addNewQueryEditor', () => {
- it('creates new query editor with new tab name', () => {
+ test('creates new query editor with new tab name', () => {
const store = mockStore({
...initialState,
sqlLab: {
@@ -621,7 +621,7 @@ describe('async actions', () => {
});
});
- it('set current query editor', () => {
+ test('set current query editor', () => {
expect.assertions(1);
const store = mockStore(initialState);
@@ -637,7 +637,7 @@ describe('async actions', () => {
});
describe('swithQueryEditor', () => {
- it('switch to the next tab editor', () => {
+ test('switch to the next tab editor', () => {
const store = mockStore(initialState);
const expectedActions = [
{
@@ -650,7 +650,7 @@ describe('async actions', () => {
expect(store.getActions()).toEqual(expectedActions);
});
- it('switch to the first tab editor once it reaches the rightmost tab', () => {
+ test('switch to the first tab editor once it reaches the rightmost tab', () => {
const store = mockStore({
...initialState,
sqlLab: {
@@ -673,7 +673,7 @@ describe('async actions', () => {
expect(store.getActions()).toEqual(expectedActions);
});
- it('switch to the previous tab editor', () => {
+ test('switch to the previous tab editor', () => {
const store = mockStore({
...initialState,
sqlLab: {
@@ -692,7 +692,7 @@ describe('async actions', () => {
expect(store.getActions()).toEqual(expectedActions);
});
- it('switch to the last tab editor once it reaches the leftmost tab', () => {
+ test('switch to the last tab editor once it reaches the leftmost tab', () => {
const store = mockStore({
...initialState,
sqlLab: {
@@ -746,7 +746,7 @@ describe('async actions', () => {
afterEach(() => fetchMock.resetHistory());
describe('addQueryEditor', () => {
- it('creates the tab state in the local storage', () => {
+ test('creates the tab state in the local storage', () => {
expect.assertions(2);
const store = mockStore({});
@@ -770,7 +770,7 @@ describe('async actions', () => {
});
describe('removeQueryEditor', () => {
- it('updates the tab state in the backend', () => {
+ test('updates the tab state in the backend', () => {
expect.assertions(1);
const store = mockStore({});
@@ -786,7 +786,7 @@ describe('async actions', () => {
});
describe('queryEditorSetDb', () => {
- it('updates the tab state in the backend', () => {
+ test('updates the tab state in the backend', () => {
expect.assertions(1);
const dbId = 42;
@@ -804,7 +804,7 @@ describe('async actions', () => {
});
describe('queryEditorSetCatalog', () => {
- it('updates the tab state in the backend', () => {
+ test('updates the tab state in the backend', () => {
expect.assertions(1);
const catalog = 'public';
@@ -822,7 +822,7 @@ describe('async actions', () => {
});
describe('queryEditorSetSchema', () => {
- it('updates the tab state in the backend', () => {
+ test('updates the tab state in the backend', () => {
expect.assertions(1);
const schema = 'schema';
@@ -840,7 +840,7 @@ describe('async actions', () => {
});
describe('queryEditorSetAutorun', () => {
- it('updates the tab state in the backend', () => {
+ test('updates the tab state in the backend', () => {
expect.assertions(1);
const autorun = true;
@@ -858,7 +858,7 @@ describe('async actions', () => {
});
describe('queryEditorSetTitle', () => {
- it('updates the tab state in the backend', () => {
+ test('updates the tab state in the backend', () => {
expect.assertions(1);
const name = 'name';
@@ -887,7 +887,7 @@ describe('async actions', () => {
},
];
describe('with backend persistence flag on', () => {
- it('updates the tab state in the backend', () => {
+ test('updates the tab state in the backend', () => {
expect.assertions(2);
const store = mockStore({
@@ -905,7 +905,7 @@ describe('async actions', () => {
});
});
describe('with backend persistence flag off', () => {
- it('does not update the tab state in the backend', () => {
+ test('does not update the tab state in the backend', () => {
isFeatureEnabled.mockImplementation(
feature => !(feature === 'SQLLAB_BACKEND_PERSISTENCE'),
);
@@ -928,7 +928,7 @@ describe('async actions', () => {
});
describe('queryEditorSetQueryLimit', () => {
- it('updates the tab state in the backend', () => {
+ test('updates the tab state in the backend', () => {
expect.assertions(1);
const queryLimit = 10;
@@ -948,7 +948,7 @@ describe('async actions', () => {
});
describe('queryEditorSetTemplateParams', () => {
- it('updates the tab state in the backend', () => {
+ test('updates the tab state in the backend', () => {
expect.assertions(1);
const templateParams = '{"foo": "bar"}';
@@ -969,7 +969,7 @@ describe('async actions', () => {
});
describe('addTable', () => {
- it('dispatches table state from unsaved change', () => {
+ test('dispatches table state from unsaved change', () => {
const tableName = 'table';
const catalogName = null;
const schemaName = 'schema';
@@ -1003,7 +1003,7 @@ describe('async actions', () => {
);
});
- it('uses tabViewId when available', () => {
+ test('uses tabViewId when available', () => {
const tableName = 'table';
const catalogName = null;
const schemaName = 'schema';
@@ -1043,7 +1043,7 @@ describe('async actions', () => {
);
});
- it('falls back to id when tabViewId is not available', () => {
+ test('falls back to id when tabViewId is not available', () => {
const tableName = 'table';
const catalogName = null;
const schemaName = 'schema';
@@ -1084,7 +1084,7 @@ describe('async actions', () => {
});
describe('syncTable', () => {
- it('updates the table schema state in the backend', () => {
+ test('updates the table schema state in the backend', () => {
expect.assertions(4);
const tableName = 'table';
@@ -1137,7 +1137,7 @@ describe('async actions', () => {
fetchMock.resetHistory();
});
- it('updates and runs data preview query when configured', () => {
+ test('updates and runs data preview query when configured', () => {
expect.assertions(3);
const expectedActionTypes = [
@@ -1161,7 +1161,7 @@ describe('async actions', () => {
});
});
- it('runs data preview query only', () => {
+ test('runs data preview query only', () => {
const expectedActionTypes = [
actions.START_QUERY, // runQuery (data preview)
actions.QUERY_SUCCESS, // querySuccess
@@ -1187,7 +1187,7 @@ describe('async actions', () => {
});
describe('expandTable', () => {
- it('updates the table schema state in the backend', () => {
+ test('updates the table schema state in the backend', () => {
expect.assertions(2);
const table = { id: 1 };
@@ -1206,7 +1206,7 @@ describe('async actions', () => {
});
describe('collapseTable', () => {
- it('updates the table schema state in the backend', () => {
+ test('updates the table schema state in the backend', () => {
expect.assertions(2);
const table = { id: 1 };
@@ -1225,7 +1225,7 @@ describe('async actions', () => {
});
describe('removeTables', () => {
- it('updates the table schema state in the backend', () => {
+ test('updates the table schema state in the backend', () => {
expect.assertions(2);
const table = { id: 1, initialized: true };
@@ -1242,7 +1242,7 @@ describe('async actions', () => {
});
});
- it('deletes multiple tables and updates the table schema state in the backend', () => {
+ test('deletes multiple tables and updates the table schema state in the backend', () => {
expect.assertions(2);
const tables = [
@@ -1262,7 +1262,7 @@ describe('async actions', () => {
});
});
- it('only updates the initialized table schema state in the backend', () => {
+ test('only updates the initialized table schema state in the backend', () => {
expect.assertions(2);
const tables = [{ id: 1 }, { id: 2, initialized: true }];
@@ -1281,7 +1281,7 @@ describe('async actions', () => {
});
describe('syncQueryEditor', () => {
- it('updates the tab state in the backend', () => {
+ test('updates the tab state in the backend', () => {
expect.assertions(3);
const results = {
diff --git a/superset-frontend/src/SqlLab/components/AceEditorWrapper/AceEditorWrapper.test.tsx b/superset-frontend/src/SqlLab/components/AceEditorWrapper/AceEditorWrapper.test.tsx
index a46f60c5d4..9279ed4316 100644
--- a/superset-frontend/src/SqlLab/components/AceEditorWrapper/AceEditorWrapper.test.tsx
+++ b/superset-frontend/src/SqlLab/components/AceEditorWrapper/AceEditorWrapper.test.tsx
@@ -73,7 +73,7 @@ describe('AceEditorWrapper', () => {
(FullSQLEditor as any as jest.Mock).mockClear();
});
- it('renders ace editor including sql value', async () => {
+ test('renders ace editor including sql value', async () => {
const store = createStore(initialState, reducerIndex);
const { getByTestId } = setup(defaultQueryEditor, store);
await waitFor(() => expect(getByTestId('react-ace')).toBeInTheDocument());
@@ -83,7 +83,7 @@ describe('AceEditorWrapper', () => {
);
});
- it('renders current sql for unrelated unsaved changes', () => {
+ test('renders current sql for unrelated unsaved changes', () => {
const expectedSql = 'SELECT updated_column\nFROM updated_table\nWHERE';
const store = createStore(
{
@@ -108,7 +108,7 @@ describe('AceEditorWrapper', () => {
);
});
- it('skips rerendering for updating cursor position', () => {
+ test('skips rerendering for updating cursor position', () => {
const store = createStore(initialState, reducerIndex);
setup(defaultQueryEditor, store);
diff --git a/superset-frontend/src/SqlLab/components/App/App.test.tsx b/superset-frontend/src/SqlLab/components/App/App.test.tsx
index eab125ba24..6ec020337b 100644
--- a/superset-frontend/src/SqlLab/components/App/App.test.tsx
+++ b/superset-frontend/src/SqlLab/components/App/App.test.tsx
@@ -60,23 +60,23 @@ describe('SqlLab App', () => {
jest.useRealTimers();
});
- it('is valid', () => {
+ test('is valid', () => {
expect(isValidElement(<App />)).toBe(true);
});
- it('should render', () => {
+ test('should render', () => {
const { getByTestId } = render(<App />, { useRedux: true, store });
expect(getByTestId('SqlLabApp')).toBeInTheDocument();
expect(getByTestId('mock-tabbed-sql-editors')).toBeInTheDocument();
});
- it('reset hotkey events on unmount', () => {
+ test('reset hotkey events on unmount', () => {
const { unmount } = render(<App />, { useRedux: true, store });
unmount();
expect(Mousetrap.reset).toHaveBeenCalled();
});
- it('logs current usage warning', () => {
+ test('logs current usage warning', () => {
const localStorageUsageInKilobytes = LOCALSTORAGE_MAX_USAGE_KB + 10;
const initialState = {
localStorageUsageInKilobytes,
@@ -100,7 +100,7 @@ describe('SqlLab App', () => {
);
});
- it('logs current local storage usage', async () => {
+ test('logs current local storage usage', async () => {
const localStorageUsageInKilobytes = LOCALSTORAGE_MAX_USAGE_KB - 10;
const storeExceedLocalStorage = mockStore(
sqlLabReducer(
diff --git a/superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx b/superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx
index 437be27504..f6870e942d 100644
--- a/superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx
+++ b/superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx
@@ -26,17 +26,17 @@ describe('ColumnElement', () => {
actions: mockedActions,
column: table.columns[0],
};
- it('is valid with props', () => {
+ test('is valid with props', () => {
expect(isValidElement(<ColumnElement {...mockedProps} />)).toBe(true);
});
- it('renders a proper primary key', () => {
+ test('renders a proper primary key', () => {
const { container } = render(<ColumnElement column={table.columns[0]} />);
expect(container.querySelector('i.fa-key')).toBeInTheDocument();
expect(
container.querySelector('[data-test="col-name"]')?.firstChild,
).toHaveTextContent('id');
});
- it('renders a multi-key column', () => {
+ test('renders a multi-key column', () => {
const { container } = render(<ColumnElement column={table.columns[1]} />);
expect(container.querySelector('i.fa-link')).toBeInTheDocument();
expect(container.querySelector('i.fa-bookmark')).toBeInTheDocument();
@@ -44,7 +44,7 @@ describe('ColumnElement', () => {
container.querySelector('[data-test="col-name"]')?.firstChild,
).toHaveTextContent('first_name');
});
- it('renders a column with no keys', () => {
+ test('renders a column with no keys', () => {
const { container } = render(<ColumnElement column={table.columns[2]} />);
expect(container.querySelector('i')).not.toBeInTheDocument();
expect(
diff --git a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/EstimateQueryCostButton.test.tsx b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/EstimateQueryCostButton.test.tsx
index a989d02f70..e7b5db3236 100644
--- a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/EstimateQueryCostButton.test.tsx
+++ b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/EstimateQueryCostButton.test.tsx
@@ -54,13 +54,13 @@ const setup = (props: Partial<EstimateQueryCostButtonProps>, store?: Store) =>
);
describe('EstimateQueryCostButton', () => {
- it('renders EstimateQueryCostButton', async () => {
+ test('renders EstimateQueryCostButton', async () => {
const { queryByText } = setup({}, mockStore(initialState));
expect(queryByText('Estimate cost')).toBeInTheDocument();
});
- it('renders label for selected query', async () => {
+ test('renders label for selected query', async () => {
const { queryByText } = setup(
{ queryEditorId: extraQueryEditor1.id },
mockStore(initialState),
@@ -69,7 +69,7 @@ describe('EstimateQueryCostButton', () => {
expect(queryByText('Estimate selected query cost')).toBeInTheDocument();
});
- it('renders label for selected query from unsaved', async () => {
+ test('renders label for selected query from unsaved', async () => {
const { queryByText } = setup(
{},
mockStore({
@@ -87,7 +87,7 @@ describe('EstimateQueryCostButton', () => {
expect(queryByText('Estimate selected query cost')).toBeInTheDocument();
});
- it('renders estimation error result', async () => {
+ test('renders estimation error result', async () => {
const { queryByText, getByText } = setup(
{},
mockStore({
@@ -109,7 +109,7 @@ describe('EstimateQueryCostButton', () => {
expect(queryByText('Estimate error')).toBeInTheDocument();
});
- it('renders estimation success result', async () => {
+ test('renders estimation success result', async () => {
const { queryByText, getByText } = setup(
{},
mockStore({
diff --git a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx
index e619f6a5f9..686b288ad5 100644
--- a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx
+++ b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx
@@ -51,13 +51,13 @@ describe('ExploreCtasResultsButton', () => {
const postFormSpy = jest.spyOn(SupersetClientClass.prototype, 'postForm');
postFormSpy.mockImplementation(jest.fn());
- it('renders', async () => {
+ test('renders', async () => {
const { queryByText } = setup({}, mockStore(initialState));
expect(queryByText('Explore')).toBeInTheDocument();
});
- it('visualize results', async () => {
+ test('visualize results', async () => {
const { getByText } = setup({}, mockStore(initialState));
postFormSpy.mockClear();
@@ -75,7 +75,7 @@ describe('ExploreCtasResultsButton', () => {
});
});
- it('visualize results fails', async () => {
+ test('visualize results fails', async () => {
const { getByText } = setup({}, mockStore(initialState));
postFormSpy.mockClear();
diff --git a/superset-frontend/src/SqlLab/components/ExploreResultsButton/ExploreResultsButton.test.tsx b/superset-frontend/src/SqlLab/components/ExploreResultsButton/ExploreResultsButton.test.tsx
index a19adb2bf5..2211c0552c 100644
--- a/superset-frontend/src/SqlLab/components/ExploreResultsButton/ExploreResultsButton.test.tsx
+++ b/superset-frontend/src/SqlLab/components/ExploreResultsButton/ExploreResultsButton.test.tsx
@@ -32,7 +32,7 @@ const setup = (
});
describe('ExploreResultsButton', () => {
- it('renders', async () => {
+ test('renders', async () => {
const { queryByText } = setup(jest.fn(), {
database: { allows_subquery: true },
});
@@ -41,7 +41,7 @@ describe('ExploreResultsButton', () => {
expect(screen.getByRole('button', { name: /Create chart/i })).toBeEnabled();
});
- it('renders disabled if subquery not allowed', async () => {
+ test('renders disabled if subquery not allowed', async () => {
const { queryByText } = setup(jest.fn());
expect(queryByText('Create chart')).toBeInTheDocument();
// Updated line to match the actual button name that includes the icon
diff --git a/superset-frontend/src/SqlLab/components/QueryAutoRefresh/QueryAutoRefresh.test.tsx b/superset-frontend/src/SqlLab/components/QueryAutoRefresh/QueryAutoRefresh.test.tsx
index 2e26087296..911bbb45f8 100644
--- a/superset-frontend/src/SqlLab/components/QueryAutoRefresh/QueryAutoRefresh.test.tsx
+++ b/superset-frontend/src/SqlLab/components/QueryAutoRefresh/QueryAutoRefresh.test.tsx
@@ -62,15 +62,15 @@ describe('QueryAutoRefresh', () => {
jest.useRealTimers();
});
- it('isQueryRunning returns true for valid running query', () => {
+ test('isQueryRunning returns true for valid running query', () => {
expect(isQueryRunning(runningQuery)).toBe(true);
});
- it('isQueryRunning returns false for valid not-running query', () => {
+ test('isQueryRunning returns false for valid not-running query', () => {
expect(isQueryRunning(successfulQuery)).toBe(false);
});
- it('isQueryRunning returns false for invalid query', () => {
+ test('isQueryRunning returns false for invalid query', () => {
// @ts-ignore
expect(isQueryRunning(null)).toBe(false);
// @ts-ignore
@@ -81,15 +81,15 @@ describe('QueryAutoRefresh', () => {
expect(isQueryRunning({ state: { badFormat: true } })).toBe(false);
});
- it('shouldCheckForQueries is true for valid running query', () => {
+ test('shouldCheckForQueries is true for valid running query', () => {
expect(shouldCheckForQueries(runningQueries)).toBe(true);
});
- it('shouldCheckForQueries is false for valid completed query', () => {
+ test('shouldCheckForQueries is false for valid completed query', () => {
expect(shouldCheckForQueries(successfulQueries)).toBe(false);
});
- it('shouldCheckForQueries is false for invalid inputs', () => {
+ test('shouldCheckForQueries is false for invalid inputs', () => {
// @ts-ignore
expect(shouldCheckForQueries(null)).toBe(false);
// @ts-ignore
@@ -109,7 +109,7 @@ describe('QueryAutoRefresh', () => {
).toBe(false);
});
- it('Attempts to refresh when given pending query', async () => {
+ test('Attempts to refresh when given pending query', async () => {
const store = mockStore({ sqlLab: { ...mockState } });
fetchMock.get(refreshApi, {
@@ -135,7 +135,7 @@ describe('QueryAutoRefresh', () => {
);
});
- it('Attempts to clear inactive queries when updated queries are empty', async () => {
+ test('Attempts to clear inactive queries when updated queries are empty', async () => {
const store = mockStore({ sqlLab: { ...mockState } });
fetchMock.get(refreshApi, { result: [] });
@@ -164,7 +164,7 @@ describe('QueryAutoRefresh', () => {
expect(fetchMock.calls(refreshApi)).toHaveLength(1);
});
- it('Does not fail and attempts to refresh with mixed valid/invalid queries', async () => {
+ test('Does not fail and attempts to refresh with mixed valid/invalid queries', async () => {
const store = mockStore({ sqlLab: { ...mockState } });
fetchMock.get(refreshApi, {
@@ -191,7 +191,7 @@ describe('QueryAutoRefresh', () => {
);
});
- it('Does NOT Attempt to refresh when given only completed queries', async () => {
+ test('Does NOT Attempt to refresh when given only completed queries', async () => {
const store = mockStore({ sqlLab: { ...mockState } });
fetchMock.get(refreshApi, {
@@ -219,7 +219,7 @@ describe('QueryAutoRefresh', () => {
expect(fetchMock.calls(refreshApi)).toHaveLength(0);
});
- it('logs the failed error for async queries', async () => {
+ test('logs the failed error for async queries', async () => {
const store = mockStore({ sqlLab: { ...mockState } });
fetchMock.get(refreshApi, {
diff --git a/superset-frontend/src/SqlLab/components/QueryLimitSelect/QueryLimitSelect.test.tsx b/superset-frontend/src/SqlLab/components/QueryLimitSelect/QueryLimitSelect.test.tsx
index bbaa76720b..c92ba9c24a 100644
--- a/superset-frontend/src/SqlLab/components/QueryLimitSelect/QueryLimitSelect.test.tsx
+++ b/superset-frontend/src/SqlLab/components/QueryLimitSelect/QueryLimitSelect.test.tsx
@@ -59,7 +59,7 @@ const setup = (props?: Partial<QueryLimitSelectProps>, store?: Store) =>
);
describe('QueryLimitSelect', () => {
- it('renders current query limit size', () => {
+ test('renders current query limit size', () => {
const queryLimit = 10;
const { getByText } = setup(
{
@@ -81,12 +81,12 @@ describe('QueryLimitSelect', () => {
expect(getByText(queryLimit)).toBeInTheDocument();
});
- it('renders default query limit for initial queryEditor', () => {
+ test('renders default query limit for initial queryEditor', () => {
const { getByText } = setup({}, mockStore(initialState));
expect(getByText(defaultQueryLimit)).toBeInTheDocument();
});
- it('renders queryLimit from unsavedQueryEditor', () => {
+ test('renders queryLimit from unsavedQueryEditor', () => {
const queryLimit = 10000;
const { getByText } = setup(
{},
@@ -104,7 +104,7 @@ describe('QueryLimitSelect', () => {
expect(getByText(convertToNumWithSpaces(queryLimit))).toBeInTheDocument();
});
- it('renders dropdown select', async () => {
+ test('renders dropdown select', async () => {
const { baseElement, getAllByRole, getByRole } = setup(
{ maxRow: 50000 },
mockStore(initialState),
@@ -126,7 +126,7 @@ describe('QueryLimitSelect', () => {
expect(actualLabels).toEqual(expectedLabels);
});
- it('renders dropdown select correctly when maxRow is less than 10', async () => {
+ test('renders dropdown select correctly when maxRow is less than 10', async () => {
const { baseElement, getAllByRole, getByRole } = setup(
{ maxRow: 5 },
mockStore(initialState),
@@ -146,7 +146,7 @@ describe('QueryLimitSelect', () => {
expect(actualLabels).toEqual(expectedLabels);
});
- it('renders dropdown select correctly when maxRow is a multiple of 10', async () => {
+ test('renders dropdown select correctly when maxRow is a multiple of 10', async () => {
const { baseElement, getAllByRole, getByRole } = setup(
{ maxRow: 10000 },
mockStore(initialState),
@@ -168,7 +168,7 @@ describe('QueryLimitSelect', () => {
expect(actualLabels).toEqual(expectedLabels);
});
- it('dispatches QUERY_EDITOR_SET_QUERY_LIMIT action on dropdown menu click', async () => {
+ test('dispatches QUERY_EDITOR_SET_QUERY_LIMIT action on dropdown menu click', async () => {
const store = mockStore(initialState);
const expectedIndex = 1;
const { baseElement, getAllByRole, getByRole } = setup({}, store);
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/SaveDatasetModal/SaveDatasetModal.test.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetModal/SaveDatasetModal.test.tsx
index 50cf1560f9..99724c46cc 100644
--- a/superset-frontend/src/SqlLab/components/SaveDatasetModal/SaveDatasetModal.test.tsx
+++ b/superset-frontend/src/SqlLab/components/SaveDatasetModal/SaveDatasetModal.test.tsx
@@ -63,7 +63,7 @@ jest.mock('src/explore/exploreUtils/formData', () => ({
}));
describe('SaveDatasetModal', () => {
- it('renders a "Save as new" field', () => {
+ test('renders a "Save as new" field', () => {
render(<SaveDatasetModal {...mockedProps} />, { useRedux: true });
const saveRadioBtn = screen.getByRole('radio', {
@@ -80,7 +80,7 @@ describe('SaveDatasetModal', () => {
expect(inputFieldText).toBeInTheDocument();
});
- it('renders an "Overwrite existing" field', () => {
+ test('renders an "Overwrite existing" field', () => {
render(<SaveDatasetModal {...mockedProps} />, { useRedux: true });
const overwriteRadioBtn = screen.getByRole('radio', {
@@ -96,20 +96,20 @@ describe('SaveDatasetModal', () => {
expect(placeholderText).toBeInTheDocument();
});
- it('renders a close button', () => {
+ test('renders a close button', () => {
render(<SaveDatasetModal {...mockedProps} />, { useRedux: true });
expect(screen.getByRole('button', { name: /close/i })).toBeInTheDocument();
});
- it('renders a save button when "Save as new" is selected', () => {
+ test('renders a save button when "Save as new" is selected', () => {
render(<SaveDatasetModal {...mockedProps} />, { useRedux: true });
// "Save as new" is selected when the modal opens by default
expect(screen.getByRole('button', { name: /save/i })).toBeInTheDocument();
});
- it('renders an overwrite button when "Overwrite existing" is selected', () => {
+ test('renders an overwrite button when "Overwrite existing" is selected', () => {
render(<SaveDatasetModal {...mockedProps} />, { useRedux: true });
// Click the overwrite radio button to reveal the overwrite confirmation and back buttons
@@ -123,7 +123,7 @@ describe('SaveDatasetModal', () => {
).toBeInTheDocument();
});
- it('renders the overwrite button as disabled until an existing dataset is selected', async () => {
+ test('renders the overwrite button as disabled until an existing dataset is selected', async () => {
useSelectorMock.mockReturnValue({ ...user });
render(<SaveDatasetModal {...mockedProps} />, { useRedux: true });
@@ -155,7 +155,7 @@ describe('SaveDatasetModal', () => {
expect(overwriteConfirmationBtn).toBeEnabled();
});
- it('renders a confirm overwrite screen when overwrite is clicked', async () => {
+ test('renders a confirm overwrite screen when overwrite is clicked', async () => {
useSelectorMock.mockReturnValue({ ...user });
render(<SaveDatasetModal {...mockedProps} />, { useRedux: true });
@@ -196,7 +196,7 @@ describe('SaveDatasetModal', () => {
).toBeInTheDocument();
});
- it('sends the schema when creating the dataset', async () => {
+ test('sends the schema when creating the dataset', async () => {
const dummyDispatch = jest.fn().mockResolvedValue({});
useDispatchMock.mockReturnValue(dummyDispatch);
useSelectorMock.mockReturnValue({ ...user });
@@ -221,7 +221,7 @@ describe('SaveDatasetModal', () => {
});
});
- it('sends the catalog when creating the dataset', async () => {
+ test('sends the catalog when creating the dataset', async () => {
const dummyDispatch = jest.fn().mockResolvedValue({});
useDispatchMock.mockReturnValue(dummyDispatch);
useSelectorMock.mockReturnValue({ ...user });
@@ -252,12 +252,12 @@ describe('SaveDatasetModal', () => {
});
});
- it('does not renders a checkbox button when template processing is disabled', () => {
+ test('does not renders a checkbox button when template processing is disabled', () => {
render(<SaveDatasetModal {...mockedProps} />, { useRedux: true });
expect(screen.queryByRole('checkbox')).not.toBeInTheDocument();
});
- it('renders a checkbox button when template processing is enabled', () => {
+ test('renders a checkbox button when template processing is enabled', () => {
// @ts-ignore
global.featureFlags = {
[FeatureFlag.EnableTemplateProcessing]: true,
@@ -266,7 +266,7 @@ describe('SaveDatasetModal', () => {
expect(screen.getByRole('checkbox')).toBeInTheDocument();
});
- it('correctly includes template parameters when template processing is enabled', () => {
+ test('correctly includes template parameters when template processing is enabled', () => {
// @ts-ignore
global.featureFlags = {
[FeatureFlag.EnableTemplateProcessing]: true,
@@ -301,7 +301,7 @@ describe('SaveDatasetModal', () => {
});
});
- it('correctly excludes template parameters when template processing is enabled', () => {
+ test('correctly excludes template parameters when template processing is enabled', () => {
// @ts-ignore
global.featureFlags = {
[FeatureFlag.EnableTemplateProcessing]: true,
diff --git a/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx b/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx
index cf4cdcca43..292b8af725 100644
--- a/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx
+++ b/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx
@@ -65,7 +65,7 @@ const middlewares = [thunk];
const mockStore = configureStore(middlewares);
describe('SavedQuery', () => {
- it('doesnt render save button when allows_virtual_table_explore is undefined', async () => {
+ test('doesnt render save button when allows_virtual_table_explore is undefined', async () => {
const noRenderProps = {
...mockedProps,
database: {
@@ -84,7 +84,7 @@ describe('SavedQuery', () => {
);
});
- it('renders a non-split save button when allows_virtual_table_explore is not enabled', () => {
+ test('renders a non-split save button when allows_virtual_table_explore is not enabled', () => {
render(<SaveQuery {...mockedProps} />, {
useRedux: true,
store: mockStore(mockState),
@@ -95,7 +95,7 @@ describe('SavedQuery', () => {
expect(saveBtn).toBeVisible();
});
- it('renders a save query modal when user clicks save button', () => {
+ test('renders a save query modal when user clicks save button', () => {
render(<SaveQuery {...mockedProps} />, {
useRedux: true,
store: mockStore(mockState),
@@ -111,7 +111,7 @@ describe('SavedQuery', () => {
expect(saveQueryModalHeader).toBeInTheDocument();
});
- it('renders the save query modal UI', () => {
+ test('renders the save query modal UI', () => {
render(<SaveQuery {...mockedProps} />, {
useRedux: true,
store: mockStore(mockState),
@@ -146,7 +146,7 @@ describe('SavedQuery', () => {
expect(cancelBtn).toBeInTheDocument();
});
- it('renders a "save as new" and "update" button if query already exists', () => {
+ test('renders a "save as new" and "update" button if query already exists', () => {
render(<SaveQuery {...mockedProps} />, {
useRedux: true,
store: mockStore({
@@ -171,7 +171,7 @@ describe('SavedQuery', () => {
expect(updateBtn).toBeInTheDocument();
});
- it('renders a split save button when allows_virtual_table_explore is enabled', async () => {
+ test('renders a split save button when allows_virtual_table_explore is enabled', async () => {
render(<SaveQuery {...splitSaveBtnProps} />, {
useRedux: true,
store: mockStore(mockState),
@@ -186,7 +186,7 @@ describe('SavedQuery', () => {
});
});
- it('renders a save dataset modal when user clicks "save dataset" menu item', async () => {
+ test('renders a save dataset modal when user clicks "save dataset" menu item', async () => {
render(<SaveQuery {...splitSaveBtnProps} />, {
useRedux: true,
store: mockStore(mockState),
@@ -205,7 +205,7 @@ describe('SavedQuery', () => {
expect(saveDatasetHeader).toBeInTheDocument();
});
- it('renders the save dataset modal UI', async () => {
+ test('renders the save dataset modal UI', async () => {
render(<SaveQuery {...splitSaveBtnProps} />, {
useRedux: true,
store: mockStore(mockState),
@@ -246,7 +246,7 @@ describe('SavedQuery', () => {
expect(overwritePlaceholderText).toBeInTheDocument();
});
- it('modal stays open while save is in progress and closes after completion', async () => {
+ test('modal stays open while save is in progress and closes after completion', async () => {
let resolveSave: () => void;
const savePromise = new Promise<void>(resolve => {
resolveSave = resolve;
@@ -290,7 +290,7 @@ describe('SavedQuery', () => {
expect(mockOnSave).toHaveBeenCalledTimes(1);
});
- it('handles save with a new tab that has no changes', async () => {
+ test('handles save with a new tab that has no changes', async () => {
const mockOnSave = jest.fn().mockResolvedValue(undefined);
// Mock state for a new tab with default SQL
diff --git a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx
index 7326073b77..fa1ed3ca0d 100644
--- a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx
+++ b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx
@@ -103,7 +103,7 @@ describe('ShareSqlLabQuery', () => {
mockedIsFeatureEnabled.mockReset();
});
- it('calls storeQuery() with the query when getCopyUrl() is called', async () => {
+ test('calls storeQuery() with the query when getCopyUrl() is called', async () => {
await act(async () => {
render(<ShareSqlLabQuery {...defaultProps} />, {
useRedux: true,
@@ -121,7 +121,7 @@ describe('ShareSqlLabQuery', () => {
).toEqual(expected);
});
- it('calls storeQuery() with unsaved changes', async () => {
+ test('calls storeQuery() with unsaved changes', async () => {
await act(async () => {
render(<ShareSqlLabQuery {...defaultProps} />, {
useRedux: true,
diff --git a/superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx b/superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx
index 1ace7435ef..1ce74c4415 100644
--- a/superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx
+++ b/superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx
@@ -192,7 +192,7 @@ describe('SqlEditor', () => {
});
});
- it('does not render SqlEditor if no db selected', async () => {
+ test('does not render SqlEditor if no db selected', async () => {
const queryEditor = initialState.sqlLab.queryEditors[2];
const { findByText } = setup({ ...mockedProps, queryEditor }, store);
expect(
@@ -200,7 +200,7 @@ describe('SqlEditor', () => {
).toBeInTheDocument();
});
- it('renders db unavailable message', async () => {
+ test('renders db unavailable message', async () => {
const queryEditor = initialState.sqlLab.queryEditors[1];
const { findByText } = setup({ ...mockedProps, queryEditor }, store);
expect(
@@ -210,7 +210,7 @@ describe('SqlEditor', () => {
).toBeInTheDocument();
});
- it('render a SqlEditorLeftBar', async () => {
+ test('render a SqlEditorLeftBar', async () => {
const { getByTestId, unmount } = setup(mockedProps, store);
await waitFor(
@@ -222,7 +222,7 @@ describe('SqlEditor', () => {
}, 15000);
// Update other similar tests with timeouts
- it('render an AceEditorWrapper', async () => {
+ test('render an AceEditorWrapper', async () => {
const { findByTestId, unmount } = setup(mockedProps, store);
await waitFor(
@@ -233,7 +233,7 @@ describe('SqlEditor', () => {
unmount();
}, 15000);
- it('skip rendering an AceEditorWrapper when the current tab is inactive', async () => {
+ test('skip rendering an AceEditorWrapper when the current tab is inactive', async () => {
const { findByTestId, queryByTestId } = setup(
{
...mockedProps,
@@ -245,7 +245,7 @@ describe('SqlEditor', () => {
expect(queryByTestId('react-ace')).not.toBeInTheDocument();
});
- it('avoids rerendering EditorLeftBar and ResultSet while typing', async () => {
+ test('avoids rerendering EditorLeftBar and ResultSet while typing', async () => {
const { findByTestId } = setup(mockedProps, store);
const editor = await findByTestId('react-ace');
const sql = 'select *';
@@ -260,7 +260,7 @@ describe('SqlEditor', () => {
expect(ResultSet).toHaveBeenCalledTimes(renderCountForSouthPane);
});
- it('renders sql from unsaved change', async () => {
+ test('renders sql from unsaved change', async () => {
const expectedSql = 'SELECT updated_column\nFROM updated_table\nWHERE';
store = createStore({
...initialState,
@@ -293,12 +293,12 @@ describe('SqlEditor', () => {
expect(editor).toHaveValue(expectedSql);
});
- it('render a SouthPane', async () => {
+ test('render a SouthPane', async () => {
const { findByTestId } = setup(mockedProps, store);
expect(await findByTestId('mock-result-set')).toBeInTheDocument();
});
- it('runs query action with ctas false', async () => {
+ test('runs query action with ctas false', async () => {
store = createStore({
...initialState,
sqlLab: {
@@ -338,7 +338,7 @@ describe('SqlEditor', () => {
);
});
- it('render a Limit Dropdown', async () => {
+ test('render a Limit Dropdown', async () => {
const defaultQueryLimit = 101;
const updatedProps = { ...mockedProps, defaultQueryLimit };
const { findByText } = setup(updatedProps, store);
@@ -346,7 +346,7 @@ describe('SqlEditor', () => {
expect(await findByText('10 000')).toBeInTheDocument();
});
- it('renders an Extension if provided', async () => {
+ test('renders an Extension if provided', async () => {
const extensionsRegistry = getExtensionsRegistry();
extensionsRegistry.set('sqleditor.extension.form', () => (
@@ -370,7 +370,7 @@ describe('SqlEditor', () => {
mockIsFeatureEnabled.mockClear();
});
- it('sends the catalog and schema to the endpoint', async () => {
+ test('sends the catalog and schema to the endpoint', async () => {
const estimateApi = 'http://localhost/api/v1/sqllab/estimate/';
fetchMock.post(estimateApi, {});
@@ -446,7 +446,7 @@ describe('SqlEditor', () => {
mockIsFeatureEnabled.mockClear();
});
- it('should render loading state when its Editor is not loaded', async () => {
+ test('should render loading state when its Editor is not loaded', async () => {
const switchTabApi = `glob:*/tabstateview/${defaultQueryEditor.id}/activate`;
fetchMock.post(switchTabApi, {});
const { getByTestId } = setup(
diff --git a/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx b/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx
index ae79d42ecb..a9d145732d 100644
--- a/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx
+++ b/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx
@@ -57,14 +57,14 @@ const setup = (queryEditor: QueryEditor, store?: Store) =>
});
describe('SqlEditorTabHeader', () => {
- it('renders name', () => {
+ test('renders name', () => {
const { queryByText } = setup(defaultQueryEditor, mockStore(initialState));
expect(queryByText(defaultQueryEditor.name)).toBeInTheDocument();
expect(queryByText(extraQueryEditor1.name)).not.toBeInTheDocument();
expect(queryByText(extraQueryEditor2.name)).not.toBeInTheDocument();
});
- it('renders name from unsaved changes', () => {
+ test('renders name from unsaved changes', () => {
const expectedTitle = 'updated title';
const { queryByText } = setup(
defaultQueryEditor,
@@ -85,7 +85,7 @@ describe('SqlEditorTabHeader', () => {
expect(queryByText(extraQueryEditor2.name)).not.toBeInTheDocument();
});
- it('renders current name for unrelated unsaved changes', () => {
+ test('renders current name for unrelated unsaved changes', () => {
const unrelatedTitle = 'updated title';
const { queryByText } = setup(
defaultQueryEditor,
@@ -116,7 +116,7 @@ describe('SqlEditorTabHeader', () => {
userEvent.click(dropdown);
});
- it('should dispatch removeQueryEditor action', async () => {
+ test('should dispatch removeQueryEditor action', async () => {
await waitFor(() =>
expect(screen.getByTestId('close-tab-menu-option')).toBeInTheDocument(),
);
@@ -132,7 +132,7 @@ describe('SqlEditorTabHeader', () => {
);
});
- it('should dispatch queryEditorSetTitle action', async () => {
+ test('should dispatch queryEditorSetTitle action', async () => {
await waitFor(() =>
expect(screen.getByTestId('close-tab-menu-option')).toBeInTheDocument(),
);
@@ -155,7 +155,7 @@ describe('SqlEditorTabHeader', () => {
mockPrompt.mockClear();
});
- it('should dispatch toggleLeftBar action', async () => {
+ test('should dispatch toggleLeftBar action', async () => {
await waitFor(() =>
expect(screen.getByTestId('close-tab-menu-option')).toBeInTheDocument(),
);
@@ -173,7 +173,7 @@ describe('SqlEditorTabHeader', () => {
);
});
- it('should dispatch removeAllOtherQueryEditors action', async () => {
+ test('should dispatch removeAllOtherQueryEditors action', async () => {
await waitFor(() =>
expect(screen.getByTestId('close-tab-menu-option')).toBeInTheDocument(),
);
@@ -194,7 +194,7 @@ describe('SqlEditorTabHeader', () => {
);
});
- it('should dispatch cloneQueryToNewTab action', async () => {
+ test('should dispatch cloneQueryToNewTab action', async () => {
await waitFor(() =>
expect(screen.getByTestId('close-tab-menu-option')).toBeInTheDocument(),
);
diff --git a/superset-frontend/src/SqlLab/components/TemplateParamsEditor/TemplateParamsEditor.test.tsx b/superset-frontend/src/SqlLab/components/TemplateParamsEditor/TemplateParamsEditor.test.tsx
index acada8b861..807dc489ab 100644
--- a/superset-frontend/src/SqlLab/components/TemplateParamsEditor/TemplateParamsEditor.test.tsx
+++ b/superset-frontend/src/SqlLab/components/TemplateParamsEditor/TemplateParamsEditor.test.tsx
@@ -65,12 +65,12 @@ const setup = (
);
describe('TemplateParamsEditor', () => {
- it('should render with a title', () => {
+ test('should render with a title', () => {
const { container } = setup();
expect(container.querySelector('div[role="button"]')).toBeInTheDocument();
});
- it('should open a modal with the ace editor', async () => {
+ test('should open a modal with the ace editor', async () => {
const { container, getByTestId } = setup();
fireEvent.click(getByText(container, 'Parameters'));
await waitFor(() => {
@@ -78,7 +78,7 @@ describe('TemplateParamsEditor', () => {
});
});
- it('renders templateParams', async () => {
+ test('renders templateParams', async () => {
const { container, getByTestId } = setup();
fireEvent.click(getByText(container, 'Parameters'));
await waitFor(() => {
@@ -89,7 +89,7 @@ describe('TemplateParamsEditor', () => {
);
});
- it('renders code from unsaved changes', async () => {
+ test('renders code from unsaved changes', async () => {
const expectedCode = 'custom code value';
const { container, getByTestId } = setup(
{},
diff --git a/superset-frontend/src/SqlLab/reducers/getInitialState.test.ts b/superset-frontend/src/SqlLab/reducers/getInitialState.test.ts
index 01c05730c5..4511e1b318 100644
--- a/superset-frontend/src/SqlLab/reducers/getInitialState.test.ts
+++ b/superset-frontend/src/SqlLab/reducers/getInitialState.test.ts
@@ -57,10 +57,10 @@ describe('getInitialState', () => {
localStorage.clear();
});
- it('should output the user that is passed in', () => {
+ test('should output the user that is passed in', () => {
expect(getInitialState(apiData).user?.userId).toEqual(1);
});
- it('should return undefined instead of null for templateParams', () => {
+ test('should return undefined instead of null for templateParams', () => {
expect(
getInitialState(apiDataWithTabState).sqlLab?.queryEditors?.[0]
?.templateParams,
@@ -68,7 +68,7 @@ describe('getInitialState', () => {
});
describe('dedupeTabHistory', () => {
- it('should dedupe the tab history', () => {
+ test('should dedupe the tab history', () => {
[
{ value: [], expected: [] },
{
@@ -137,7 +137,7 @@ describe('getInitialState', () => {
});
describe('dedupe tables schema', () => {
- it('should dedupe the table schema', () => {
+ test('should dedupe the table schema', () => {
localStorage.setItem(
'redux',
JSON.stringify({
@@ -195,7 +195,7 @@ describe('getInitialState', () => {
expect(initializedTables.map(({ id }) => id)).toEqual([1, 2, 6]);
});
- it('should parse the float dttm value', () => {
+ test('should parse the float dttm value', () => {
const startDttmInStr = '1693433503447.166992';
const endDttmInStr = '1693433503500.23132';
@@ -284,7 +284,7 @@ describe('getInitialState', () => {
);
});
- it('restore unsaved changes for PERSISTENCE mode', () => {
+ test('restore unsaved changes for PERSISTENCE mode', () => {
const apiDataWithLocalStorage = {
...apiData,
active_tab: {
@@ -321,7 +321,7 @@ describe('getInitialState', () => {
).toEqual(apiDataWithTabState.active_tab.id.toString());
});
- it('skip unsaved changes for expired data', () => {
+ test('skip unsaved changes for expired data', () => {
const apiDataWithLocalStorage = {
...apiData,
active_tab: {
@@ -345,7 +345,7 @@ describe('getInitialState', () => {
);
});
- it('skip unsaved changes for legacy cache data', () => {
+ test('skip unsaved changes for legacy cache data', () => {
const apiDataWithLocalStorage = {
...apiData,
active_tab: {
diff --git a/superset-frontend/src/SqlLab/reducers/sqlLab.test.js b/superset-frontend/src/SqlLab/reducers/sqlLab.test.js
index af8e3115d5..89b12eac83 100644
--- a/superset-frontend/src/SqlLab/reducers/sqlLab.test.js
+++ b/superset-frontend/src/SqlLab/reducers/sqlLab.test.js
@@ -38,12 +38,12 @@ describe('sqlLabReducer', () => {
newState = sqlLabReducer(newState, action);
qe = newState.queryEditors.find(e => e.id === 'abcd');
});
- it('should add a query editor', () => {
+ test('should add a query editor', () => {
expect(newState.queryEditors).toHaveLength(
initialState.queryEditors.length + 1,
);
});
- it('should merge the current unsaved changes when adding a query editor', () => {
+ test('should merge the current unsaved changes when adding a query editor', () => {
const expectedTitle = 'new updated title';
const updateAction = {
type: actions.QUERY_EDITOR_SET_TITLE,
@@ -62,7 +62,7 @@ describe('sqlLabReducer', () => {
newState.queryEditors[newState.queryEditors.length - 1].id,
).toEqual('efgh');
});
- it('should remove a query editor', () => {
+ test('should remove a query editor', () => {
expect(newState.queryEditors).toHaveLength(
initialState.queryEditors.length + 1,
);
@@ -75,7 +75,7 @@ describe('sqlLabReducer', () => {
initialState.queryEditors.length,
);
});
- it('should select the latest query editor when tabHistory is empty', () => {
+ test('should select the latest query editor when tabHistory is empty', () => {
const currentQE = newState.queryEditors[0];
newState = {
...initialState,
@@ -94,7 +94,7 @@ describe('sqlLabReducer', () => {
);
expect(newState.tabHistory).toEqual([initialState.queryEditors[2].id]);
});
- it('should remove a query editor including unsaved changes', () => {
+ test('should remove a query editor including unsaved changes', () => {
expect(newState.queryEditors).toHaveLength(
initialState.queryEditors.length + 1,
);
@@ -116,7 +116,7 @@ describe('sqlLabReducer', () => {
expect(newState.unsavedQueryEditor.dbId).toBeUndefined();
expect(newState.unsavedQueryEditor.id).toBeUndefined();
});
- it('should set q query editor active', () => {
+ test('should set q query editor active', () => {
const expectedTitle = 'new updated title';
const addQueryEditorAction = {
type: actions.ADD_QUERY_EDITOR,
@@ -139,7 +139,7 @@ describe('sqlLabReducer', () => {
);
expect(newState.queryEditors[1].name).toEqual(expectedTitle);
});
- it('should not fail while setting DB', () => {
+ test('should not fail while setting DB', () => {
const dbId = 9;
const action = {
type: actions.QUERY_EDITOR_SETDB,
@@ -150,7 +150,7 @@ describe('sqlLabReducer', () => {
expect(newState.unsavedQueryEditor.dbId).toBe(dbId);
expect(newState.unsavedQueryEditor.id).toBe(qe.id);
});
- it('should not fail while setting schema', () => {
+ test('should not fail while setting schema', () => {
const schema = 'foo';
const action = {
type: actions.QUERY_EDITOR_SET_SCHEMA,
@@ -161,7 +161,7 @@ describe('sqlLabReducer', () => {
expect(newState.unsavedQueryEditor.schema).toBe(schema);
expect(newState.unsavedQueryEditor.id).toBe(qe.id);
});
- it('should not fail while setting autorun', () => {
+ test('should not fail while setting autorun', () => {
const action = {
type: actions.QUERY_EDITOR_SET_AUTORUN,
queryEditor: qe,
@@ -173,7 +173,7 @@ describe('sqlLabReducer', () => {
expect(newState.unsavedQueryEditor.autorun).toBe(true);
expect(newState.unsavedQueryEditor.id).toBe(qe.id);
});
- it('should not fail while setting title', () => {
+ test('should not fail while setting title', () => {
const title = 'Untitled Query 1';
const action = {
type: actions.QUERY_EDITOR_SET_TITLE,
@@ -184,7 +184,7 @@ describe('sqlLabReducer', () => {
expect(newState.unsavedQueryEditor.name).toBe(title);
expect(newState.unsavedQueryEditor.id).toBe(qe.id);
});
- it('should not fail while setting Sql', () => {
+ test('should not fail while setting Sql', () => {
const sql = 'SELECT nothing from dev_null';
const action = {
type: actions.QUERY_EDITOR_SET_SQL,
@@ -195,7 +195,7 @@ describe('sqlLabReducer', () => {
expect(newState.unsavedQueryEditor.sql).toBe(sql);
expect(newState.unsavedQueryEditor.id).toBe(qe.id);
});
- it('should not fail while setting queryLimit', () => {
+ test('should not fail while setting queryLimit', () => {
const queryLimit = 101;
const action = {
type: actions.QUERY_EDITOR_SET_QUERY_LIMIT,
@@ -206,7 +206,7 @@ describe('sqlLabReducer', () => {
expect(newState.unsavedQueryEditor.queryLimit).toBe(queryLimit);
expect(newState.unsavedQueryEditor.id).toBe(qe.id);
});
- it('should set selectedText', () => {
+ test('should set selectedText', () => {
const selectedText = 'TEST';
const action = {
type: actions.QUERY_EDITOR_SET_SELECTED_TEXT,
@@ -218,7 +218,7 @@ describe('sqlLabReducer', () => {
expect(newState.unsavedQueryEditor.selectedText).toBe(selectedText);
expect(newState.unsavedQueryEditor.id).toBe(qe.id);
});
- it('should not wiped out unsaved changes while delayed async call intercepted', () => {
+ test('should not wiped out unsaved changes while delayed async call intercepted', () => {
const expectedSql = 'Updated SQL WORKING IN PROGRESS--';
const action = {
type: actions.QUERY_EDITOR_SET_SQL,
@@ -239,7 +239,7 @@ describe('sqlLabReducer', () => {
interceptedAction.northPercent,
);
});
- it('should migrate query editor by new query editor id', () => {
+ test('should migrate query editor by new query editor id', () => {
const { length } = newState.queryEditors;
const index = newState.queryEditors.findIndex(({ id }) => id === qe.id);
const newQueryEditor = {
@@ -267,7 +267,7 @@ describe('sqlLabReducer', () => {
newQueryEditor.tabViewId,
);
});
- it('should clear the destroyed query editors', () => {
+ test('should clear the destroyed query editors', () => {
const expectedQEId = '1233289';
const action = {
type: actions.CLEAR_DESTROYED_QUERY_EDITOR,
@@ -297,12 +297,12 @@ describe('sqlLabReducer', () => {
newState = sqlLabReducer(initialState, action);
newTable = newState.tables[0];
});
- it('should add a table', () => {
+ test('should add a table', () => {
// Testing that beforeEach actually added the table
expect(newState.tables).toHaveLength(1);
expect(newState.tables[0].expanded).toBe(true);
});
- it('should merge the table attributes', () => {
+ test('should merge the table attributes', () => {
// Merging the extra attribute
newTable.extra = true;
const action = {
@@ -313,7 +313,7 @@ describe('sqlLabReducer', () => {
expect(newState.tables).toHaveLength(1);
expect(newState.tables[0].extra).toBe(true);
});
- it('should overwrite table ID be ignored when the existing table is already initialized', () => {
+ test('should overwrite table ID be ignored when the existing table is already initialized', () => {
const action = {
type: actions.MERGE_TABLE,
table: newTable,
@@ -345,7 +345,7 @@ describe('sqlLabReducer', () => {
expect(newState.tables).toHaveLength(1);
expect(newState.tables[0].id).toBe(remoteId);
});
- it('should expand and collapse a table', () => {
+ test('should expand and collapse a table', () => {
const collapseTableAction = {
type: actions.COLLAPSE_TABLE,
table: newTable,
@@ -359,7 +359,7 @@ describe('sqlLabReducer', () => {
newState = sqlLabReducer(newState, expandTableAction);
expect(newState.tables[0].expanded).toBe(true);
});
- it('should remove a table', () => {
+ test('should remove a table', () => {
const action = {
type: actions.REMOVE_TABLES,
tables: [newTable],
@@ -385,7 +385,7 @@ describe('sqlLabReducer', () => {
sqlEditorId: 'dfsadfs',
};
});
- it('should start a query', () => {
+ test('should start a query', () => {
const action = {
type: actions.START_QUERY,
query: {
@@ -401,7 +401,7 @@ describe('sqlLabReducer', () => {
newState = sqlLabReducer(newState, action);
expect(Object.keys(newState.queries)).toHaveLength(1);
});
- it('should stop the query', () => {
+ test('should stop the query', () => {
const startQueryAction = {
type: actions.START_QUERY,
query,
@@ -415,7 +415,7 @@ describe('sqlLabReducer', () => {
const q = newState.queries[Object.keys(newState.queries)[0]];
expect(q.state).toBe('stopped');
});
- it('should remove a query', () => {
+ test('should remove a query', () => {
const startQueryAction = {
type: actions.START_QUERY,
query,
@@ -428,7 +428,7 @@ describe('sqlLabReducer', () => {
newState = sqlLabReducer(newState, removeQueryAction);
expect(Object.keys(newState.queries)).toHaveLength(0);
});
- it('should refresh queries when polling returns new results', () => {
+ test('should refresh queries when polling returns new results', () => {
const startDttmInStr = '1693433503447.166992';
const endDttmInStr = '1693433503500.23132';
newState = sqlLabReducer(
@@ -449,7 +449,7 @@ describe('sqlLabReducer', () => {
expect(newState.queries.abcd.endDttm).toBe(Number(endDttmInStr));
expect(newState.queriesLastUpdate).toBe(CHANGED_ON_TIMESTAMP);
});
- it('should skip refreshing queries when polling contains existing results', () => {
+ test('should skip refreshing queries when polling contains existing results', () => {
const completedQuery = {
...query,
extra: {
@@ -478,7 +478,7 @@ describe('sqlLabReducer', () => {
expect(newState.queries.abcd).toBe(query);
expect(newState.queries.def).toBe(completedQuery);
});
- it('should refresh queries when polling returns empty', () => {
+ test('should refresh queries when polling returns empty', () => {
newState = sqlLabReducer(newState, actions.refreshQueries({}));
});
});
@@ -496,7 +496,7 @@ describe('sqlLabReducer', () => {
cached: false,
};
});
- it('updates queries that have already been completed', () => {
+ test('updates queries that have already been completed', () => {
newState = sqlLabReducer(
{
...newState,
diff --git a/superset-frontend/src/SqlLab/utils/emptyQueryResults.test.ts b/superset-frontend/src/SqlLab/utils/emptyQueryResults.test.ts
index fe60edfe1e..f6adb9d1d3 100644
--- a/superset-frontend/src/SqlLab/utils/emptyQueryResults.test.ts
+++ b/superset-frontend/src/SqlLab/utils/emptyQueryResults.test.ts
@@ -37,7 +37,7 @@ describe('reduxStateToLocalStorageHelper', () => {
});
});
- it('should empty query.results if query.startDttm is > LOCALSTORAGE_MAX_QUERY_AGE_MS', () => {
+ test('should empty query.results if query.startDttm is > LOCALSTORAGE_MAX_QUERY_AGE_MS', () => {
// make sure sample data contains old query
const oldQuery = queries[0];
const { id, startDttm } = oldQuery;
@@ -51,7 +51,7 @@ describe('reduxStateToLocalStorageHelper', () => {
expect(emptiedQuery[id].results).toEqual({});
});
- it('should empty query.results if query,.results size is greater than LOCALSTORAGE_MAX_QUERY_RESULTS_KB', () => {
+ test('should empty query.results if query,.results size is greater than LOCALSTORAGE_MAX_QUERY_RESULTS_KB', () => {
const reasonableSizeQuery = {
...queries[0],
startDttm: Date.now(),
@@ -83,7 +83,7 @@ describe('reduxStateToLocalStorageHelper', () => {
);
});
- it('should only return selected keys for query editor', () => {
+ test('should only return selected keys for query editor', () => {
const queryEditors = [{ ...defaultQueryEditor, dummy: 'value' }];
expect(Object.keys(queryEditors[0])).toContain('dummy');
diff --git a/superset-frontend/src/SqlLab/utils/newQueryTabName.test.ts b/superset-frontend/src/SqlLab/utils/newQueryTabName.test.ts
index 33eec73781..a3f8b225bf 100644
--- a/superset-frontend/src/SqlLab/utils/newQueryTabName.test.ts
+++ b/superset-frontend/src/SqlLab/utils/newQueryTabName.test.ts
@@ -30,12 +30,12 @@ const emptyEditor = {
};
describe('newQueryTabName', () => {
- it("should return default title if queryEditor's length is 0", () => {
+ test("should return default title if queryEditor's length is 0", () => {
const defaultTitle = 'default title';
const title = newQueryTabName([], defaultTitle);
expect(title).toEqual(defaultTitle);
});
- it('should return next available number if there are unsaved editors', () => {
+ test('should return next available number if there are unsaved editors', () => {
const untitledQueryText = 'Untitled Query';
const unsavedEditors = [
{ ...emptyEditor, name: `${untitledQueryText} 1` },
diff --git a/superset-frontend/src/components/AlteredSliceTag/utils/utils.test.ts b/superset-frontend/src/components/AlteredSliceTag/utils/utils.test.ts
index 861686e7c4..6bbffaebbc 100644
--- a/superset-frontend/src/components/AlteredSliceTag/utils/utils.test.ts
+++ b/superset-frontend/src/components/AlteredSliceTag/utils/utils.test.ts
@@ -21,32 +21,32 @@ import { alterForComparison, formatValueHandler, getRowsFromDiffs } from '.';
import { RowType } from '../types';
describe('alterForComparison', () => {
- it('returns null for undefined value', () => {
+ test('returns null for undefined value', () => {
expect(alterForComparison(undefined)).toBeNull();
});
- it('returns null for null value', () => {
+ test('returns null for null value', () => {
expect(alterForComparison(null)).toBeNull();
});
- it('returns null for empty string value', () => {
+ test('returns null for empty string value', () => {
expect(alterForComparison('')).toBeNull();
});
- it('returns null for empty array value', () => {
+ test('returns null for empty array value', () => {
expect(alterForComparison([])).toBeNull();
});
- it('returns null for empty object value', () => {
+ test('returns null for empty object value', () => {
expect(alterForComparison({})).toBeNull();
});
- it('returns value for non-empty array', () => {
+ test('returns value for non-empty array', () => {
const value = [1, 2, 3];
expect(alterForComparison(value)).toEqual(value);
});
- it('returns value for non-empty object', () => {
+ test('returns value for non-empty object', () => {
const value = { key: 'value' };
expect(alterForComparison(value)).toEqual(value);
});
@@ -61,7 +61,7 @@ describe('formatValueHandler', () => {
other_control: { type: 'OtherControl', label: 'Other' },
};
- it('handles undefined value', () => {
+ test('handles undefined value', () => {
const value = undefined;
const key = 'b';
@@ -74,7 +74,7 @@ describe('formatValueHandler', () => {
expect(formattedValue).toBe('N/A');
});
- it('handles null value', () => {
+ test('handles null value', () => {
const value = null;
const key = 'b';
@@ -87,7 +87,7 @@ describe('formatValueHandler', () => {
expect(formattedValue).toBe('null');
});
- it('returns "[]" for empty filters', () => {
+ test('returns "[]" for empty filters', () => {
const value: unknown[] = [];
const key = 'adhoc_filters';
@@ -100,7 +100,7 @@ describe('formatValueHandler', () => {
expect(formattedValue).toBe('[]');
});
- it('formats filters with array values', () => {
+ test('formats filters with array values', () => {
const filters = [
{
clause: 'WHERE',
@@ -129,7 +129,7 @@ describe('formatValueHandler', () => {
expect(formattedValue).toBe(expected);
});
- it('formats filters with string values', () => {
+ test('formats filters with string values', () => {
const filters = [
{
clause: 'WHERE',
@@ -158,7 +158,7 @@ describe('formatValueHandler', () => {
expect(formattedValue).toBe(expected);
});
- it('formats "Min" and "Max" for BoundsControl', () => {
+ test('formats "Min" and "Max" for BoundsControl', () => {
const value: number[] = [1, 2];
const key = 'b';
@@ -167,7 +167,7 @@ describe('formatValueHandler', () => {
expect(result).toEqual('Min: 1, Max: 2');
});
- it('formats stringified objects for CollectionControl', () => {
+ test('formats stringified objects for CollectionControl', () => {
const value = [{ a: 1 }, { b: 2 }];
const key = 'column_collection';
@@ -178,7 +178,7 @@ describe('formatValueHandler', () => {
);
});
- it('formats MetricsControl values correctly', () => {
+ test('formats MetricsControl values correctly', () => {
const value = [{ label: 'SUM(Sales)' }, { label: 'Metric2' }];
const key = 'metrics';
@@ -187,7 +187,7 @@ describe('formatValueHandler', () => {
expect(result).toEqual('SUM(Sales), Metric2');
});
- it('formats boolean values as string', () => {
+ test('formats boolean values as string', () => {
const value1 = true;
const value2 = false;
const key = 'b';
@@ -207,7 +207,7 @@ describe('formatValueHandler', () => {
expect(formattedValue2).toBe('false');
});
- it('formats array values correctly', () => {
+ test('formats array values correctly', () => {
const value = [
{ label: 'Label1' },
{ label: 'Label2' },
@@ -229,7 +229,7 @@ describe('formatValueHandler', () => {
expect(result).toEqual(expected);
});
- it('formats string values correctly', () => {
+ test('formats string values correctly', () => {
const value = 'test';
const key = 'other_control';
@@ -238,7 +238,7 @@ describe('formatValueHandler', () => {
expect(result).toEqual('test');
});
- it('formats number values correctly', () => {
+ test('formats number values correctly', () => {
const value = 123;
const key = 'other_control';
@@ -247,7 +247,7 @@ describe('formatValueHandler', () => {
expect(result).toEqual(123);
});
- it('formats object values correctly', () => {
+ test('formats object values correctly', () => {
const value = { 1: 2, alpha: 'bravo' };
const key = 'other_control';
const expected = '{"1":2,"alpha":"bravo"}';
@@ -259,7 +259,7 @@ describe('formatValueHandler', () => {
});
describe('getRowsFromDiffs', () => {
- it('returns formatted rows for diffs', () => {
+ test('returns formatted rows for diffs', () => {
const diffs = {
metric: { before: [{ label: 'old' }], after: [{ label: 'new' }] },
limit: { before: 10, after: 20 },
@@ -278,7 +278,7 @@ describe('getRowsFromDiffs', () => {
]);
});
- it('falls back to key if label is missing', () => {
+ test('falls back to key if label is missing', () => {
const diffs = {
unknown: { before: 'a', after: 'b' },
};
diff --git a/superset-frontend/src/components/Chart/ChartErrorMessage.test.tsx b/superset-frontend/src/components/Chart/ChartErrorMessage.test.tsx
index 4f41444f3f..9b0b96c4e8 100644
--- a/superset-frontend/src/components/Chart/ChartErrorMessage.test.tsx
+++ b/superset-frontend/src/components/Chart/ChartErrorMessage.test.tsx
@@ -49,7 +49,7 @@ describe('ChartErrorMessage', () => {
source: 'test_source' as ChartSource,
};
- it('renders the default error message when error is null', () => {
+ test('renders the default error message when error is null', () => {
mockUseChartOwnerNames.mockReturnValue({
result: null,
status: ResourceStatus.Loading,
@@ -61,7 +61,7 @@ describe('ChartErrorMessage', () => {
expect(screen.getByText('Test subtitle')).toBeInTheDocument();
});
- it('renders the error message that is passed in from the error', () => {
+ test('renders the error message that is passed in from the error', () => {
getErrorMessageComponentRegistry().registerValue(
'VALID_KEY',
ERROR_MESSAGE_COMPONENT,
diff --git a/superset-frontend/src/components/Chart/chartActions.test.js b/superset-frontend/src/components/Chart/chartActions.test.js
index c606859497..e7b33946d8 100644
--- a/superset-frontend/src/components/Chart/chartActions.test.js
+++ b/superset-frontend/src/components/Chart/chartActions.test.js
@@ -126,7 +126,7 @@ describe('chart actions', () => {
fakeMetadata = { viz_type: 'my_viz', useLegacyApi: false };
});
- it('should query with the built query', async () => {
+ test('should query with the built query', async () => {
const actionThunk = actions.postChartFormData({}, null);
await actionThunk(dispatch, mockGetState);
@@ -141,7 +141,7 @@ describe('chart actions', () => {
expect(dispatch.args[0][0].type).toBe(actions.CHART_UPDATE_STARTED);
});
- it('should handle the bigint without regression', async () => {
+ test('should handle the bigint without regression', async () => {
getChartDataUriStub.restore();
const mockBigIntUrl = '/mock/chart/data/bigint';
const expectedBigNumber = '9223372036854775807';
@@ -160,7 +160,7 @@ describe('chart actions', () => {
expect(json.value.toString()).toEqual(expectedBigNumber);
});
- it('handleChartDataResponse should return result if GlobalAsyncQueries flag is disabled', async () => {
+ test('handleChartDataResponse should return result if GlobalAsyncQueries flag is disabled', async () => {
const result = await handleChartDataResponse(
{ status: 200 },
{ result: [1, 2, 3] },
@@ -168,7 +168,7 @@ describe('chart actions', () => {
expect(result).toEqual([1, 2, 3]);
});
- it('handleChartDataResponse should handle responses when GlobalAsyncQueries flag is enabled and results are returned synchronously', async () => {
+ test('handleChartDataResponse should handle responses when GlobalAsyncQueries flag is enabled and results are returned synchronously', async () => {
global.featureFlags = {
[FeatureFlag.GlobalAsyncQueries]: true,
};
@@ -179,7 +179,7 @@ describe('chart actions', () => {
expect(result).toEqual([1, 2, 3]);
});
- it('handleChartDataResponse should handle responses when GlobalAsyncQueries flag is enabled and query is running asynchronously', async () => {
+ test('handleChartDataResponse should handle responses when GlobalAsyncQueries flag is enabled and query is running asynchronously', async () => {
global.featureFlags = {
[FeatureFlag.GlobalAsyncQueries]: true,
};
@@ -196,7 +196,7 @@ describe('chart actions', () => {
fakeMetadata = { useLegacyApi: true };
});
- it('should dispatch CHART_UPDATE_STARTED action before the query', () => {
+ test('should dispatch CHART_UPDATE_STARTED action before the query', () => {
const actionThunk = actions.postChartFormData({});
return actionThunk(dispatch, mockGetState).then(() => {
@@ -207,7 +207,7 @@ describe('chart actions', () => {
});
});
- it('should dispatch TRIGGER_QUERY action with the query', () => {
+ test('should dispatch TRIGGER_QUERY action with the query', () => {
const actionThunk = actions.postChartFormData({});
return actionThunk(dispatch, mockGetState).then(() => {
// chart update, trigger query, update form data, success
@@ -217,7 +217,7 @@ describe('chart actions', () => {
});
});
- it('should dispatch UPDATE_QUERY_FORM_DATA action with the query', () => {
+ test('should dispatch UPDATE_QUERY_FORM_DATA action with the query', () => {
const actionThunk = actions.postChartFormData({});
return actionThunk(dispatch, mockGetState).then(() => {
// chart update, trigger query, update form data, success
@@ -227,7 +227,7 @@ describe('chart actions', () => {
});
});
- it('should dispatch logEvent async action', () => {
+ test('should dispatch logEvent async action', () => {
const actionThunk = actions.postChartFormData({});
return actionThunk(dispatch, mockGetState).then(() => {
// chart update, trigger query, update form data, success
@@ -241,7 +241,7 @@ describe('chart actions', () => {
});
});
- it('should dispatch CHART_UPDATE_SUCCEEDED action upon success', () => {
+ test('should dispatch CHART_UPDATE_SUCCEEDED action upon success', () => {
const actionThunk = actions.postChartFormData({});
return actionThunk(dispatch, mockGetState).then(() => {
// chart update, trigger query, update form data, success
@@ -251,7 +251,7 @@ describe('chart actions', () => {
});
});
- it('should dispatch CHART_UPDATE_FAILED action upon query timeout', () => {
+ test('should dispatch CHART_UPDATE_FAILED action upon query timeout', () => {
const unresolvingPromise = new Promise(() => {});
fetchMock.post(MOCK_URL, () => unresolvingPromise, {
overwriteRoutes: true,
@@ -269,7 +269,7 @@ describe('chart actions', () => {
});
});
- it('should dispatch CHART_UPDATE_FAILED action upon non-timeout non-abort failure', () => {
+ test('should dispatch CHART_UPDATE_FAILED action upon non-timeout non-abort failure', () => {
fetchMock.post(
MOCK_URL,
{ throws: { statusText: 'misc error' } },
@@ -290,7 +290,7 @@ describe('chart actions', () => {
});
});
- it('should handle the bigint without regression', async () => {
+ test('should handle the bigint without regression', async () => {
getExploreUrlStub.restore();
const mockBigIntUrl = '/mock/chart/data/bigint';
const expectedBigNumber = '9223372036854775807';
@@ -316,7 +316,7 @@ describe('chart actions', () => {
jest.clearAllMocks();
});
- it('should dispatch annotationQueryStarted and annotationQuerySuccess on successful query', async () => {
+ test('should dispatch annotationQueryStarted and annotationQuerySuccess on successful query', async () => {
const annotation = {
name: 'Holidays',
annotationType: 'EVENT',
@@ -371,7 +371,7 @@ describe('chart actions timeout', () => {
jest.clearAllMocks();
});
- it('should use the timeout from arguments when given', async () => {
+ test('should use the timeout from arguments when given', async () => {
const postSpy = jest.spyOn(SupersetClient, 'post');
postSpy.mockImplementation(() => Promise.resolve({ json: { result: [] } }));
const timeout = 10; // Set the timeout value here
@@ -403,7 +403,7 @@ describe('chart actions timeout', () => {
expect(postSpy).toHaveBeenCalledWith(expectedPayload);
});
- it('should use the timeout from common.conf when not passed as an argument', async () => {
+ test('should use the timeout from common.conf when not passed as an argument', async () => {
const postSpy = jest.spyOn(SupersetClient, 'post');
postSpy.mockImplementation(() => Promise.resolve({ json: { result: [] } }));
const formData = { datasource: 'table__1' }; // Set the formData here
diff --git a/superset-frontend/src/components/Chart/chartReducers.test.js b/superset-frontend/src/components/Chart/chartReducers.test.js
index 16c1650218..082a822c74 100644
--- a/superset-frontend/src/components/Chart/chartReducers.test.js
+++ b/superset-frontend/src/components/Chart/chartReducers.test.js
@@ -31,13 +31,13 @@ describe('chart reducers', () => {
charts = { [chartKey]: testChart };
});
- it('should update endtime on fail', () => {
+ test('should update endtime on fail', () => {
const newState = chartReducer(charts, actions.chartUpdateStopped(chartKey));
expect(newState[chartKey].chartUpdateEndTime).toBeGreaterThan(0);
expect(newState[chartKey].chartStatus).toEqual('stopped');
});
- it('should update endtime on timeout', () => {
+ test('should update endtime on timeout', () => {
const newState = chartReducer(
charts,
actions.chartUpdateFailed(
diff --git a/superset-frontend/src/components/Datasource/DatasourceModal/DatasourceModal.test.jsx b/superset-frontend/src/components/Datasource/DatasourceModal/DatasourceModal.test.jsx
index d4045a3de6..7572e105e5 100644
--- a/superset-frontend/src/components/Datasource/DatasourceModal/DatasourceModal.test.jsx
+++ b/superset-frontend/src/components/Datasource/DatasourceModal/DatasourceModal.test.jsx
@@ -74,23 +74,23 @@ beforeEach(() => {
});
describe('DatasourceModal', () => {
- it('renders', async () => {
+ test('renders', async () => {
expect(container).toBeDefined();
});
- it('renders the component', () => {
+ test('renders the component', () => {
expect(screen.getByText('Edit Dataset')).toBeInTheDocument();
});
- it('renders a Modal', async () => {
+ test('renders a Modal', async () => {
expect(screen.getByRole('dialog')).toBeInTheDocument();
});
- it('renders a DatasourceEditor', async () => {
+ test('renders a DatasourceEditor', async () => {
expect(screen.getByTestId('datasource-editor')).toBeInTheDocument();
});
- it('disables the save button when the datasource is managed externally', () => {
+ test('disables the save button when the datasource is managed externally', () => {
// the render is currently in a before operation, so it needs to be cleaned up
// we could alternatively move all the renders back into the tests or find a better
// way to automatically render but still allow to pass in props with the tests
@@ -104,7 +104,7 @@ describe('DatasourceModal', () => {
expect(saveButton).toBeDisabled();
});
- it('calls the onDatasourceSave function when the save button is clicked', async () => {
+ test('calls the onDatasourceSave function when the save button is clicked', async () => {
cleanup();
const onDatasourceSave = jest.fn();
@@ -120,7 +120,7 @@ describe('DatasourceModal', () => {
});
});
- it('should render error dialog', async () => {
+ test('should render error dialog', async () => {
jest
.spyOn(SupersetClient, 'put')
.mockRejectedValue(new Error('Something went wrong'));
diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditor.test.jsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditor.test.jsx
index e77a813eca..d62a6f8c3a 100644
--- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditor.test.jsx
+++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditor.test.jsx
@@ -80,11 +80,11 @@ describe('DatasourceEditor', () => {
// jest.clearAllMocks();
});
- it('renders Tabs', () => {
+ test('renders Tabs', () => {
expect(screen.getByTestId('edit-dataset-tabs')).toBeInTheDocument();
});
- it('can sync columns from source', async () => {
+ test('can sync columns from source', async () => {
const columnsTab = screen.getByTestId('collection-tab-Columns');
userEvent.click(columnsTab);
@@ -111,7 +111,7 @@ describe('DatasourceEditor', () => {
});
// to add, remove and modify columns accordingly
- it('can modify columns', async () => {
+ test('can modify columns', async () => {
const columnsTab = screen.getByTestId('collection-tab-Columns');
userEvent.click(columnsTab);
@@ -138,7 +138,7 @@ describe('DatasourceEditor', () => {
userEvent.type(inputCertDetails, 'test');
}, 40000);
- it('can delete columns', async () => {
+ test('can delete columns', async () => {
const columnsTab = screen.getByTestId('collection-tab-Columns');
userEvent.click(columnsTab);
@@ -162,7 +162,7 @@ describe('DatasourceEditor', () => {
});
}, 60000); // 60 seconds timeout to avoid timeouts
- it('can add new columns', async () => {
+ test('can add new columns', async () => {
const calcColsTab = screen.getByTestId('collection-tab-Calculated columns');
userEvent.click(calcColsTab);
@@ -180,7 +180,7 @@ describe('DatasourceEditor', () => {
});
}, 60000);
- it('renders isSqla fields', async () => {
+ test('renders isSqla fields', async () => {
const columnsTab = screen.getByRole('tab', {
name: /settings/i,
});
@@ -216,7 +216,7 @@ describe('DatasourceEditor Source Tab', () => {
isFeatureEnabled.mockRestore();
});
- it('Source Tab: edit mode', async () => {
+ test('Source Tab: edit mode', async () => {
const getLockBtn = screen.getByRole('img', { name: /lock/i });
userEvent.click(getLockBtn);
@@ -231,7 +231,7 @@ describe('DatasourceEditor Source Tab', () => {
expect(virtualRadioBtn).toBeEnabled();
});
- it('Source Tab: readOnly mode', () => {
+ test('Source Tab: readOnly mode', () => {
const getLockBtn = screen.getByRole('img', { name: /lock/i });
expect(getLockBtn).toBeInTheDocument();
@@ -246,7 +246,7 @@ describe('DatasourceEditor Source Tab', () => {
expect(virtualRadioBtn).toBeDisabled();
});
- it('calls onChange with empty SQL when switching to physical dataset', async () => {
+ test('calls onChange with empty SQL when switching to physical dataset', async () => {
// Clean previous render
cleanup();
diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorCurrency.test.jsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorCurrency.test.jsx
index 8e032c23e6..543e6157e8 100644
--- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorCurrency.test.jsx
+++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorCurrency.test.jsx
@@ -40,7 +40,7 @@ describe('DatasourceEditor Currency Tests', () => {
});
// The problematic test, now optimized
- it('renders currency controls', async () => {
+ test('renders currency controls', async () => {
// Setup a metric with currency data
const propsWithCurrency = {
...props,
diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorRTL.test.jsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorRTL.test.jsx
index 5a4b869e7a..fdad41b1be 100644
--- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorRTL.test.jsx
+++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorRTL.test.jsx
@@ -34,7 +34,7 @@ describe('DatasourceEditor RTL Metrics Tests', () => {
fetchMock.restore();
});
- it('properly renders the metric information', async () => {
+ test('properly renders the metric information', async () => {
await asyncRender(props);
const metricButton = screen.getByTestId('collection-tab-Metrics');
@@ -52,7 +52,7 @@ describe('DatasourceEditor RTL Metrics Tests', () => {
expect(warningMarkdown.value).toEqual('someone');
});
- it('properly updates the metric information', async () => {
+ test('properly updates the metric information', async () => {
await asyncRender(props);
const metricButton = screen.getByTestId('collection-tab-Metrics');
@@ -92,7 +92,7 @@ describe('DatasourceEditor RTL Columns Tests', () => {
fetchMock.restore();
});
- it('shows the default datetime column', async () => {
+ test('shows the default datetime column', async () => {
await asyncRender(props);
const columnsButton = screen.getByTestId('collection-tab-Columns');
@@ -107,7 +107,7 @@ describe('DatasourceEditor RTL Columns Tests', () => {
expect(genderDefaultDatetimeRadio).not.toBeChecked();
});
- it('allows choosing only temporal columns as the default datetime', async () => {
+ test('allows choosing only temporal columns as the default datetime', async () => {
await asyncRender(props);
const columnsButton = screen.getByTestId('collection-tab-Columns');
diff --git a/superset-frontend/src/components/Datasource/utils/utils.test.tsx b/superset-frontend/src/components/Datasource/utils/utils.test.tsx
index cb3d35416b..9f6e590086 100644
--- a/superset-frontend/src/components/Datasource/utils/utils.test.tsx
+++ b/superset-frontend/src/components/Datasource/utils/utils.test.tsx
@@ -27,7 +27,7 @@ describe('updateColumns', () => {
addSuccessToast = jest.fn();
});
- it('adds new columns when prevCols is empty', () => {
+ test('adds new columns when prevCols is empty', () => {
interface Column {
column_name: string;
type: string;
@@ -56,7 +56,7 @@ describe('updateColumns', () => {
);
});
- it('modifies columns when type or is_dttm changes', () => {
+ test('modifies columns when type or is_dttm changes', () => {
const prevCols = [
{ column_name: 'col1', type: 'string', is_dttm: false },
{ column_name: 'col2', type: 'number', is_dttm: false },
@@ -94,7 +94,7 @@ describe('updateColumns', () => {
);
});
- it('removes columns not present in newCols', () => {
+ test('removes columns not present in newCols', () => {
const prevCols = [
{ column_name: 'col1', type: 'string', is_dttm: false },
{ column_name: 'col2', type: 'number', is_dttm: true },
@@ -121,7 +121,7 @@ describe('updateColumns', () => {
);
});
- it('handles combined additions, modifications, and removals', () => {
+ test('handles combined additions, modifications, and removals', () => {
const prevCols = [
{ column_name: 'col1', type: 'string', is_dttm: false },
{ column_name: 'col2', type: 'number', is_dttm: false },
@@ -170,7 +170,7 @@ describe('updateColumns', () => {
],
]);
});
- it('should not remove columns with expressions', () => {
+ test('should not remove columns with expressions', () => {
const prevCols = [
{ column_name: 'col1', type: 'string', is_dttm: false },
{ column_name: 'col2', type: 'number', is_dttm: false },
diff --git a/superset-frontend/src/components/ErrorMessage/ErrorAlert.test.tsx b/superset-frontend/src/components/ErrorMessage/ErrorAlert.test.tsx
index 2538b1e800..c6966f6789 100644
--- a/superset-frontend/src/components/ErrorMessage/ErrorAlert.test.tsx
+++ b/superset-frontend/src/components/ErrorMessage/ErrorAlert.test.tsx
@@ -21,7 +21,7 @@ import { screen, fireEvent, render } from 'spec/helpers/testing-library';
import { ErrorAlert } from './ErrorAlert';
describe('ErrorAlert', () => {
- it('renders the error message correctly', () => {
+ test('renders the error message correctly', () => {
render(
<ErrorAlert
errorType="Error"
@@ -34,7 +34,7 @@ describe('ErrorAlert', () => {
expect(screen.getByText('Something went wrong')).toBeInTheDocument();
});
- it('renders the description when provided', () => {
+ test('renders the description when provided', () => {
const description = 'This is a detailed description';
render(
<ErrorAlert
@@ -48,7 +48,7 @@ describe('ErrorAlert', () => {
expect(screen.getByText(description)).toBeInTheDocument();
});
- it('toggles description details visibility when show more/less is clicked', () => {
+ test('toggles description details visibility when show more/less is clicked', () => {
const descriptionDetails = 'Additional details about the error.';
render(
<ErrorAlert
@@ -71,7 +71,7 @@ describe('ErrorAlert', () => {
expect(screen.queryByText(descriptionDetails)).not.toBeInTheDocument();
});
- it('renders compact mode with a tooltip and modal', () => {
+ test('renders compact mode with a tooltip and modal', () => {
render(
<ErrorAlert
errorType="Error"
diff --git a/superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.test.tsx b/superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.test.tsx
index 6ca62b9981..14e5c1e8b1 100644
--- a/superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.test.tsx
+++ b/superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.test.tsx
@@ -64,7 +64,7 @@ describe('InvalidSQLErrorMessage', () => {
await new Promise(resolve => setTimeout(resolve, 0));
});
- it('renders the error message with correct properties', async () => {
+ test('renders the error message with correct properties', async () => {
const { getByText, unmount } = renderComponent();
// Validate main properties
@@ -75,13 +75,13 @@ describe('InvalidSQLErrorMessage', () => {
unmount();
});
- it('renders the error message with the empty extra properties', () => {
+ test('renders the error message with the empty extra properties', () => {
const { getByText } = renderComponent(missingExtraProps);
expect(getByText('Unable to parse SQL')).toBeInTheDocument();
expect(getByText(missingExtraProps.error.message)).toBeInTheDocument();
});
- it('displays the SQL error line and column indicator', async () => {
+ test('displays the SQL error line and column indicator', async () => {
const { getByText, container, unmount } = renderComponent();
// Validate SQL and caret indicator
@@ -95,7 +95,7 @@ describe('InvalidSQLErrorMessage', () => {
unmount();
});
- it('handles missing line number gracefully', async () => {
+ test('handles missing line number gracefully', async () => {
const overrides = {
error: {
...defaultProps.error,
@@ -114,7 +114,7 @@ describe('InvalidSQLErrorMessage', () => {
unmount();
});
- it('handles missing column number gracefully', async () => {
+ test('handles missing column number gracefully', async () => {
const overrides = {
error: {
...defaultProps.error,
diff --git a/superset-frontend/src/components/ErrorMessage/OAuth2RedirectMessage.test.tsx b/superset-frontend/src/components/ErrorMessage/OAuth2RedirectMessage.test.tsx
index 99ecf894dc..9440ce2e81 100644
--- a/superset-frontend/src/components/ErrorMessage/OAuth2RedirectMessage.test.tsx
+++ b/superset-frontend/src/components/ErrorMessage/OAuth2RedirectMessage.test.tsx
@@ -100,14 +100,14 @@ const setup = (overrides = {}) => (
);
describe('OAuth2RedirectMessage Component', () => {
- it('renders without crashing and displays the correct initial UI elements', () => {
+ test('renders without crashing and displays the correct initial UI elements', () => {
const { getByText } = render(setup());
expect(getByText(/Authorization needed/i)).toBeInTheDocument();
expect(getByText(/provide authorization/i)).toBeInTheDocument();
});
- it('opens a new window with the correct URL when the link is clicked', () => {
+ test('opens a new window with the correct URL when the link is clicked', () => {
const { getByText } = render(setup());
const linkElement = getByText(/provide authorization/i);
@@ -116,7 +116,7 @@ describe('OAuth2RedirectMessage Component', () => {
expect(mockOpen).toHaveBeenCalledWith('https://example.com', '_blank');
});
- it('cleans up the message event listener on unmount', () => {
+ test('cleans up the message event listener on unmount', () => {
const { unmount } = render(setup());
expect(mockAddEventListener).toHaveBeenCalled();
@@ -124,7 +124,7 @@ describe('OAuth2RedirectMessage Component', () => {
expect(mockRemoveEventListener).toHaveBeenCalled();
});
- it('dispatches reRunQuery action when a message with correct tab ID is received for SQL Lab', async () => {
+ test('dispatches reRunQuery action when a message with correct tab ID is received for SQL Lab', async () => {
render(setup());
simulateMessageEvent({ tabId: 'tabId' }, 'https://redirect.example.com');
@@ -134,7 +134,7 @@ describe('OAuth2RedirectMessage Component', () => {
});
});
- it('dispatches triggerQuery action for explore source upon receiving a correct message', async () => {
+ test('dispatches triggerQuery action for explore source upon receiving a correct message', async () => {
render(setup({ source: 'explore' }));
simulateMessageEvent({ tabId: 'tabId' }, 'https://redirect.example.com');
@@ -144,7 +144,7 @@ describe('OAuth2RedirectMessage Component', () => {
});
});
- it('dispatches onRefresh action for dashboard source upon receiving a correct message', async () => {
+ test('dispatches onRefresh action for dashboard source upon receiving a correct message', async () => {
render(setup({ source: 'dashboard' }));
simulateMessageEvent({ tabId: 'tabId' }, 'https://redirect.example.com');
diff --git a/superset-frontend/src/components/FacePile/FacePile.test.tsx b/superset-frontend/src/components/FacePile/FacePile.test.tsx
index afdd8008b9..1d4d908c40 100644
--- a/superset-frontend/src/components/FacePile/FacePile.test.tsx
+++ b/superset-frontend/src/components/FacePile/FacePile.test.tsx
@@ -58,14 +58,14 @@ afterEach(() => {
});
describe('FacePile', () => {
- it('renders empty state with no users', () => {
+ test('renders empty state with no users', () => {
const { container } = render(<FacePile users={[]} />, { store });
expect(container.querySelector('.ant-avatar-group')).toBeInTheDocument();
expect(container.querySelectorAll('.ant-avatar')).toHaveLength(0);
});
- it('renders single user without truncation', () => {
+ test('renders single user without truncation', () => {
const { container } = render(<FacePile users={users.slice(0, 1)} />, {
store,
});
@@ -76,7 +76,7 @@ describe('FacePile', () => {
expect(within(container).queryByText(/\+/)).not.toBeInTheDocument();
});
- it('renders multiple users no truncation', () => {
+ test('renders multiple users no truncation', () => {
const { container } = render(<FacePile users={users.slice(0, 4)} />, {
store,
});
@@ -90,7 +90,7 @@ describe('FacePile', () => {
expect(within(container).queryByText(/\+/)).not.toBeInTheDocument();
});
- it('renders multiple users with truncation', () => {
+ test('renders multiple users with truncation', () => {
const { container } = render(<FacePile users={users} />, { store });
// Should show 4 avatars + 1 overflow indicator = 5 total elements
@@ -107,7 +107,7 @@ describe('FacePile', () => {
expect(within(container).getByText('+6')).toBeInTheDocument();
});
- it('displays user tooltip on hover', () => {
+ test('displays user tooltip on hover', () => {
const { container } = render(<FacePile users={users.slice(0, 2)} />, {
store,
});
@@ -119,7 +119,7 @@ describe('FacePile', () => {
expect(screen.getByRole('tooltip')).toHaveTextContent('user 0');
});
- it('displays avatar images when Slack avatars are enabled', () => {
+ test('displays avatar images when Slack avatars are enabled', () => {
// Enable Slack avatars feature flag
mockIsFeatureEnabled.mockImplementation(
feature => feature === 'SLACK_ENABLE_AVATARS',
@@ -147,20 +147,20 @@ describe('utils', () => {
describe('getRandomColor', () => {
const colors = ['color1', 'color2', 'color3'];
- it('produces the same color for the same input values', () => {
+ test('produces the same color for the same input values', () => {
const name = 'foo';
expect(getRandomColor(name, colors)).toEqual(
getRandomColor(name, colors),
);
});
- it('produces a different color for different input values', () => {
+ test('produces a different color for different input values', () => {
expect(getRandomColor('foo', colors)).not.toEqual(
getRandomColor('bar', colors),
);
});
- it('handles non-ascii input values', () => {
+ test('handles non-ascii input values', () => {
expect(getRandomColor('泰', colors)).toMatchInlineSnapshot(`"color1"`);
expect(getRandomColor('مُحَمَّد', colors)).toMatchInlineSnapshot(
`"color2"`,
diff --git a/superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx b/superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx
index 78ec51aef3..b21a863867 100644
--- a/superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx
+++ b/superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx
@@ -40,10 +40,10 @@ describe('FilterableTable', () => {
],
height: 500,
};
- it('is valid element', () => {
+ test('is valid element', () => {
expect(isValidElement(<FilterableTable {...mockedProps} />)).toBe(true);
});
- it('renders a grid with 3 Table rows', () => {
+ test('renders a grid with 3 Table rows', () => {
const { getByRole, getByText } = render(
<FilterableTable {...mockedProps} />,
);
@@ -52,7 +52,7 @@ describe('FilterableTable', () => {
expect(getByText(columnBContent)).toBeInTheDocument();
});
});
- it('filters on a string', () => {
+ test('filters on a string', () => {
const props = {
...mockedProps,
filterText: 'b1',
@@ -62,7 +62,7 @@ describe('FilterableTable', () => {
expect(queryByText('b2')).not.toBeInTheDocument();
expect(queryByText('b3')).not.toBeInTheDocument();
});
- it('filters on a number', () => {
+ test('filters on a number', () => {
const props = {
...mockedProps,
filterText: '100',
@@ -79,7 +79,7 @@ describe('FilterableTable sorting - RTL', () => {
setupAGGridModules();
});
- it('sorts strings correctly', () => {
+ test('sorts strings correctly', () => {
const stringProps = {
orderedColumnKeys: ['columnA'],
data: [
@@ -128,7 +128,7 @@ describe('FilterableTable sorting - RTL', () => {
);
});
- it('sorts integers correctly', () => {
+ test('sorts integers correctly', () => {
const integerProps = {
orderedColumnKeys: ['columnB'],
data: [{ columnB: 21 }, { columnB: 0 }, { columnB: 623 }],
@@ -163,7 +163,7 @@ describe('FilterableTable sorting - RTL', () => {
expect(gridCells?.textContent).toEqual(['21', '0', '623'].join(''));
});
- it('sorts floating numbers correctly', () => {
+ test('sorts floating numbers correctly', () => {
const floatProps = {
orderedColumnKeys: ['columnC'],
data: [{ columnC: 45.67 }, { columnC: 1.23 }, { columnC: 89.0000001 }],
@@ -206,7 +206,7 @@ describe('FilterableTable sorting - RTL', () => {
);
});
- it('sorts rows properly when floating numbers have mixed types', () => {
+ test('sorts rows properly when floating numbers have mixed types', () => {
const mixedFloatProps = {
orderedColumnKeys: ['columnD'],
data: [
@@ -308,7 +308,7 @@ describe('FilterableTable sorting - RTL', () => {
);
});
- it('sorts YYYY-MM-DD properly', () => {
+ test('sorts YYYY-MM-DD properly', () => {
const dsProps = {
orderedColumnKeys: ['columnDS'],
data: [
diff --git a/superset-frontend/src/components/ListView/ListView.test.jsx b/superset-frontend/src/components/ListView/ListView.test.jsx
index 6c03c975ec..944f726da0 100644
--- a/superset-frontend/src/components/ListView/ListView.test.jsx
+++ b/superset-frontend/src/components/ListView/ListView.test.jsx
@@ -146,7 +146,7 @@ describe('ListView', () => {
});
// Example of converted test:
- it('calls fetchData on mount', () => {
+ test('calls fetchData on mount', () => {
expect(mockedProps.fetchData).toHaveBeenCalledWith({
filters: [],
pageIndex: 0,
@@ -155,7 +155,7 @@ describe('ListView', () => {
});
});
- it('calls fetchData on sort', async () => {
+ test('calls fetchData on sort', async () => {
const sortHeader = screen.getAllByTestId('sort-header')[1];
await userEvent.click(sortHeader);
@@ -173,7 +173,7 @@ describe('ListView', () => {
});
// Update pagination control tests for Ant Design pagination
- it('renders pagination controls', () => {
+ test('renders pagination controls', () => {
const paginationList = screen.getByRole('list');
expect(paginationList).toBeInTheDocument();
@@ -181,7 +181,7 @@ describe('ListView', () => {
expect(pageOneItem).toBeInTheDocument();
});
- it('calls fetchData on page change', async () => {
+ test('calls fetchData on page change', async () => {
const pageTwoItem = screen.getByRole('listitem', { name: '2' });
await userEvent.click(pageTwoItem);
@@ -197,7 +197,7 @@ describe('ListView', () => {
});
});
- it('handles bulk actions on 1 row', async () => {
+ test('handles bulk actions on 1 row', async () => {
const checkboxes = screen.getAllByRole('checkbox');
await userEvent.click(checkboxes[1]); // Index 1 is the first row checkbox
@@ -217,12 +217,12 @@ describe('ListView', () => {
});
// Update UI filters test to use more specific selector
- it('renders UI filters', () => {
+ test('renders UI filters', () => {
const filterControls = screen.getAllByRole('combobox');
expect(filterControls).toHaveLength(2);
});
- it('calls fetchData on filter', async () => {
+ test('calls fetchData on filter', async () => {
// Handle select filter
const selectFilter = screen.getAllByRole('combobox')[0];
await userEvent.click(selectFilter);
@@ -252,7 +252,7 @@ describe('ListView', () => {
);
});
- it('calls fetchData on card view sort', async () => {
+ test('calls fetchData on card view sort', async () => {
factory({
...mockedProps,
renderCard: jest.fn(),
diff --git a/superset-frontend/src/components/MessageToasts/reducers.test.js b/superset-frontend/src/components/MessageToasts/reducers.test.js
index d3d5d61dec..d1287d94e9 100644
--- a/superset-frontend/src/components/MessageToasts/reducers.test.js
+++ b/superset-frontend/src/components/MessageToasts/reducers.test.js
@@ -20,11 +20,11 @@ import { ADD_TOAST, REMOVE_TOAST } from 'src/components/MessageToasts/actions';
import messageToastsReducer from 'src/components/MessageToasts/reducers';
describe('messageToasts reducer', () => {
- it('should return initial state', () => {
+ test('should return initial state', () => {
expect(messageToastsReducer(undefined, {})).toEqual([]);
});
- it('should add a toast', () => {
+ test('should add a toast', () => {
expect(
messageToastsReducer([], {
type: ADD_TOAST,
@@ -33,7 +33,7 @@ describe('messageToasts reducer', () => {
).toEqual([{ text: 'test', id: 'id', type: 'test_type' }]);
});
- it('should remove a toast', () => {
+ test('should remove a toast', () => {
expect(
messageToastsReducer([{ id: 'id' }, { id: 'id2' }], {
type: REMOVE_TOAST,
diff --git a/superset-frontend/src/components/ModalTitleWithIcon/ModalTitleWithIcon.test.tsx b/superset-frontend/src/components/ModalTitleWithIcon/ModalTitleWithIcon.test.tsx
index f932f8ac35..d018630b26 100644
--- a/superset-frontend/src/components/ModalTitleWithIcon/ModalTitleWithIcon.test.tsx
+++ b/superset-frontend/src/components/ModalTitleWithIcon/ModalTitleWithIcon.test.tsx
@@ -21,26 +21,26 @@ import { Icons } from '@superset-ui/core/components';
import { ModalTitleWithIcon } from '.';
describe('ModalTitleWithIcon', () => {
- it('renders the title without icon if none is passed and isEditMode is undefined', () => {
+ test('renders the title without icon if none is passed and isEditMode is undefined', () => {
render(<ModalTitleWithIcon title="My Title" />);
expect(screen.getByText('My Title')).toBeInTheDocument();
expect(screen.queryByRole('img')).not.toBeInTheDocument();
});
- it('renders Edit icon if isEditMode is true', () => {
+ test('renders Edit icon if isEditMode is true', () => {
render(<ModalTitleWithIcon title="Edit Mode" isEditMode />);
expect(screen.getByText('Edit Mode')).toBeInTheDocument();
expect(screen.getByRole('img', { name: /edit/i })).toBeInTheDocument();
});
- it('renders Plus icon if isEditMode is false', () => {
+ test('renders Plus icon if isEditMode is false', () => {
render(<ModalTitleWithIcon title="Add Mode" isEditMode={false} />);
expect(screen.getByText('Add Mode')).toBeInTheDocument();
expect(screen.getByRole('img', { name: /plus/i })).toBeInTheDocument();
});
- it('renders custom icon when passed explicitly', () => {
+ test('renders custom icon when passed explicitly', () => {
render(
<ModalTitleWithIcon
title="Custom Icon"
@@ -51,7 +51,7 @@ describe('ModalTitleWithIcon', () => {
expect(screen.getByTestId('custom-icon')).toBeInTheDocument();
});
- it('respects the level prop (e.g., renders h3 for level=3)', () => {
+ test('respects the level prop (e.g., renders h3 for level=3)', () => {
const { container } = render(
<ModalTitleWithIcon title="Header Level 3" level={3} />,
);
diff --git a/superset-frontend/src/components/ResizableSidebar/useStoredSidebarWidth.test.ts b/superset-frontend/src/components/ResizableSidebar/useStoredSidebarWidth.test.ts
index 74ea8e6151..4565aa7ed3 100644
--- a/superset-frontend/src/components/ResizableSidebar/useStoredSidebarWidth.test.ts
+++ b/superset-frontend/src/components/ResizableSidebar/useStoredSidebarWidth.test.ts
@@ -35,7 +35,7 @@ describe('useStoredSidebarWidth', () => {
localStorage.clear();
});
- it('returns a default filterBar width by initialWidth', () => {
+ test('returns a default filterBar width by initialWidth', () => {
const id = '123';
const { result } = renderHook(() =>
useStoredSidebarWidth(id, INITIAL_WIDTH),
@@ -45,7 +45,7 @@ describe('useStoredSidebarWidth', () => {
expect(actualWidth).toEqual(INITIAL_WIDTH);
});
- it('returns a stored filterBar width from localStorage', () => {
+ test('returns a stored filterBar width from localStorage', () => {
const id = '123';
const expectedWidth = 378;
setItem(LocalStorageKeys.CommonResizableSidebarWidths, {
@@ -61,7 +61,7 @@ describe('useStoredSidebarWidth', () => {
expect(actualWidth).not.toEqual(250);
});
- it('returns a setter for filterBar width that stores the state in localStorage together', () => {
+ test('returns a setter for filterBar width that stores the state in localStorage together', () => {
const id = '123';
const expectedWidth = 378;
const otherDashboardId = '456';
diff --git a/superset-frontend/src/components/SQLEditorWithValidation/SQLEditorWithValidation.test.tsx b/superset-frontend/src/components/SQLEditorWithValidation/SQLEditorWithValidation.test.tsx
index 4be56bb5ca..04d367bc65 100644
--- a/superset-frontend/src/components/SQLEditorWithValidation/SQLEditorWithValidation.test.tsx
+++ b/superset-frontend/src/components/SQLEditorWithValidation/SQLEditorWithValidation.test.tsx
@@ -46,7 +46,7 @@ describe('SQLEditorWithValidation', () => {
jest.clearAllMocks();
});
- it('renders SQLEditor with validation bar when showValidation is true', () => {
+ test('renders SQLEditor with validation bar when showValidation is true', () => {
render(<SQLEditorWithValidation {...defaultProps} />);
expect(screen.getByText('Unverified')).toBeInTheDocument();
@@ -55,7 +55,7 @@ describe('SQLEditorWithValidation', () => {
).toBeInTheDocument();
});
- it('does not render validation bar when showValidation is false', () => {
+ test('does not render validation bar when showValidation is false', () => {
render(
<SQLEditorWithValidation {...defaultProps} showValidation={false} />,
);
@@ -66,7 +66,7 @@ describe('SQLEditorWithValidation', () => {
).not.toBeInTheDocument();
});
- it('shows primary button style when unverified', () => {
+ test('shows primary button style when unverified', () => {
render(<SQLEditorWithValidation {...defaultProps} />);
const validateButton = screen.getByRole('button', {
@@ -76,7 +76,7 @@ describe('SQLEditorWithValidation', () => {
// Button should have primary styling (this would need to check actual class or style)
});
- it('disables validate button when no value or datasourceId', () => {
+ test('disables validate button when no value or datasourceId', () => {
render(
<SQLEditorWithValidation
{...defaultProps}
@@ -91,7 +91,7 @@ describe('SQLEditorWithValidation', () => {
expect(validateButton).toBeDisabled();
});
- it('shows validating state when validation is in progress', async () => {
+ test('shows validating state when validation is in progress', async () => {
const mockPost = SupersetClient.post as jest.MockedFunction<
typeof SupersetClient.post
>;
@@ -117,7 +117,7 @@ describe('SQLEditorWithValidation', () => {
});
});
- it('shows success state when validation passes', async () => {
+ test('shows success state when validation passes', async () => {
const mockPost = SupersetClient.post as jest.MockedFunction<
typeof SupersetClient.post
>;
@@ -138,7 +138,7 @@ describe('SQLEditorWithValidation', () => {
expect(validateButton).toBeInTheDocument();
});
- it('shows error state when validation fails', async () => {
+ test('shows error state when validation fails', async () => {
const mockPost = SupersetClient.post as jest.MockedFunction<
typeof SupersetClient.post
>;
@@ -169,7 +169,7 @@ describe('SQLEditorWithValidation', () => {
});
});
- it('handles API errors gracefully', async () => {
+ test('handles API errors gracefully', async () => {
const mockPost = SupersetClient.post as jest.MockedFunction<
typeof SupersetClient.post
>;
@@ -189,7 +189,7 @@ describe('SQLEditorWithValidation', () => {
});
});
- it('sends correct payload for column expression', async () => {
+ test('sends correct payload for column expression', async () => {
const mockPost = SupersetClient.post as jest.MockedFunction<
typeof SupersetClient.post
>;
@@ -221,7 +221,7 @@ describe('SQLEditorWithValidation', () => {
});
});
- it('sends correct payload for WHERE expression', async () => {
+ test('sends correct payload for WHERE expression', async () => {
const mockPost = SupersetClient.post as jest.MockedFunction<
typeof SupersetClient.post
>;
@@ -252,7 +252,7 @@ describe('SQLEditorWithValidation', () => {
});
});
- it('sends correct payload for HAVING expression', async () => {
+ test('sends correct payload for HAVING expression', async () => {
const mockPost = SupersetClient.post as jest.MockedFunction<
typeof SupersetClient.post
>;
@@ -283,7 +283,7 @@ describe('SQLEditorWithValidation', () => {
});
});
- it('resets validation state when value changes', () => {
+ test('resets validation state when value changes', () => {
const { rerender } = render(<SQLEditorWithValidation {...defaultProps} />);
// Simulate having a validation result
@@ -304,7 +304,7 @@ describe('SQLEditorWithValidation', () => {
expect(screen.getByText('Unverified')).toBeInTheDocument();
});
- it('calls onChange when editor value changes', () => {
+ test('calls onChange when editor value changes', () => {
const onChange = jest.fn();
render(<SQLEditorWithValidation {...defaultProps} onChange={onChange} />);
@@ -313,7 +313,7 @@ describe('SQLEditorWithValidation', () => {
expect(onChange).toBeDefined();
});
- it('calls onValidationComplete callback when provided', async () => {
+ test('calls onValidationComplete callback when provided', async () => {
const onValidationComplete = jest.fn();
const mockPost = SupersetClient.post as jest.MockedFunction<
typeof SupersetClient.post
@@ -337,7 +337,7 @@ describe('SQLEditorWithValidation', () => {
});
});
- it('calls onValidationComplete with errors when validation fails', async () => {
+ test('calls onValidationComplete with errors when validation fails', async () => {
const onValidationComplete = jest.fn();
const mockPost = SupersetClient.post as jest.MockedFunction<
typeof SupersetClient.post
@@ -371,7 +371,7 @@ describe('SQLEditorWithValidation', () => {
});
});
- it('shows tooltip with full error message when error is truncated', async () => {
+ test('shows tooltip with full error message when error is truncated', async () => {
const longErrorMessage =
'This is a very long error message that should be truncated in the display but shown in full in the tooltip when user hovers over it';
@@ -410,7 +410,7 @@ describe('SQLEditorWithValidation', () => {
expect(errorElement.parentElement).toBeTruthy();
});
- it('handles empty response gracefully', async () => {
+ test('handles empty response gracefully', async () => {
const mockPost = SupersetClient.post as jest.MockedFunction<
typeof SupersetClient.post
>;
diff --git a/superset-frontend/src/dashboard/actions/dashboardLayout.test.js b/superset-frontend/src/dashboard/actions/dashboardLayout.test.js
index aaf85dd0d2..fc402d05c5 100644
--- a/superset-frontend/src/dashboard/actions/dashboardLayout.test.js
+++ b/superset-frontend/src/dashboard/actions/dashboardLayout.test.js
@@ -86,7 +86,7 @@ describe('dashboardLayout actions', () => {
});
describe('updateComponents', () => {
- it('should dispatch an updateLayout action', () => {
+ test('should dispatch an updateLayout action', () => {
const { getState, dispatch } = setup();
const nextComponents = { 1: {} };
const thunk = updateComponents(nextComponents);
@@ -101,7 +101,7 @@ describe('dashboardLayout actions', () => {
expect(dashboardFilters.updateLayoutComponents.callCount).toEqual(0);
});
- it('should dispatch a setUnsavedChanges action if hasUnsavedChanges=false', () => {
+ test('should dispatch a setUnsavedChanges action if hasUnsavedChanges=false', () => {
const { getState, dispatch } = setup({
dashboardState: { hasUnsavedChanges: false },
});
@@ -116,7 +116,7 @@ describe('dashboardLayout actions', () => {
});
describe('deleteComponents', () => {
- it('should dispatch an deleteComponent action', () => {
+ test('should dispatch an deleteComponent action', () => {
const { getState, dispatch } = setup();
const thunk = deleteComponent('id', 'parentId');
thunk(dispatch, getState);
@@ -129,7 +129,7 @@ describe('dashboardLayout actions', () => {
expect(dashboardFilters.updateLayoutComponents.callCount).toEqual(1);
});
- it('should dispatch a setUnsavedChanges action if hasUnsavedChanges=false', () => {
+ test('should dispatch a setUnsavedChanges action if hasUnsavedChanges=false', () => {
const { getState, dispatch } = setup({
dashboardState: { hasUnsavedChanges: false },
});
@@ -143,7 +143,7 @@ describe('dashboardLayout actions', () => {
});
describe('updateDashboardTitle', () => {
- it('should dispatch an updateComponent action for the header component', () => {
+ test('should dispatch an updateComponent action for the header component', () => {
const { getState, dispatch } = setup();
const thunk1 = updateDashboardTitle('new text');
thunk1(dispatch, getState);
@@ -168,7 +168,7 @@ describe('dashboardLayout actions', () => {
});
describe('createTopLevelTabs', () => {
- it('should dispatch a createTopLevelTabs action', () => {
+ test('should dispatch a createTopLevelTabs action', () => {
const { getState, dispatch } = setup();
const dropResult = {};
const thunk = createTopLevelTabs(dropResult);
@@ -182,7 +182,7 @@ describe('dashboardLayout actions', () => {
expect(dashboardFilters.updateLayoutComponents.callCount).toEqual(1);
});
- it('should dispatch a setUnsavedChanges action if hasUnsavedChanges=false', () => {
+ test('should dispatch a setUnsavedChanges action if hasUnsavedChanges=false', () => {
const { getState, dispatch } = setup({
dashboardState: { hasUnsavedChanges: false },
});
@@ -197,7 +197,7 @@ describe('dashboardLayout actions', () => {
});
describe('deleteTopLevelTabs', () => {
- it('should dispatch a deleteTopLevelTabs action', () => {
+ test('should dispatch a deleteTopLevelTabs action', () => {
const { getState, dispatch } = setup();
const dropResult = {};
const thunk = deleteTopLevelTabs(dropResult);
@@ -211,7 +211,7 @@ describe('dashboardLayout actions', () => {
expect(dashboardFilters.updateLayoutComponents.callCount).toEqual(1);
});
- it('should dispatch a setUnsavedChanges action if hasUnsavedChanges=false', () => {
+ test('should dispatch a setUnsavedChanges action if hasUnsavedChanges=false', () => {
const { getState, dispatch } = setup({
dashboardState: { hasUnsavedChanges: false },
});
@@ -240,7 +240,7 @@ describe('dashboardLayout actions', () => {
},
};
- it('should update the size of the component', () => {
+ test('should update the size of the component', () => {
const { getState, dispatch } = setup({
dashboardLayout,
});
@@ -271,7 +271,7 @@ describe('dashboardLayout actions', () => {
expect(dispatch.callCount).toBe(2);
});
- it('should dispatch a setUnsavedChanges action if hasUnsavedChanges=false', () => {
+ test('should dispatch a setUnsavedChanges action if hasUnsavedChanges=false', () => {
const { getState, dispatch } = setup({
dashboardState: { hasUnsavedChanges: false },
dashboardLayout,
@@ -290,7 +290,7 @@ describe('dashboardLayout actions', () => {
});
describe('handleComponentDrop', () => {
- it('should create a component if it is new', () => {
+ test('should create a component if it is new', () => {
const { getState, dispatch } = setup();
const dropResult = {
source: { id: NEW_COMPONENTS_SOURCE_ID },
@@ -315,7 +315,7 @@ describe('dashboardLayout actions', () => {
expect(dashboardFilters.updateLayoutComponents.callCount).toEqual(1);
});
- it('should move a component if the component is not new', () => {
+ test('should move a component if the component is not new', () => {
const { getState, dispatch } = setup({
dashboardLayout: {
// if 'dragging' is not only child will dispatch deleteComponent thunk
@@ -345,7 +345,7 @@ describe('dashboardLayout actions', () => {
expect(dashboardFilters.updateLayoutComponents.callCount).toEqual(1);
});
- it('should dispatch a toast if the drop overflows the destination', () => {
+ test('should dispatch a toast if the drop overflows the destination', () => {
const { getState, dispatch } = setup({
dashboardLayout: {
present: {
@@ -374,7 +374,7 @@ describe('dashboardLayout actions', () => {
expect(dispatch.callCount).toBe(1);
});
- it('should delete a parent Row or Tabs if the moved child was the only child', () => {
+ test('should delete a parent Row or Tabs if the moved child was the only child', () => {
const { getState, dispatch } = setup({
dashboardLayout: {
present: {
@@ -411,7 +411,7 @@ describe('dashboardLayout actions', () => {
});
});
- it('should create top-level tabs if dropped on root', () => {
+ test('should create top-level tabs if dropped on root', () => {
const { getState, dispatch } = setup();
const dropResult = {
source: { id: NEW_COMPONENTS_SOURCE_ID },
@@ -433,7 +433,7 @@ describe('dashboardLayout actions', () => {
});
});
- it('should dispatch a toast if drop top-level tab into nested tab', () => {
+ test('should dispatch a toast if drop top-level tab into nested tab', () => {
const { getState, dispatch } = setup({
dashboardLayout: {
present: {
@@ -489,7 +489,7 @@ describe('dashboardLayout actions', () => {
});
describe('undoLayoutAction', () => {
- it('should dispatch a redux-undo .undo() action', () => {
+ test('should dispatch a redux-undo .undo() action', () => {
const { getState, dispatch } = setup({
dashboardLayout: { past: ['non-empty'] },
});
@@ -500,7 +500,7 @@ describe('dashboardLayout actions', () => {
expect(dispatch.getCall(0).args[0]).toEqual(UndoActionCreators.undo());
});
- it('should dispatch a setUnsavedChanges(false) action history length is zero', () => {
+ test('should dispatch a setUnsavedChanges(false) action history length is zero', () => {
const { getState, dispatch } = setup({
dashboardLayout: { past: [] },
});
@@ -513,7 +513,7 @@ describe('dashboardLayout actions', () => {
});
describe('redoLayoutAction', () => {
- it('should dispatch a redux-undo .redo() action', () => {
+ test('should dispatch a redux-undo .redo() action', () => {
const { getState, dispatch } = setup();
const thunk = redoLayoutAction();
thunk(dispatch, getState);
@@ -524,7 +524,7 @@ describe('dashboardLayout actions', () => {
expect(dashboardFilters.updateLayoutComponents.callCount).toEqual(1);
});
- it('should dispatch a setUnsavedChanges(true) action if hasUnsavedChanges=false', () => {
+ test('should dispatch a setUnsavedChanges(true) action if hasUnsavedChanges=false', () => {
const { getState, dispatch } = setup({
dashboardState: { hasUnsavedChanges: false },
});
diff --git a/superset-frontend/src/dashboard/actions/dashboardState.test.js b/superset-frontend/src/dashboard/actions/dashboardState.test.js
index a3f72bc203..e7ec714b14 100644
--- a/superset-frontend/src/dashboard/actions/dashboardState.test.js
+++ b/superset-frontend/src/dashboard/actions/dashboardState.test.js
@@ -102,7 +102,7 @@ describe('dashboardState actions', () => {
}
describe('saveDashboardRequest', () => {
- it('should dispatch UPDATE_COMPONENTS_PARENTS_LIST action', () => {
+ test('should dispatch UPDATE_COMPONENTS_PARENTS_LIST action', () => {
const { getState, dispatch } = setup({
dashboardState: { hasUnsavedChanges: false },
});
@@ -115,7 +115,7 @@ describe('dashboardState actions', () => {
expect(dispatch.getCall(1).args[0].type).toBe(SAVE_DASHBOARD_STARTED);
});
- it('should post dashboard data with updated redux state', () => {
+ test('should post dashboard data with updated redux state', () => {
const { getState, dispatch } = setup({
dashboardState: { hasUnsavedChanges: false },
});
@@ -155,7 +155,7 @@ describe('dashboardState actions', () => {
isFeatureEnabled.mockRestore();
});
- it('dispatches SET_OVERRIDE_CONFIRM when an inspect value has diff', async () => {
+ test('dispatches SET_OVERRIDE_CONFIRM when an inspect value has diff', async () => {
const id = 192;
const { getState, dispatch } = setup();
const thunk = saveDashboardRequest(
@@ -174,7 +174,7 @@ describe('dashboardState actions', () => {
).toBe(id);
});
- it('should post dashboard data with after confirm the overwrite values', async () => {
+ test('should post dashboard data with after confirm the overwrite values', async () => {
const id = 192;
const { getState, dispatch } = setup();
const confirmedDashboardData = {
diff --git a/superset-frontend/src/dashboard/components/AnchorLink/AnchorLink.test.tsx b/superset-frontend/src/dashboard/components/AnchorLink/AnchorLink.test.tsx
index 86230bebad..7df8bc01cc 100644
--- a/superset-frontend/src/dashboard/components/AnchorLink/AnchorLink.test.tsx
+++ b/superset-frontend/src/dashboard/components/AnchorLink/AnchorLink.test.tsx
@@ -30,7 +30,7 @@ describe('AnchorLink', () => {
window.location = globalLocation;
});
- it('should scroll the AnchorLink into view upon mount if id matches hash', async () => {
+ test('should scroll the AnchorLink into view upon mount if id matches hash', async () => {
const callback = jest.fn();
jest.spyOn(document, 'getElementById').mockReturnValue({
scrollIntoView: callback,
@@ -49,7 +49,7 @@ describe('AnchorLink', () => {
expect(callback).toHaveBeenCalledTimes(1);
});
- it('should render anchor link without short link button', () => {
+ test('should render anchor link without short link button', () => {
const { container, queryByRole } = render(
<AnchorLink showShortLinkButton={false} {...props} />,
{ useRedux: true },
@@ -58,7 +58,7 @@ describe('AnchorLink', () => {
expect(queryByRole('button')).not.toBeInTheDocument();
});
- it('should render short link button', () => {
+ test('should render short link button', () => {
const { getByRole } = render(
<AnchorLink {...props} showShortLinkButton />,
{ useRedux: true },
diff --git a/superset-frontend/src/dashboard/components/Dashboard.test.jsx b/superset-frontend/src/dashboard/components/Dashboard.test.jsx
index 8d530134a8..6f87dd1825 100644
--- a/superset-frontend/src/dashboard/components/Dashboard.test.jsx
+++ b/superset-frontend/src/dashboard/components/Dashboard.test.jsx
@@ -91,7 +91,7 @@ describe('Dashboard', () => {
jest.clearAllMocks();
});
- it('should render the children component', () => {
+ test('should render the children component', () => {
renderDashboard();
expect(screen.getByText('Test')).toBeInTheDocument();
});
@@ -102,7 +102,7 @@ describe('Dashboard', () => {
1001: newComponentFactory(CHART_TYPE, { chartId: 1001 }),
};
- it('should call addSliceToDashboard if a new slice is added to the layout', () => {
+ test('should call addSliceToDashboard if a new slice is added to the layout', () => {
const { rerender } = renderDashboard();
rerender(
@@ -116,7 +116,7 @@ describe('Dashboard', () => {
expect(mockAddSlice).toHaveBeenCalled();
});
- it('should call removeSliceFromDashboard if a slice is removed from the layout', () => {
+ test('should call removeSliceFromDashboard if a slice is removed from the layout', () => {
const { rerender } = renderDashboard({ layout: layoutWithExtraChart });
const nextLayout = { ...layoutWithExtraChart };
@@ -135,7 +135,7 @@ describe('Dashboard', () => {
});
describe('filter updates', () => {
- it('should not call refresh when in editMode', () => {
+ test('should not call refresh when in editMode', () => {
const { rerender } = renderDashboard({ activeFilters: OVERRIDE_FILTERS });
rerender(
@@ -156,7 +156,7 @@ describe('Dashboard', () => {
expect(mockTriggerQuery).not.toHaveBeenCalled();
});
- it('should not call refresh when there is no change', () => {
+ test('should not call refresh when there is no change', () => {
const { rerender } = renderDashboard({ activeFilters: OVERRIDE_FILTERS });
rerender(
@@ -170,7 +170,7 @@ describe('Dashboard', () => {
expect(mockTriggerQuery).not.toHaveBeenCalled();
});
- it('should call refresh when native filters changed', () => {
+ test('should call refresh when native filters changed', () => {
getRelatedCharts.mockReturnValue([230]);
const { rerender } = renderDashboard({ activeFilters: OVERRIDE_FILTERS });
@@ -195,7 +195,7 @@ describe('Dashboard', () => {
expect(mockTriggerQuery).toHaveBeenCalled();
});
- it('should call refresh if a filter is added', () => {
+ test('should call refresh if a filter is added', () => {
getRelatedCharts.mockReturnValue([1]);
const { rerender } = renderDashboard({ activeFilters: OVERRIDE_FILTERS });
@@ -214,7 +214,7 @@ describe('Dashboard', () => {
expect(mockTriggerQuery).toHaveBeenCalled();
});
- it('should call refresh if a filter is removed', () => {
+ test('should call refresh if a filter is removed', () => {
getRelatedCharts.mockReturnValue([1]); // Ensure we return some charts to refresh
const { rerender } = renderDashboard({ activeFilters: OVERRIDE_FILTERS });
@@ -233,7 +233,7 @@ describe('Dashboard', () => {
expect(mockTriggerQuery).toHaveBeenCalledWith(true, 1);
});
- it('should call refresh if a filter is changed', () => {
+ test('should call refresh if a filter is changed', () => {
getRelatedCharts.mockReturnValue([1]);
const { rerender } = renderDashboard({ activeFilters: OVERRIDE_FILTERS });
@@ -253,7 +253,7 @@ describe('Dashboard', () => {
expect(mockTriggerQuery).toHaveBeenCalled();
});
- it('should call refresh with multiple chart ids', () => {
+ test('should call refresh with multiple chart ids', () => {
getRelatedCharts.mockReturnValue([1, 2]);
const { rerender } = renderDashboard({ activeFilters: OVERRIDE_FILTERS });
@@ -273,7 +273,7 @@ describe('Dashboard', () => {
expect(mockTriggerQuery).toHaveBeenCalled();
});
- it('should call refresh if a filter scope is changed', () => {
+ test('should call refresh if a filter scope is changed', () => {
getRelatedCharts.mockReturnValue([2]);
const { rerender } = renderDashboard({ activeFilters: OVERRIDE_FILTERS });
@@ -293,7 +293,7 @@ describe('Dashboard', () => {
expect(mockTriggerQuery).toHaveBeenCalled();
});
- it('should call refresh with empty [] if a filter is changed but scope is not applicable', () => {
+ test('should call refresh with empty [] if a filter is changed but scope is not applicable', () => {
getRelatedCharts.mockReturnValue([]);
const { rerender } = renderDashboard({
activeFilters: OVERRIDE_FILTERS,
diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx
index 322d029599..f87f1cd89e 100644
--- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx
+++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx
@@ -120,13 +120,13 @@ describe('DashboardBuilder', () => {
});
}
- it('should render a StickyContainer with class "dashboard"', () => {
+ test('should render a StickyContainer with class "dashboard"', () => {
const { getByTestId } = setup();
const stickyContainer = getByTestId('dashboard-content-wrapper');
expect(stickyContainer).toHaveClass('dashboard');
});
- it('should add the "dashboard--editing" class if editMode=true', () => {
+ test('should add the "dashboard--editing" class if editMode=true', () => {
const { getByTestId } = setup({
dashboardState: { ...mockState.dashboardState, editMode: true },
});
@@ -134,13 +134,13 @@ describe('DashboardBuilder', () => {
expect(stickyContainer).toHaveClass('dashboard dashboard--editing');
});
- it('should render a DragDroppable DashboardHeader', () => {
+ test('should render a DragDroppable DashboardHeader', () => {
const { queryByTestId } = setup();
const header = queryByTestId('dashboard-header-container');
expect(header).toBeInTheDocument();
});
- it('should render a Sticky top-level Tabs if the dashboard has tabs', async () => {
+ test('should render a Sticky top-level Tabs if the dashboard has tabs', async () => {
const { findAllByTestId } = setup({
dashboardLayout: undoableDashboardLayoutWithTabs,
});
@@ -162,7 +162,7 @@ describe('DashboardBuilder', () => {
});
});
- it('should render one Tabs and two TabPane', async () => {
+ test('should render one Tabs and two TabPane', async () => {
const { findAllByRole } = setup({
dashboardLayout: undoableDashboardLayoutWithTabs,
});
@@ -172,7 +172,7 @@ describe('DashboardBuilder', () => {
expect(tabPanels.length).toBe(2);
});
- it('should render a TabPane and DashboardGrid for first Tab', async () => {
+ test('should render a TabPane and DashboardGrid for first Tab', async () => {
const { findByTestId } = setup({
dashboardLayout: undoableDashboardLayoutWithTabs,
});
@@ -188,7 +188,7 @@ describe('DashboardBuilder', () => {
).toBe(1);
});
- it('should render a TabPane and DashboardGrid for second Tab', async () => {
+ test('should render a TabPane and DashboardGrid for second Tab', async () => {
const { findByTestId } = setup({
dashboardLayout: undoableDashboardLayoutWithTabs,
dashboardState: {
@@ -209,13 +209,13 @@ describe('DashboardBuilder', () => {
).toBe(1);
});
- it('should render a BuilderComponentPane if editMode=false and user selects "Insert Components" pane', () => {
+ test('should render a BuilderComponentPane if editMode=false and user selects "Insert Components" pane', () => {
const { queryAllByTestId } = setup();
const builderComponents = queryAllByTestId('mock-builder-component-pane');
expect(builderComponents.length).toBe(0);
});
- it('should render a BuilderComponentPane if editMode=true and user selects "Insert Components" pane', () => {
+ test('should render a BuilderComponentPane if editMode=true and user selects "Insert Components" pane', () => {
const { queryAllByTestId } = setup({
dashboardState: { ...mockState.dashboardState, editMode: true },
});
@@ -223,7 +223,7 @@ describe('DashboardBuilder', () => {
expect(builderComponents.length).toBeGreaterThanOrEqual(1);
});
- it('should change redux state if a top-level Tab is clicked', async () => {
+ test('should change redux state if a top-level Tab is clicked', async () => {
(setDirectPathToChild as jest.Mock).mockImplementation(arg0 => ({
type: 'type',
arg0,
@@ -243,13 +243,13 @@ describe('DashboardBuilder', () => {
(setDirectPathToChild as jest.Mock).mockReset();
});
- it('should not display a loading spinner when saving is not in progress', () => {
+ test('should not display a loading spinner when saving is not in progress', () => {
const { queryByTestId } = setup();
expect(queryByTestId('loading-indicator')).not.toBeInTheDocument();
});
- it('should display a loading spinner when saving is in progress', async () => {
+ test('should display a loading spinner when saving is in progress', async () => {
const { findByTestId } = setup({
dashboardState: { ...mockState.dashboardState, dashboardIsSaving: true },
});
@@ -257,7 +257,7 @@ describe('DashboardBuilder', () => {
expect(await findByTestId('loading-indicator')).toBeVisible();
});
- it('should set FilterBar width by useStoredSidebarWidth', () => {
+ test('should set FilterBar width by useStoredSidebarWidth', () => {
const expectedValue = 200;
const setter = jest.fn();
(useStoredSidebarWidth as jest.Mock).mockImplementation(() => [
@@ -274,7 +274,7 @@ describe('DashboardBuilder', () => {
expect(filterbar).toHaveStyleRule('width', `${expectedValue}px`);
});
- it('filter panel state when featureflag is true', () => {
+ test('filter panel state when featureflag is true', () => {
window.featureFlags = {
[FeatureFlag.FilterBarClosedByDefault]: true,
};
@@ -294,7 +294,7 @@ describe('DashboardBuilder', () => {
expect(filterbar).toHaveStyleRule('width', `${CLOSED_FILTER_BAR_WIDTH}px`);
});
- it('filter panel state when featureflag is false', () => {
+ test('filter panel state when featureflag is false', () => {
window.featureFlags = {
[FeatureFlag.FilterBarClosedByDefault]: false,
};
@@ -314,7 +314,7 @@ describe('DashboardBuilder', () => {
expect(filterbar).toHaveStyleRule('width', `${OPEN_FILTER_BAR_WIDTH}px`);
});
- it('should not render the filter bar when nativeFiltersEnabled is false', () => {
+ test('should not render the filter bar when nativeFiltersEnabled is false', () => {
jest.spyOn(useNativeFiltersModule, 'useNativeFilters').mockReturnValue({
showDashboard: true,
missingInitialFilters: [],
@@ -327,7 +327,7 @@ describe('DashboardBuilder', () => {
expect(queryByTestId('dashboard-filters-panel')).not.toBeInTheDocument();
});
- it('should render the filter bar when nativeFiltersEnabled is true and not in edit mode', () => {
+ test('should render the filter bar when nativeFiltersEnabled is true and not in edit mode', () => {
jest.spyOn(useNativeFiltersModule, 'useNativeFilters').mockReturnValue({
showDashboard: true,
missingInitialFilters: [],
@@ -340,7 +340,7 @@ describe('DashboardBuilder', () => {
expect(queryByTestId('dashboard-filters-panel')).toBeInTheDocument();
});
- it('should not render the filter bar when in edit mode even if nativeFiltersEnabled is true', () => {
+ test('should not render the filter bar when in edit mode even if nativeFiltersEnabled is true', () => {
jest.spyOn(useNativeFiltersModule, 'useNativeFilters').mockReturnValue({
showDashboard: true,
missingInitialFilters: [],
diff --git a/superset-frontend/src/dashboard/components/MissingChart.test.tsx b/superset-frontend/src/dashboard/components/MissingChart.test.tsx
index 3075f51932..c2e15220b6 100644
--- a/superset-frontend/src/dashboard/components/MissingChart.test.tsx
+++ b/superset-frontend/src/dashboard/components/MissingChart.test.tsx
@@ -29,7 +29,7 @@ const setup = (overrides?: MissingChartProps) => (
);
describe('MissingChart', () => {
- it('renders a .missing-chart-container', () => {
+ test('renders a .missing-chart-container', () => {
const rendered = render(setup());
const missingChartContainer = rendered.container.querySelector(
@@ -38,7 +38,7 @@ describe('MissingChart', () => {
expect(missingChartContainer).toBeVisible();
});
- it('renders a .missing-chart-body', () => {
+ test('renders a .missing-chart-body', () => {
const rendered = render(setup());
const missingChartBody = rendered.container.querySelector(
diff --git a/superset-frontend/src/dashboard/components/SliceAdder.test.tsx b/superset-frontend/src/dashboard/components/SliceAdder.test.tsx
index bb97b8f24f..355d5659c2 100644
--- a/superset-frontend/src/dashboard/components/SliceAdder.test.tsx
+++ b/superset-frontend/src/dashboard/components/SliceAdder.test.tsx
@@ -82,28 +82,28 @@ describe('SliceAdder', () => {
jest.clearAllMocks();
});
- it('renders the create new chart button', () => {
+ test('renders the create new chart button', () => {
renderSliceAdder();
expect(screen.getByText('Create new chart')).toBeInTheDocument();
});
- it('renders loading state', () => {
+ test('renders loading state', () => {
renderSliceAdder({ ...defaultProps, isLoading: true });
expect(screen.getByRole('status')).toBeInTheDocument();
});
- it('renders error message', () => {
+ test('renders error message', () => {
const errorMessage = 'Error loading charts';
renderSliceAdder({ ...defaultProps, errorMessage });
expect(screen.getByText(errorMessage)).toBeInTheDocument();
});
- it('fetches slices on mount', () => {
+ test('fetches slices on mount', () => {
renderSliceAdder();
expect(defaultProps.fetchSlices).toHaveBeenCalledWith(1, '', 'changed_on');
});
- it('handles search input changes', async () => {
+ test('handles search input changes', async () => {
renderSliceAdder();
const searchInput = screen.getByPlaceholderText('Filter your charts');
await userEvent.type(searchInput, 'test search');
@@ -114,7 +114,7 @@ describe('SliceAdder', () => {
);
});
- it('handles sort selection changes', async () => {
+ test('handles sort selection changes', async () => {
renderSliceAdder();
// Update selector to match the actual rendered element
const sortSelect = screen.getByText('Sort by recent');
@@ -124,7 +124,7 @@ describe('SliceAdder', () => {
expect(defaultProps.fetchSlices).toHaveBeenCalledWith(1, '', 'viz_type');
});
- it('handles show only my charts toggle', async () => {
+ test('handles show only my charts toggle', async () => {
renderSliceAdder();
const checkbox = screen.getByRole('checkbox');
await userEvent.click(checkbox);
@@ -135,7 +135,7 @@ describe('SliceAdder', () => {
);
});
- it('opens new chart in new tab when create new chart is clicked', () => {
+ test('opens new chart in new tab when create new chart is clicked', () => {
const windowSpy = jest.spyOn(window, 'open').mockImplementation();
renderSliceAdder();
const createButton = screen.getByText('Create new chart');
@@ -170,7 +170,7 @@ describe('SliceAdder', () => {
query_context: null,
};
- it('should sort by changed_on in descending order', () => {
+ test('should sort by changed_on in descending order', () => {
const input = [
{
...baseSlice,
@@ -198,7 +198,7 @@ describe('SliceAdder', () => {
expect(sorted[2].changed_on).toBe(1577836800000);
});
- it('should sort by other fields in ascending order', () => {
+ test('should sort by other fields in ascending order', () => {
const input = [
{
...baseSlice,
@@ -228,7 +228,7 @@ describe('SliceAdder', () => {
});
});
- it('should update selectedSliceIdsSet when props change', () => {
+ test('should update selectedSliceIdsSet when props change', () => {
const { rerender } = renderSliceAdder();
rerender(<SliceAdder {...defaultProps} selectedSliceIds={[129]} />);
// Verify the internal state was updated by checking if new charts are available
diff --git a/superset-frontend/src/dashboard/components/dnd/DragDroppable.test.jsx b/superset-frontend/src/dashboard/components/dnd/DragDroppable.test.jsx
index 666f001cca..69180a8ef9 100644
--- a/superset-frontend/src/dashboard/components/dnd/DragDroppable.test.jsx
+++ b/superset-frontend/src/dashboard/components/dnd/DragDroppable.test.jsx
@@ -60,7 +60,7 @@ describe('DragDroppable', () => {
};
}
- it('should call its child function', () => {
+ test('should call its child function', () => {
const renderChild = jest.fn(provided => (
<div data-test="child-content" {...provided}>
Test Content
@@ -76,7 +76,7 @@ describe('DragDroppable', () => {
);
});
- it('should call its child function with "dragSourceRef" if editMode=true', () => {
+ test('should call its child function with "dragSourceRef" if editMode=true', () => {
const renderChild = jest.fn().mockImplementation(provided => (
<div data-test="child-content" {...provided}>
Test Content
@@ -100,7 +100,7 @@ describe('DragDroppable', () => {
);
});
- it('should call its child function with "dropIndicatorProps" dependent on editMode and isDraggingOver', () => {
+ test('should call its child function with "dropIndicatorProps" dependent on editMode and isDraggingOver', () => {
const renderChild = jest.fn(provided => (
<div data-test="child-content" {...provided}>
Test Content
@@ -135,7 +135,7 @@ describe('DragDroppable', () => {
});
});
- it('should call props.dragPreviewRef and props.droppableRef on mount', () => {
+ test('should call props.dragPreviewRef and props.droppableRef on mount', () => {
const dragPreviewRef = jest.fn();
const droppableRef = jest.fn();
@@ -144,7 +144,7 @@ describe('DragDroppable', () => {
expect(droppableRef).toHaveBeenCalledTimes(1);
});
- it('should handle forbidden drops correctly', () => {
+ test('should handle forbidden drops correctly', () => {
const renderChild = jest.fn(provided => (
<div data-test="child-content" {...provided}>
Test Content
@@ -178,7 +178,7 @@ describe('DragDroppable', () => {
});
});
- it('should handle orientation prop correctly', () => {
+ test('should handle orientation prop correctly', () => {
const { container } = setup({ orientation: 'column' });
expect(container.firstChild).toHaveClass('dragdroppable-column');
@@ -186,7 +186,7 @@ describe('DragDroppable', () => {
expect(container2.firstChild).toHaveClass('dragdroppable-row');
});
- it('should handle disabled drag and drop', () => {
+ test('should handle disabled drag and drop', () => {
const renderChild = jest.fn(provided => (
<div data-test="child-content" {...provided}>
Test Content
@@ -221,7 +221,7 @@ describe('DragDroppable', () => {
});
// Later in the file, remove the require and use the imported getEmptyImage
- it('should handle empty drag preview correctly', () => {
+ test('should handle empty drag preview correctly', () => {
const dragPreviewRef = jest.fn();
setup({
@@ -237,7 +237,7 @@ describe('DragDroppable', () => {
);
});
- it('should call onDropIndicatorChange when appropriate', () => {
+ test('should call onDropIndicatorChange when appropriate', () => {
const onDropIndicatorChange = jest.fn();
const { rerender } = setup({
component: newComponentFactory(TAB_TYPE),
diff --git a/superset-frontend/src/dashboard/components/gridComponents/ChartHolder/ChartHolder.test.tsx b/superset-frontend/src/dashboard/components/gridComponents/ChartHolder/ChartHolder.test.tsx
index aac33a802c..1147f12428 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/ChartHolder/ChartHolder.test.tsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/ChartHolder/ChartHolder.test.tsx
@@ -110,7 +110,7 @@ describe('ChartHolder', () => {
store,
});
- it('should render empty state', async () => {
+ test('should render empty state', async () => {
renderWrapper();
expect(
@@ -124,7 +124,7 @@ describe('ChartHolder', () => {
expect(screen.getByRole('img', { name: 'empty' })).toBeVisible();
});
- it('should render anchor link when not editing', async () => {
+ test('should render anchor link when not editing', async () => {
const store = createMockStore();
const { rerender } = renderWrapper(store, { editMode: false });
@@ -155,7 +155,7 @@ describe('ChartHolder', () => {
).toEqual(0);
});
- it('should highlight when path matches', async () => {
+ test('should highlight when path matches', async () => {
const store = createMockStore({
dashboardState: {
...mockState.dashboardState,
@@ -202,7 +202,7 @@ describe('ChartHolder', () => {
);
});
- it('should calculate the default widthMultiple', async () => {
+ test('should calculate the default widthMultiple', async () => {
const widthMultiple = 5;
renderWrapper(createMockStore(), {
editMode: true,
@@ -231,7 +231,7 @@ describe('ChartHolder', () => {
expect(computedWidth).toEqual(`${expectedWidth}px`);
});
- it('should set the resizable width to auto when parent component type is column', async () => {
+ test('should set the resizable width to auto when parent component type is column', async () => {
renderWrapper(createMockStore(), {
editMode: true,
parentComponent: {
@@ -255,7 +255,7 @@ describe('ChartHolder', () => {
expect(computedWidth).toEqual('auto');
});
- it("should override the widthMultiple if there's a column in the parent chain whose width is less than the chart", async () => {
+ test("should override the widthMultiple if there's a column in the parent chain whose width is less than the chart", async () => {
const widthMultiple = 10;
const parentColumnWidth = 6;
renderWrapper(createMockStore(), {
@@ -288,7 +288,7 @@ describe('ChartHolder', () => {
expect(computedWidth).toEqual(`${expectedWidth}px`);
});
- it('should calculate the chartWidth', async () => {
+ test('should calculate the chartWidth', async () => {
const widthMultiple = 7;
const columnWidth = 250;
renderWrapper(createMockStore(), {
@@ -319,7 +319,7 @@ describe('ChartHolder', () => {
expect(computedWidth).toEqual(expectedWidth);
});
- it('should calculate the chartWidth on full screen mode', async () => {
+ test('should calculate the chartWidth on full screen mode', async () => {
const widthMultiple = 7;
const columnWidth = 250;
renderWrapper(createMockStore(), {
@@ -345,7 +345,7 @@ describe('ChartHolder', () => {
expect(computedWidth).toEqual(expectedWidth);
});
- it('should calculate the chartHeight', async () => {
+ test('should calculate the chartHeight', async () => {
const heightMultiple = 12;
renderWrapper(createMockStore(), {
fullSizeChartId: null,
@@ -372,7 +372,7 @@ describe('ChartHolder', () => {
expect(computedWidth).toEqual(expectedWidth);
});
- it('should calculate the chartHeight on full screen mode', async () => {
+ test('should calculate the chartHeight on full screen mode', async () => {
const heightMultiple = 12;
renderWrapper(createMockStore(), {
component: {
@@ -397,7 +397,7 @@ describe('ChartHolder', () => {
expect(computedWidth).toEqual(expectedWidth);
});
- it('should call deleteComponent when deleted', async () => {
+ test('should call deleteComponent when deleted', async () => {
const deleteComponent = sinon.spy();
const store = createMockStore();
const { rerender } = renderWrapper(store, {
diff --git a/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.test.jsx b/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.test.jsx
index 1cf54aab0d..387f873dae 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.test.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.test.jsx
@@ -46,19 +46,19 @@ describe('Divider', () => {
useDnd: true,
});
- it('should render a Draggable', () => {
+ test('should render a Draggable', () => {
setup();
expect(screen.getByTestId('dragdroppable-object')).toBeInTheDocument();
});
- it('should render a div with class "dashboard-component-divider"', () => {
+ test('should render a div with class "dashboard-component-divider"', () => {
const { container } = setup();
expect(
container.querySelector('.dashboard-component-divider'),
).toBeInTheDocument();
});
- it('should render a HoverMenu with DeleteComponentButton in editMode', () => {
+ test('should render a HoverMenu with DeleteComponentButton in editMode', () => {
setup();
expect(screen.queryByTestId('hover-menu')).not.toBeInTheDocument();
expect(screen.queryByRole('button')).not.toBeInTheDocument();
@@ -72,7 +72,7 @@ describe('Divider', () => {
);
});
- it('should call deleteComponent when deleted', () => {
+ test('should call deleteComponent when deleted', () => {
const deleteComponent = sinon.spy();
setup({ editMode: true, deleteComponent });
userEvent.click(screen.getByRole('button'));
diff --git a/superset-frontend/src/dashboard/components/gridComponents/Header/Header.test.jsx b/superset-frontend/src/dashboard/components/gridComponents/Header/Header.test.jsx
index 1f204406a2..05a3822778 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Header/Header.test.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Header/Header.test.jsx
@@ -57,17 +57,17 @@ describe('Header', () => {
);
}
- it('should render a Draggable', () => {
+ test('should render a Draggable', () => {
setup();
expect(screen.getByTestId('dragdroppable-object')).toBeInTheDocument();
});
- it('should render a WithPopoverMenu', () => {
+ test('should render a WithPopoverMenu', () => {
setup();
expect(screen.getByRole('none')).toBeInTheDocument();
});
- it('should render a HoverMenu in editMode', () => {
+ test('should render a HoverMenu in editMode', () => {
setup();
expect(screen.queryByTestId('hover-menu')).not.toBeInTheDocument();
@@ -76,14 +76,14 @@ describe('Header', () => {
expect(hoverMenus[0]).toBeInTheDocument();
});
- it('should render an EditableTitle with meta.text', () => {
+ test('should render an EditableTitle with meta.text', () => {
setup();
const titleElement = screen.getByTestId('editable-title');
expect(titleElement).toBeInTheDocument();
expect(titleElement).toHaveTextContent(props.component.meta.text);
});
- it('should call updateComponents when EditableTitle changes', () => {
+ test('should call updateComponents when EditableTitle changes', () => {
const updateComponents = sinon.spy();
setup({ editMode: true, updateComponents });
@@ -103,13 +103,13 @@ describe('Header', () => {
);
});
- it('should render a DeleteComponentButton when focused in editMode', () => {
+ test('should render a DeleteComponentButton when focused in editMode', () => {
setup({ editMode: true });
const trashButton = screen.getByRole('img', { name: 'delete' });
expect(trashButton).toBeInTheDocument();
});
- it('should call deleteComponent when deleted', () => {
+ test('should call deleteComponent when deleted', () => {
const deleteComponent = sinon.spy();
setup({ editMode: true, deleteComponent });
@@ -119,17 +119,17 @@ describe('Header', () => {
expect(deleteComponent.callCount).toBe(1);
});
- it('should render the AnchorLink in view mode', () => {
+ test('should render the AnchorLink in view mode', () => {
setup();
expect(screen.getByTestId('anchor-link')).toBeInTheDocument();
});
- it('should not render the AnchorLink in edit mode', () => {
+ test('should not render the AnchorLink in edit mode', () => {
setup({ editMode: true });
expect(screen.queryByTestId('anchor-link')).not.toBeInTheDocument();
});
- it('should not render the AnchorLink in embedded mode', () => {
+ test('should not render the AnchorLink in embedded mode', () => {
setup({ embeddedMode: true });
expect(screen.queryByTestId('anchor-link')).not.toBeInTheDocument();
});
diff --git a/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.jsx b/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.jsx
index c10d10b776..ed238b63fd 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.jsx
@@ -81,12 +81,12 @@ describe('Markdown', () => {
jest.clearAllMocks();
});
- it('should render the markdown component', async () => {
+ test('should render the markdown component', async () => {
await setup();
expect(screen.getByTestId('dashboard-markdown-editor')).toBeInTheDocument();
});
- it('should render the markdown content in preview mode by default', async () => {
+ test('should render the markdown content in preview mode by default', async () => {
await setup();
expect(screen.queryByRole('textbox')).not.toBeInTheDocument();
expect(
@@ -94,7 +94,7 @@ describe('Markdown', () => {
).toBeInTheDocument();
});
- it('should render editor when in edit mode and clicked', async () => {
+ test('should render editor when in edit mode and clicked', async () => {
await setup({ editMode: true });
const container = screen.getByTestId('dashboard-component-chart-holder');
await act(async () => {
@@ -104,7 +104,7 @@ describe('Markdown', () => {
expect(await screen.findByRole('textbox')).toBeInTheDocument();
});
- it('should switch between edit and preview modes', async () => {
+ test('should switch between edit and preview modes', async () => {
await setup({ editMode: true });
const container = screen.getByTestId('dashboard-component-chart-holder');
@@ -129,7 +129,7 @@ describe('Markdown', () => {
expect(screen.queryByRole('textbox')).not.toBeInTheDocument();
});
- it('should call updateComponents when switching from edit to preview with changes', async () => {
+ test('should call updateComponents when switching from edit to preview with changes', async () => {
const updateComponents = jest.fn();
const mockCode = 'new markdown!';
@@ -201,7 +201,7 @@ describe('Markdown', () => {
});
});
- it('should show placeholder text when markdown is empty', async () => {
+ test('should show placeholder text when markdown is empty', async () => {
await setup({
component: {
...mockLayout.present.MARKDOWN_ID,
@@ -214,7 +214,7 @@ describe('Markdown', () => {
).toBeInTheDocument();
});
- it('should handle markdown errors gracefully', async () => {
+ test('should handle markdown errors gracefully', async () => {
const addDangerToast = jest.fn();
const { container } = await setup({
addDangerToast,
@@ -250,7 +250,7 @@ describe('Markdown', () => {
});
});
- it('should resize editor when width changes', async () => {
+ test('should resize editor when width changes', async () => {
const { rerender } = await setup({ editMode: true });
await act(async () => {
@@ -278,7 +278,7 @@ describe('Markdown', () => {
});
});
- it('should update content when undo/redo changes occur', async () => {
+ test('should update content when undo/redo changes occur', async () => {
const { rerender } = await setup({
editMode: true,
component: {
@@ -305,7 +305,7 @@ describe('Markdown', () => {
expect(screen.getByText('updated')).toBeInTheDocument();
});
- it('should adjust width based on parent type', async () => {
+ test('should adjust width based on parent type', async () => {
const { rerender } = await setup();
// Check ROW_TYPE width
diff --git a/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.test.jsx b/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.test.jsx
index 5f8d6c9713..3ee3a7632f 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.test.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.test.jsx
@@ -45,27 +45,27 @@ describe('DraggableNewComponent', () => {
setup();
});
- it('should render a DragDroppable', () => {
+ test('should render a DragDroppable', () => {
expect(screen.getByTestId('dragdroppable-object')).toBeInTheDocument();
});
- it('should pass component={ type, id } to DragDroppable', () => {
+ test('should pass component={ type, id } to DragDroppable', () => {
const dragComponent = screen.getByTestId('dragdroppable-object');
expect(dragComponent).toHaveClass(
'dragdroppable dragdroppable--edit-mode dragdroppable-row',
);
});
- it('should pass appropriate parent source and id to DragDroppable', () => {
+ test('should pass appropriate parent source and id to DragDroppable', () => {
const dragComponent = screen.getByTestId('new-component');
expect(dragComponent).toHaveAttribute('draggable', 'true');
});
- it('should render the passed label', () => {
+ test('should render the passed label', () => {
expect(screen.getByText(props.label)).toBeInTheDocument();
});
- it('should add the passed className', () => {
+ test('should add the passed className', () => {
const component = screen
.getByTestId('new-component')
.querySelector('.new-component-placeholder');
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/ActionButtons.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/ActionButtons.test.tsx
index 1ac583ef99..788e02ddbe 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/ActionButtons.test.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/ActionButtons.test.tsx
@@ -78,7 +78,7 @@ test('should apply', () => {
});
describe('custom width', () => {
- it('sets its default width with OPEN_FILTER_BAR_WIDTH', () => {
+ test('sets its default width with OPEN_FILTER_BAR_WIDTH', () => {
const mockedProps = createProps();
render(<ActionButtons {...mockedProps} />, { useRedux: true });
const container = screen.getByTestId('filterbar-action-buttons');
@@ -87,7 +87,7 @@ describe('custom width', () => {
});
});
- it('sets custom width', () => {
+ test('sets custom width', () => {
const mockedProps = createProps();
const expectedWidth = 423;
const { getByTestId } = render(
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/FilterBar.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBar.test.tsx
index 261706c1df..8275cdf64a 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBar.test.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBar.test.tsx
@@ -178,39 +178,39 @@ describe('FilterBar', () => {
},
);
- it('should render', () => {
+ test('should render', () => {
const { container } = renderWrapper();
expect(container).toBeInTheDocument();
});
- it('should render the "Filters" heading', () => {
+ test('should render the "Filters" heading', () => {
renderWrapper();
expect(screen.getByText('Filters')).toBeInTheDocument();
});
- it('should render the "Clear all" option', () => {
+ test('should render the "Clear all" option', () => {
renderWrapper();
expect(screen.getByText('Clear all')).toBeInTheDocument();
});
- it('should render the "Apply filters" option', () => {
+ test('should render the "Apply filters" option', () => {
renderWrapper();
expect(screen.getByText('Apply filters')).toBeInTheDocument();
});
- it('should render the collapse icon', () => {
+ test('should render the collapse icon', () => {
renderWrapper();
expect(
screen.getByRole('img', { name: 'vertical-align' }),
).toBeInTheDocument();
});
- it('should render the filter icon', () => {
+ test('should render the filter icon', () => {
renderWrapper();
expect(screen.getByRole('img', { name: 'filter' })).toBeInTheDocument();
});
- it('should toggle', () => {
+ test('should toggle', () => {
renderWrapper();
const collapse = screen.getByRole('img', {
name: 'vertical-align',
@@ -220,7 +220,7 @@ describe('FilterBar', () => {
expect(toggleFiltersBar).toHaveBeenCalled();
});
- it('open filter bar', () => {
+ test('open filter bar', () => {
renderWrapper();
expect(screen.getByTestId(getTestId('filter-icon'))).toBeInTheDocument();
expect(screen.getByTestId(getTestId('expand-button'))).toBeInTheDocument();
@@ -229,7 +229,7 @@ describe('FilterBar', () => {
expect(toggleFiltersBar).toHaveBeenCalledWith(true);
});
- it('no edit filter button by disabled permissions', () => {
+ test('no edit filter button by disabled permissions', () => {
renderWrapper(openedBarProps, {
...stateWithoutNativeFilters,
dashboardInfo: { metadata: {} },
@@ -240,7 +240,7 @@ describe('FilterBar', () => {
).not.toBeInTheDocument();
});
- it('close filter bar', () => {
+ test('close filter bar', () => {
renderWrapper(openedBarProps);
const collapseButton = screen.getByTestId(getTestId('collapse-button'));
@@ -250,14 +250,14 @@ describe('FilterBar', () => {
expect(toggleFiltersBar).toHaveBeenCalledWith(false);
});
- it('no filters', () => {
+ test('no filters', () => {
renderWrapper(openedBarProps, stateWithoutNativeFilters);
expect(screen.getByTestId(getTestId('clear-button'))).toBeDisabled();
expect(screen.getByTestId(getTestId('apply-button'))).toBeDisabled();
});
- it('renders dividers', async () => {
+ test('renders dividers', async () => {
const divider = {
id: 'NATIVE_FILTER_DIVIDER-1',
type: 'DIVIDER',
@@ -295,7 +295,7 @@ describe('FilterBar', () => {
expect(screen.getByTestId(getTestId('apply-button'))).toBeDisabled();
});
- it('create filter and apply it flow', async () => {
+ test('create filter and apply it flow', async () => {
renderWrapper(openedBarProps, stateWithoutNativeFilters);
expect(screen.getByTestId(getTestId('apply-button'))).toBeDisabled();
@@ -304,7 +304,7 @@ describe('FilterBar', () => {
expect(screen.getByTestId(getTestId('apply-button'))).toBeDisabled();
});
- it('should render without errors with proper state setup', () => {
+ test('should render without errors with proper state setup', () => {
const stateWithFilter = {
...stateWithoutNativeFilters,
dashboardInfo: {
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/CollapsibleControl.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/CollapsibleControl.test.tsx
index ef15caafca..9dc42c3980 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/CollapsibleControl.test.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/CollapsibleControl.test.tsx
@@ -30,14 +30,14 @@ const renderCollapsibleControl = (props = {}) =>
render(<CollapsibleControl {...defaultProps} {...props} />);
describe('CollapsibleControl', () => {
- it('renders title correctly', () => {
+ test('renders title correctly', () => {
const { getByRole } = renderCollapsibleControl();
expect(
getByRole('checkbox', { name: /test control/i }),
).toBeInTheDocument();
});
- it('renders tooltip when provided', () => {
+ test('renders tooltip when provided', () => {
const tooltipText = 'Test tooltip';
renderCollapsibleControl({ tooltip: tooltipText });
@@ -45,18 +45,18 @@ describe('CollapsibleControl', () => {
expect(tooltip).toBeInTheDocument();
});
- it('starts collapsed when initialValue is false', () => {
+ test('starts collapsed when initialValue is false', () => {
renderCollapsibleControl({ initialValue: false });
expect(screen.queryByTestId('child-content')).not.toBeInTheDocument();
});
- it('starts expanded when initialValue is true', () => {
+ test('starts expanded when initialValue is true', () => {
renderCollapsibleControl({ initialValue: true });
expect(screen.getByTestId('child-content')).toBeInTheDocument();
});
- it('toggles content when clicked', async () => {
+ test('toggles content when clicked', async () => {
renderCollapsibleControl();
const checkbox = screen.getByRole('checkbox', { name: /Test Control/i });
@@ -69,7 +69,7 @@ describe('CollapsibleControl', () => {
expect(screen.queryByTestId('child-content')).not.toBeInTheDocument();
});
- it('calls onChange handler when toggled', async () => {
+ test('calls onChange handler when toggled', async () => {
const onChangeMock = jest.fn();
renderCollapsibleControl({ onChange: onChangeMock });
const checkbox = screen.getByRole('checkbox', { name: /Test Control/i });
@@ -81,7 +81,7 @@ describe('CollapsibleControl', () => {
expect(onChangeMock).toHaveBeenCalledWith(false);
});
- it('respects disabled prop', async () => {
+ test('respects disabled prop', async () => {
const onChangeMock = jest.fn();
renderCollapsibleControl({
disabled: true,
@@ -95,7 +95,7 @@ describe('CollapsibleControl', () => {
expect(onChangeMock).not.toHaveBeenCalled();
});
- it('updates when controlled checked prop changes', () => {
+ test('updates when controlled checked prop changes', () => {
const { rerender } = renderCollapsibleControl({ checked: false });
expect(screen.queryByTestId('child-content')).not.toBeInTheDocument();
@@ -103,7 +103,7 @@ describe('CollapsibleControl', () => {
expect(screen.getByTestId('child-content')).toBeInTheDocument();
});
- it('maintains local state when in uncontrolled mode', async () => {
+ test('maintains local state when in uncontrolled mode', async () => {
renderCollapsibleControl({ initialValue: false });
const checkbox = screen.getByRole('checkbox', { name: /Test Control/i });
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/__tests__/TreeInitialization.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/__tests__/TreeInitialization.test.tsx
index 1fc26df265..07f2c951dd 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/__tests__/TreeInitialization.test.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/__tests__/TreeInitialization.test.tsx
@@ -40,7 +40,7 @@ describe('FilterScope TreeInitialization', () => {
jest.useRealTimers();
});
- it('correct init tree with values', async () => {
+ test('correct init tree with values', async () => {
const { MockModalComponent } = createMockModal({
scope: {
rootPath: ['TAB_ID'],
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/__tests__/TreeSelection.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/__tests__/TreeSelection.test.tsx
index 842761eb60..3785186bfb 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/__tests__/TreeSelection.test.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/__tests__/TreeSelection.test.tsx
@@ -40,7 +40,7 @@ describe('FilterScope TreeSelection', () => {
jest.useRealTimers();
});
- it('select tree values with 1 excluded', async () => {
+ test('select tree values with 1 excluded', async () => {
const { MockModalComponent } = createMockModal({ formRef });
const modal = render(<MockModalComponent />);
@@ -81,7 +81,7 @@ describe('FilterScope TreeSelection', () => {
modal.unmount();
});
- it('select 1 value only', async () => {
+ test('select 1 value only', async () => {
const { MockModalComponent } = createMockModal({ formRef });
const modal = render(<MockModalComponent />);
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/utils.test.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/utils.test.ts
index c5133ec11f..dcdcc0ed4e 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/utils.test.ts
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/utils.test.ts
@@ -18047,7 +18047,7 @@ describe('Ensure buildTree does not throw runtime errors when encountering an in
];
const initiallyExcludedCharts: number[] = [];
- it('Succeeds with valid', () => {
+ test('Succeeds with valid', () => {
expect(() => {
buildTree(
// @ts-ignore
@@ -18062,7 +18062,7 @@ describe('Ensure buildTree does not throw runtime errors when encountering an in
}).not.toThrow();
});
- it('Avoids runtime error with invalid inputs', () => {
+ test('Avoids runtime error with invalid inputs', () => {
expect(() => {
buildTree(
// @ts-expect-error
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/selectors.test.ts b/superset-frontend/src/dashboard/components/nativeFilters/selectors.test.ts
index fd51c1468d..8ab54cbc9e 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/selectors.test.ts
+++ b/superset-frontend/src/dashboard/components/nativeFilters/selectors.test.ts
@@ -37,7 +37,7 @@ describe('getCrossFilterIndicator', () => {
},
];
- it('returns correct indicator with label from filterState.label', () => {
+ test('returns correct indicator with label from filterState.label', () => {
const dataMask = {
filterState: { label: 'foo', value: 'bar' },
extraFormData: {},
@@ -51,7 +51,7 @@ describe('getCrossFilterIndicator', () => {
});
});
- it('returns correct indicator with label from filterState.value', () => {
+ test('returns correct indicator with label from filterState.value', () => {
const dataMask = {
filterState: { value: ['bar', 'baz'] },
extraFormData: {},
@@ -65,7 +65,7 @@ describe('getCrossFilterIndicator', () => {
});
});
- it('returns correct indicator with column and customColumnLabel', () => {
+ test('returns correct indicator with column and customColumnLabel', () => {
const dataMask = {
filterState: {
value: 'valA',
@@ -84,7 +84,7 @@ describe('getCrossFilterIndicator', () => {
});
});
- it('returns correct indicator with column from extraFormData.filters', () => {
+ test('returns correct indicator with column from extraFormData.filters', () => {
const filterClause = { col: 'colB', op: 'IS NOT NULL' as const };
const dataMask = {
filterState: { value: 'valB' },
@@ -99,7 +99,7 @@ describe('getCrossFilterIndicator', () => {
});
});
- it('returns correct indicator with column from filterState.filters', () => {
+ test('returns correct indicator with column from filterState.filters', () => {
const dataMask = {
filterState: { value: 'valC', filters: { colC: 'something' } },
extraFormData: {},
@@ -113,7 +113,7 @@ describe('getCrossFilterIndicator', () => {
});
});
- it('returns empty name and path if chartLayoutItem is not found', () => {
+ test('returns empty name and path if chartLayoutItem is not found', () => {
const dataMask = {
filterState: { value: 'valD' },
extraFormData: {},
@@ -127,7 +127,7 @@ describe('getCrossFilterIndicator', () => {
});
});
- it('returns null value if no label or value in filterState', () => {
+ test('returns null value if no label or value in filterState', () => {
const dataMask = {
filterState: {},
extraFormData: {},
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/state.test.ts b/superset-frontend/src/dashboard/components/nativeFilters/state.test.ts
index 7cd694b4ca..4e4fab20f0 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/state.test.ts
+++ b/superset-frontend/src/dashboard/components/nativeFilters/state.test.ts
@@ -40,7 +40,7 @@ beforeEach(() => {
});
describe('useIsFilterInScope', () => {
- it('should return true for dividers (always in scope)', () => {
+ test('should return true for dividers (always in scope)', () => {
const divider: Divider = {
id: 'divider_1',
type: NativeFilterType.Divider,
@@ -52,7 +52,7 @@ describe('useIsFilterInScope', () => {
expect(result.current(divider)).toBe(true);
});
- it('should return true for filters with charts in active tabs', () => {
+ test('should return true for filters with charts in active tabs', () => {
const filter: Filter = {
id: 'filter_1',
name: 'Test Filter',
@@ -71,7 +71,7 @@ describe('useIsFilterInScope', () => {
expect(result.current(filter)).toBe(true);
});
- it('should return false for filters with inactive rootPath', () => {
+ test('should return false for filters with inactive rootPath', () => {
const filter: Filter = {
id: 'filter_3',
name: 'Test Filter 3',
@@ -91,7 +91,7 @@ describe('useIsFilterInScope', () => {
});
describe('useSelectFiltersInScope', () => {
- it('should return all filters in scope when no tabs exist', () => {
+ test('should return all filters in scope when no tabs exist', () => {
const filters: Filter[] = [
{
id: 'filter_1',
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts b/superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts
index 17abcf993a..a7964a5fe6 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts
+++ b/superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts
@@ -22,21 +22,21 @@ import { CHART_TYPE } from 'src/dashboard/util/componentTypes';
import { nativeFilterGate, findTabsWithChartsInScope } from './utils';
describe('nativeFilterGate', () => {
- it('should return true for regular chart', () => {
+ test('should return true for regular chart', () => {
expect(nativeFilterGate([])).toEqual(true);
});
- it('should return true for cross filter chart', () => {
+ test('should return true for cross filter chart', () => {
expect(nativeFilterGate([Behavior.InteractiveChart])).toEqual(true);
});
- it('should return true for native filter chart with cross filter support', () => {
+ test('should return true for native filter chart with cross filter support', () => {
expect(
nativeFilterGate([Behavior.NativeFilter, Behavior.InteractiveChart]),
).toEqual(true);
});
- it('should return false for native filter behavior', () => {
+ test('should return false for native filter behavior', () => {
expect(nativeFilterGate([Behavior.NativeFilter])).toEqual(false);
});
});
diff --git a/superset-frontend/src/dashboard/components/resizable/ResizableContainer.test.tsx b/superset-frontend/src/dashboard/components/resizable/ResizableContainer.test.tsx
index 37f9d07206..fa53d1df40 100644
--- a/superset-frontend/src/dashboard/components/resizable/ResizableContainer.test.tsx
+++ b/superset-frontend/src/dashboard/components/resizable/ResizableContainer.test.tsx
@@ -34,7 +34,7 @@ describe('ResizableContainer', () => {
<ResizableContainer {...props} {...overrides} />
);
- it('should render a Resizable container', () => {
+ test('should render a Resizable container', () => {
const rendered = render(setup());
const resizableContainer = rendered.container.querySelector(
'.resizable-container',
diff --git a/superset-frontend/src/dashboard/components/resizable/ResizableHandle.test.tsx b/superset-frontend/src/dashboard/components/resizable/ResizableHandle.test.tsx
index 764f4a8b92..12b996d404 100644
--- a/superset-frontend/src/dashboard/components/resizable/ResizableHandle.test.tsx
+++ b/superset-frontend/src/dashboard/components/resizable/ResizableHandle.test.tsx
@@ -22,21 +22,21 @@ import ResizableHandle from 'src/dashboard/components/resizable/ResizableHandle'
/* eslint-disable react/jsx-pascal-case */
describe('ResizableHandle', () => {
- it('should render a right resize handle', () => {
+ test('should render a right resize handle', () => {
const rendered = render(<ResizableHandle.right />);
expect(
rendered.container.querySelector('.resize-handle.resize-handle--right'),
).toBeVisible();
});
- it('should render a bottom resize handle', () => {
+ test('should render a bottom resize handle', () => {
const rendered = render(<ResizableHandle.bottom />);
expect(
rendered.container.querySelector('.resize-handle.resize-handle--bottom'),
).toBeVisible();
});
- it('should render a bottomRight resize handle', () => {
+ test('should render a bottomRight resize handle', () => {
const rendered = render(<ResizableHandle.bottomRight />);
expect(
rendered.container.querySelector(
diff --git a/superset-frontend/src/dashboard/reducers/dashboardFilters.test.js b/superset-frontend/src/dashboard/reducers/dashboardFilters.test.js
index a13db364cf..935dd7ceca 100644
--- a/superset-frontend/src/dashboard/reducers/dashboardFilters.test.js
+++ b/superset-frontend/src/dashboard/reducers/dashboardFilters.test.js
@@ -39,7 +39,7 @@ describe('dashboardFilters reducer', () => {
const directPathToFilter = (component.parents || []).slice();
directPathToFilter.push(component.id);
- it('should overwrite a filter if merge is false', () => {
+ test('should overwrite a filter if merge is false', () => {
expect(
dashboardFiltersReducer(dashboardFilters, {
type: CHANGE_FILTER,
@@ -72,7 +72,7 @@ describe('dashboardFilters reducer', () => {
});
});
- it('should merge a filter if merge is true', () => {
+ test('should merge a filter if merge is true', () => {
expect(
dashboardFiltersReducer(dashboardFilters, {
type: CHANGE_FILTER,
@@ -105,7 +105,7 @@ describe('dashboardFilters reducer', () => {
});
});
- it('should buildActiveFilters on UPDATE_DASHBOARD_FILTERS_SCOPE', () => {
+ test('should buildActiveFilters on UPDATE_DASHBOARD_FILTERS_SCOPE', () => {
const regionScope = {
scope: ['TAB-1'],
immune: [],
diff --git a/superset-frontend/src/dashboard/reducers/dashboardLayout.test.js b/superset-frontend/src/dashboard/reducers/dashboardLayout.test.js
index f0f4d8b1bc..e8ff5673d4 100644
--- a/superset-frontend/src/dashboard/reducers/dashboardLayout.test.js
+++ b/superset-frontend/src/dashboard/reducers/dashboardLayout.test.js
@@ -47,11 +47,11 @@ import {
} from 'src/dashboard/util/constants';
describe('dashboardLayout reducer', () => {
- it('should return initial state for unrecognized actions', () => {
+ test('should return initial state for unrecognized actions', () => {
expect(layoutReducer(undefined, {})).toEqual({});
});
- it('should delete a component, remove its reference in its parent, and recursively all of its children', () => {
+ test('should delete a component, remove its reference in its parent, and recursively all of its children', () => {
expect(
layoutReducer(
{
@@ -87,7 +87,7 @@ describe('dashboardLayout reducer', () => {
});
});
- it('should delete a parent if the parent was a row and no longer has children', () => {
+ test('should delete a parent if the parent was a row and no longer has children', () => {
expect(
layoutReducer(
{
@@ -122,7 +122,7 @@ describe('dashboardLayout reducer', () => {
});
});
- it('should update components', () => {
+ test('should update components', () => {
expect(
layoutReducer(
{
@@ -173,7 +173,7 @@ describe('dashboardLayout reducer', () => {
});
});
- it('should move a component', () => {
+ test('should move a component', () => {
const layout = {
source: {
id: 'source',
@@ -222,7 +222,7 @@ describe('dashboardLayout reducer', () => {
});
});
- it('should wrap a moved component in a row if need be', () => {
+ test('should wrap a moved component in a row if need be', () => {
const layout = {
source: {
id: 'source',
@@ -262,7 +262,7 @@ describe('dashboardLayout reducer', () => {
expect(Object.keys(result)).toHaveLength(4);
});
- it('should add top-level tabs from a new tabs component, moving grid children to new tab', () => {
+ test('should add top-level tabs from a new tabs component, moving grid children to new tab', () => {
const layout = {
[DASHBOARD_ROOT_ID]: {
id: DASHBOARD_ROOT_ID,
@@ -308,7 +308,7 @@ describe('dashboardLayout reducer', () => {
expect(result[DASHBOARD_GRID_ID].children).toHaveLength(0);
});
- it('should add top-level tabs from an existing tabs component, moving grid children to new tab', () => {
+ test('should add top-level tabs from an existing tabs component, moving grid children to new tab', () => {
const layout = {
[DASHBOARD_ROOT_ID]: {
id: DASHBOARD_ROOT_ID,
@@ -360,7 +360,7 @@ describe('dashboardLayout reducer', () => {
expect(result[DASHBOARD_GRID_ID].children).toHaveLength(0);
});
- it('should remove top-level tabs, moving children to the grid', () => {
+ test('should remove top-level tabs, moving children to the grid', () => {
const layout = {
[DASHBOARD_ROOT_ID]: {
id: DASHBOARD_ROOT_ID,
@@ -425,7 +425,7 @@ describe('dashboardLayout reducer', () => {
});
});
- it('should create a component', () => {
+ test('should create a component', () => {
const layout = {
[DASHBOARD_ROOT_ID]: {
id: DASHBOARD_ROOT_ID,
@@ -458,7 +458,7 @@ describe('dashboardLayout reducer', () => {
expect(result[newId].type).toBe(ROW_TYPE);
});
- it('recursivelyDeleteChildren should be error proof with bad inputs', () => {
+ test('recursivelyDeleteChildren should be error proof with bad inputs', () => {
/*
** The recursivelyDeleteChildren function was missing runtime safety checks before operating
** on sub properties of object causing runtime errors when a componentId lookup returned and unexpected value
diff --git a/superset-frontend/src/dashboard/reducers/dashboardState.test.js b/superset-frontend/src/dashboard/reducers/dashboardState.test.js
index 803e159657..b3903bc4fd 100644
--- a/superset-frontend/src/dashboard/reducers/dashboardState.test.js
+++ b/superset-frontend/src/dashboard/reducers/dashboardState.test.js
@@ -34,11 +34,11 @@ import {
import dashboardStateReducer from 'src/dashboard/reducers/dashboardState';
describe('dashboardState reducer', () => {
- it('should return initial state', () => {
+ test('should return initial state', () => {
expect(dashboardStateReducer(undefined, {})).toEqual({});
});
- it('should add a slice', () => {
+ test('should add a slice', () => {
expect(
dashboardStateReducer(
{ sliceIds: [1] },
@@ -47,7 +47,7 @@ describe('dashboardState reducer', () => {
).toEqual({ sliceIds: [1, 2] });
});
- it('should remove a slice', () => {
+ test('should remove a slice', () => {
expect(
dashboardStateReducer(
{ sliceIds: [1, 2], filters: {} },
@@ -56,7 +56,7 @@ describe('dashboardState reducer', () => {
).toEqual({ sliceIds: [1], filters: {} });
});
- it('should toggle fav star', () => {
+ test('should toggle fav star', () => {
expect(
dashboardStateReducer(
{ isStarred: false },
@@ -65,7 +65,7 @@ describe('dashboardState reducer', () => {
).toEqual({ isStarred: true });
});
- it('should toggle edit mode', () => {
+ test('should toggle edit mode', () => {
expect(
dashboardStateReducer(
{ editMode: false },
@@ -76,7 +76,7 @@ describe('dashboardState reducer', () => {
});
});
- it('should toggle expanded slices', () => {
+ test('should toggle expanded slices', () => {
expect(
dashboardStateReducer(
{ expandedSlices: { 1: true, 2: false } },
@@ -92,7 +92,7 @@ describe('dashboardState reducer', () => {
).toEqual({ expandedSlices: { 1: true, 2: true } });
});
- it('should set hasUnsavedChanges', () => {
+ test('should set hasUnsavedChanges', () => {
expect(dashboardStateReducer({}, { type: ON_CHANGE })).toEqual({
hasUnsavedChanges: true,
});
@@ -107,7 +107,7 @@ describe('dashboardState reducer', () => {
});
});
- it('should set maxUndoHistoryExceeded', () => {
+ test('should set maxUndoHistoryExceeded', () => {
expect(
dashboardStateReducer(
{},
@@ -121,7 +121,7 @@ describe('dashboardState reducer', () => {
});
});
- it('should set unsaved changes, max undo history, and editMode to false on save', () => {
+ test('should set unsaved changes, max undo history, and editMode to false on save', () => {
const result = dashboardStateReducer(
{ hasUnsavedChanges: true },
{ type: ON_SAVE },
@@ -132,7 +132,7 @@ describe('dashboardState reducer', () => {
expect(result.updatedColorScheme).toBe(false);
});
- it('should reset lastModifiedTime on save', () => {
+ test('should reset lastModifiedTime on save', () => {
const initTime = new Date().getTime() / 1000;
dashboardStateReducer(
{
@@ -150,7 +150,7 @@ describe('dashboardState reducer', () => {
).toBeGreaterThanOrEqual(initTime);
});
- it('should clear the focused filter field', () => {
+ test('should clear the focused filter field', () => {
const initState = {
focusedFilterField: {
chartId: 1,
@@ -167,7 +167,7 @@ describe('dashboardState reducer', () => {
expect(cleared.focusedFilterField).toBeNull();
});
- it('should only clear focused filter when the fields match', () => {
+ test('should only clear focused filter when the fields match', () => {
// dashboard only has 1 focused filter field at a time,
// but when user switch different filter boxes,
// browser didn't always fire onBlur and onFocus events in order.
@@ -199,7 +199,7 @@ describe('dashboardState reducer', () => {
});
});
- it('should toggle native filters bar', () => {
+ test('should toggle native filters bar', () => {
expect(
dashboardStateReducer(
{ nativeFiltersBarOpen: false },
diff --git a/superset-frontend/src/dashboard/reducers/dashboardState.test.ts b/superset-frontend/src/dashboard/reducers/dashboardState.test.ts
index 1594c1b2a6..5d7bc7efb1 100644
--- a/superset-frontend/src/dashboard/reducers/dashboardState.test.ts
+++ b/superset-frontend/src/dashboard/reducers/dashboardState.test.ts
@@ -55,7 +55,7 @@ const createMockDashboardState = (
describe('DashboardState reducer', () => {
describe('SET_ACTIVE_TAB', () => {
- it('switches a single tab', () => {
+ test('switches a single tab', () => {
const store = mockStore({
dashboardState: { activeTabs: [] },
dashboardLayout: { present: { tab1: { parents: [] } } },
@@ -87,7 +87,7 @@ describe('DashboardState reducer', () => {
);
});
- it('switches a multi-depth tab', () => {
+ test('switches a multi-depth tab', () => {
const initState = { activeTabs: ['TAB-1', 'TAB-A', 'TAB-__a'] };
const store = mockStore({
dashboardState: initState,
@@ -176,7 +176,7 @@ describe('DashboardState reducer', () => {
);
});
});
- it('SET_ACTIVE_TABS', () => {
+ test('SET_ACTIVE_TABS', () => {
expect(
typedDashboardStateReducer(
createMockDashboardState({ activeTabs: [] }),
diff --git a/superset-frontend/src/dashboard/reducers/sliceEntities.test.js b/superset-frontend/src/dashboard/reducers/sliceEntities.test.js
index 444535d276..1739d23fb8 100644
--- a/superset-frontend/src/dashboard/reducers/sliceEntities.test.js
+++ b/superset-frontend/src/dashboard/reducers/sliceEntities.test.js
@@ -25,11 +25,11 @@ import {
import sliceEntitiesReducer from 'src/dashboard/reducers/sliceEntities';
describe('sliceEntities reducer', () => {
- it('should return initial state', () => {
+ test('should return initial state', () => {
expect(sliceEntitiesReducer({}, {})).toEqual({});
});
- it('should set loading when fetching slices', () => {
+ test('should set loading when fetching slices', () => {
expect(
sliceEntitiesReducer(
{ isLoading: false },
@@ -38,7 +38,7 @@ describe('sliceEntities reducer', () => {
).toBe(true);
});
- it('should set slices', () => {
+ test('should set slices', () => {
const result = sliceEntitiesReducer(
{ slices: { a: {} } },
{ type: ADD_SLICES, payload: { slices: { 1: {}, 2: {} } } },
@@ -52,7 +52,7 @@ describe('sliceEntities reducer', () => {
expect(result.isLoading).toBe(false);
});
- it('should set an error on error', () => {
+ test('should set an error on error', () => {
const result = sliceEntitiesReducer(
{},
{
diff --git a/superset-frontend/src/dashboard/util/componentIsResizable.test.ts b/superset-frontend/src/dashboard/util/componentIsResizable.test.ts
index 81633aeddf..4258fd6ab3 100644
--- a/superset-frontend/src/dashboard/util/componentIsResizable.test.ts
+++ b/superset-frontend/src/dashboard/util/componentIsResizable.test.ts
@@ -44,13 +44,13 @@ const resizable = [COLUMN_TYPE, CHART_TYPE, MARKDOWN_TYPE];
describe('componentIsResizable', () => {
resizable.forEach(type => {
- it(`should return true for ${type}`, () => {
+ test(`should return true for ${type}`, () => {
expect(componentIsResizable({ type })).toBe(true);
});
});
notResizable.forEach(type => {
- it(`should return false for ${type}`, () => {
+ test(`should return false for ${type}`, () => {
expect(componentIsResizable({ type })).toBe(false);
});
});
diff --git a/superset-frontend/src/dashboard/util/dnd-reorder.test.js b/superset-frontend/src/dashboard/util/dnd-reorder.test.js
index c78cd7a374..6743f6c27b 100644
--- a/superset-frontend/src/dashboard/util/dnd-reorder.test.js
+++ b/superset-frontend/src/dashboard/util/dnd-reorder.test.js
@@ -21,7 +21,7 @@ import { TABS_TYPE } from './componentTypes';
import { DROP_LEFT, DROP_RIGHT } from './getDropPosition';
describe('dnd-reorderItem', () => {
- it('should remove the item from its source entity and add it to its destination entity', () => {
+ test('should remove the item from its source entity and add it to its destination entity', () => {
const result = reorderItem({
entitiesMap: {
a: {
@@ -41,7 +41,7 @@ describe('dnd-reorderItem', () => {
expect(result.b.children).toEqual(['banana', 'z']);
});
- it('should correctly move elements within the same list', () => {
+ test('should correctly move elements within the same list', () => {
const result = reorderItem({
entitiesMap: {
a: {
@@ -56,7 +56,7 @@ describe('dnd-reorderItem', () => {
expect(result.a.children).toEqual(['z', 'x', 'y']);
});
- it('should copy items that do not move into the result', () => {
+ test('should copy items that do not move into the result', () => {
const extraEntity = {};
const result = reorderItem({
entitiesMap: {
@@ -77,7 +77,7 @@ describe('dnd-reorderItem', () => {
expect(result.iAmExtra).toBe(extraEntity);
});
- it('should handle out of bounds destination index gracefully', () => {
+ test('should handle out of bounds destination index gracefully', () => {
const result = reorderItem({
entitiesMap: {
a: {
@@ -97,7 +97,7 @@ describe('dnd-reorderItem', () => {
expect(result.b.children).toEqual(['banana', 'y']);
});
- it('should do nothing if source and destination are the same and indices are the same', () => {
+ test('should do nothing if source and destination are the same and indices are the same', () => {
const result = reorderItem({
entitiesMap: {
a: {
@@ -112,7 +112,7 @@ describe('dnd-reorderItem', () => {
expect(result.a.children).toEqual(['x', 'y', 'z']);
});
- it('should handle DROP_LEFT in the same TABS_TYPE list correctly', () => {
+ test('should handle DROP_LEFT in the same TABS_TYPE list correctly', () => {
const result = reorderItem({
entitiesMap: {
a: {
@@ -129,7 +129,7 @@ describe('dnd-reorderItem', () => {
expect(result.a.children).toEqual(['x', 'z', 'y']);
});
- it('should handle DROP_RIGHT in the same TABS_TYPE list correctly', () => {
+ test('should handle DROP_RIGHT in the same TABS_TYPE list correctly', () => {
const result = reorderItem({
entitiesMap: {
a: {
@@ -146,7 +146,7 @@ describe('dnd-reorderItem', () => {
expect(result.a.children).toEqual(['y', 'x', 'z']);
});
- it('should handle DROP_LEFT when moving between different TABS_TYPE lists', () => {
+ test('should handle DROP_LEFT when moving between different TABS_TYPE lists', () => {
const result = reorderItem({
entitiesMap: {
a: {
@@ -169,7 +169,7 @@ describe('dnd-reorderItem', () => {
expect(result.b.children).toEqual(['y', 'banana']);
});
- it('should handle DROP_RIGHT when moving between different TABS_TYPE lists', () => {
+ test('should handle DROP_RIGHT when moving between different TABS_TYPE lists', () => {
const result = reorderItem({
entitiesMap: {
a: {
diff --git a/superset-frontend/src/dashboard/util/dropOverflowsParent.test.ts b/superset-frontend/src/dashboard/util/dropOverflowsParent.test.ts
index 32528daca2..6fc922e3eb 100644
--- a/superset-frontend/src/dashboard/util/dropOverflowsParent.test.ts
+++ b/superset-frontend/src/dashboard/util/dropOverflowsParent.test.ts
@@ -30,7 +30,7 @@ import {
} from 'src/dashboard/util/componentTypes';
describe('dropOverflowsParent', () => {
- it('returns true if a parent does NOT have adequate width for child', () => {
+ test('returns true if a parent does NOT have adequate width for child', () => {
const dropResult: DropResult = {
source: { id: '_' },
destination: { id: 'a' },
@@ -62,7 +62,7 @@ describe('dropOverflowsParent', () => {
expect(dropOverflowsParent(dropResult, layout as any)).toBe(true);
});
- it('returns false if a parent DOES have adequate width for child', () => {
+ test('returns false if a parent DOES have adequate width for child', () => {
const dropResult: DropResult = {
source: { id: '_' },
destination: { id: 'a' },
@@ -94,7 +94,7 @@ describe('dropOverflowsParent', () => {
expect(dropOverflowsParent(dropResult, layout as any)).toBe(false);
});
- it('returns false if a child CAN shrink to available parent space', () => {
+ test('returns false if a child CAN shrink to available parent space', () => {
const dropResult: DropResult = {
source: { id: '_' },
destination: { id: 'a' },
@@ -126,7 +126,7 @@ describe('dropOverflowsParent', () => {
expect(dropOverflowsParent(dropResult, layout as any)).toBe(false);
});
- it('returns true if a child CANNOT shrink to available parent space', () => {
+ test('returns true if a child CANNOT shrink to available parent space', () => {
const dropResult: DropResult = {
source: { id: '_' },
destination: { id: 'a' },
@@ -159,7 +159,7 @@ describe('dropOverflowsParent', () => {
expect(dropOverflowsParent(dropResult, layout as any)).toBe(true);
});
- it('returns true if a column has children that CANNOT shrink to available parent space', () => {
+ test('returns true if a column has children that CANNOT shrink to available parent space', () => {
const dropResult: DropResult = {
source: { id: '_' },
destination: { id: 'destination' },
@@ -204,7 +204,7 @@ describe('dropOverflowsParent', () => {
).toBe(false);
});
- it('should work with new components that are not in the layout', () => {
+ test('should work with new components that are not in the layout', () => {
const dropResult: DropResult = {
source: { id: NEW_COMPONENTS_SOURCE_ID },
destination: { id: 'a' },
@@ -222,7 +222,7 @@ describe('dropOverflowsParent', () => {
expect(dropOverflowsParent(dropResult, layout as any)).toBe(false);
});
- it('source/destination without widths should not overflow parent', () => {
+ test('source/destination without widths should not overflow parent', () => {
const dropResult: DropResult = {
source: { id: '_' },
destination: { id: 'tab' },
diff --git a/superset-frontend/src/dashboard/util/extractUrlParams.test.ts b/superset-frontend/src/dashboard/util/extractUrlParams.test.ts
index dd81c10d59..96fe878e95 100644
--- a/superset-frontend/src/dashboard/util/extractUrlParams.test.ts
+++ b/superset-frontend/src/dashboard/util/extractUrlParams.test.ts
@@ -32,20 +32,20 @@ describe('extractUrlParams', () => {
window.location = originalWindowLocation;
});
- it('returns all urlParams', () => {
+ test('returns all urlParams', () => {
expect(extractUrlParams('all')).toEqual({
edit: 'true',
abc: '123',
});
});
- it('returns reserved urlParams', () => {
+ test('returns reserved urlParams', () => {
expect(extractUrlParams('reserved')).toEqual({
edit: 'true',
});
});
- it('returns regular urlParams', () => {
+ test('returns regular urlParams', () => {
expect(extractUrlParams('regular')).toEqual({
abc: '123',
});
diff --git a/superset-frontend/src/dashboard/util/findFirstParentContainer.test.js b/superset-frontend/src/dashboard/util/findFirstParentContainer.test.js
index a74a50b46f..39ce021f46 100644
--- a/superset-frontend/src/dashboard/util/findFirstParentContainer.test.js
+++ b/superset-frontend/src/dashboard/util/findFirstParentContainer.test.js
@@ -114,11 +114,11 @@ describe('findFirstParentContainer', () => {
DASHBOARD_VERSION_KEY: 'v2',
};
- it('should return grid root', () => {
+ test('should return grid root', () => {
expect(findFirstParentContainerId(mockGridLayout)).toBe(DASHBOARD_GRID_ID);
});
- it('should return first tab', () => {
+ test('should return first tab', () => {
const tabsId = mockTabsLayout[DASHBOARD_ROOT_ID].children[0];
const firstTabId = mockTabsLayout[tabsId].children[0];
expect(findFirstParentContainerId(mockTabsLayout)).toBe(firstTabId);
diff --git a/superset-frontend/src/dashboard/util/findParentId.test.ts b/superset-frontend/src/dashboard/util/findParentId.test.ts
index b5fe36c59d..6e303f14ab 100644
--- a/superset-frontend/src/dashboard/util/findParentId.test.ts
+++ b/superset-frontend/src/dashboard/util/findParentId.test.ts
@@ -33,16 +33,16 @@ describe('findParentId', () => {
children: [],
},
};
- it('should return the correct parentId', () => {
+ test('should return the correct parentId', () => {
expect(findParentId({ childId: 'b', layout })).toBe('a');
expect(findParentId({ childId: 'z', layout })).toBe('b');
});
- it('should return null if the parent cannot be found', () => {
+ test('should return null if the parent cannot be found', () => {
expect(findParentId({ childId: 'a', layout })).toBeNull();
});
- it('should not throw error and return null with bad / missing inputs', () => {
+ test('should not throw error and return null with bad / missing inputs', () => {
// @ts-ignore
expect(findParentId(null)).toBeNull();
// @ts-ignore
diff --git a/superset-frontend/src/dashboard/util/findTabIndexByComponentId.test.ts b/superset-frontend/src/dashboard/util/findTabIndexByComponentId.test.ts
index 92abdb9ff5..31314cd40d 100644
--- a/superset-frontend/src/dashboard/util/findTabIndexByComponentId.test.ts
+++ b/superset-frontend/src/dashboard/util/findTabIndexByComponentId.test.ts
@@ -50,7 +50,7 @@ describe('findTabIndexByComponentId', () => {
];
const badPath = ['ROOT_ID', 'TABS-MNQQSW-kyd', 'TAB-ABC', 'TABS-Oduxop1L7I'];
- it('should return -1 if no directPathToChild', () => {
+ test('should return -1 if no directPathToChild', () => {
expect(
findTabIndexByComponentId({
currentComponent: topLevelTabsComponent,
@@ -59,7 +59,7 @@ describe('findTabIndexByComponentId', () => {
).toBe(-1);
});
- it('should return -1 if not found tab id', () => {
+ test('should return -1 if not found tab id', () => {
expect(
findTabIndexByComponentId({
currentComponent: topLevelTabsComponent,
@@ -68,7 +68,7 @@ describe('findTabIndexByComponentId', () => {
).toBe(-1);
});
- it('should return children index if matched an id in the path', () => {
+ test('should return children index if matched an id in the path', () => {
expect(
findTabIndexByComponentId({
currentComponent: topLevelTabsComponent,
diff --git a/superset-frontend/src/dashboard/util/getChartAndLabelComponentIdFromPath.test.js b/superset-frontend/src/dashboard/util/getChartAndLabelComponentIdFromPath.test.js
index 427e6895d7..1f22683826 100644
--- a/superset-frontend/src/dashboard/util/getChartAndLabelComponentIdFromPath.test.js
+++ b/superset-frontend/src/dashboard/util/getChartAndLabelComponentIdFromPath.test.js
@@ -19,7 +19,7 @@
import getChartAndLabelComponentIdFromPath from 'src/dashboard/util/getChartAndLabelComponentIdFromPath';
describe('getChartAndLabelComponentIdFromPath', () => {
- it('should return label and component id', () => {
+ test('should return label and component id', () => {
const directPathToChild = [
'ROOT_ID',
'TABS-aX1uNK-ryo',
diff --git a/superset-frontend/src/dashboard/util/getChartIdsFromLayout.test.ts b/superset-frontend/src/dashboard/util/getChartIdsFromLayout.test.ts
index f90e335252..f693f2be93 100644
--- a/superset-frontend/src/dashboard/util/getChartIdsFromLayout.test.ts
+++ b/superset-frontend/src/dashboard/util/getChartIdsFromLayout.test.ts
@@ -57,14 +57,14 @@ describe('getChartIdsFromLayout', () => {
},
};
- it('should return an array of chartIds', () => {
+ test('should return an array of chartIds', () => {
const result = getChartIdsFromLayout(mockLayout);
expect(Array.isArray(result)).toBe(true);
expect(result.includes(123)).toBe(true);
expect(result.includes(456)).toBe(true);
});
- it('should return ids only from CHART_TYPE components', () => {
+ test('should return ids only from CHART_TYPE components', () => {
const result = getChartIdsFromLayout(mockLayout);
expect(result).toHaveLength(2);
expect(result.includes(789)).toBe(false);
diff --git a/superset-frontend/src/dashboard/util/getDashboardUrl.test.js b/superset-frontend/src/dashboard/util/getDashboardUrl.test.js
index 83e622aa78..80915d3a2f 100644
--- a/superset-frontend/src/dashboard/util/getDashboardUrl.test.js
+++ b/superset-frontend/src/dashboard/util/getDashboardUrl.test.js
@@ -33,14 +33,14 @@ describe('getChartIdsFromLayout', () => {
window.location = globalLocation;
});
- it('should encode filters', () => {
+ test('should encode filters', () => {
const url = getDashboardUrl({ pathname: 'path', filters });
expect(url).toBe(
'path?preselect_filters=%7B%2235%22%3A%7B%22key%22%3A%5B%22value%22%5D%7D%7D',
);
});
- it('should encode filters with hash', () => {
+ test('should encode filters with hash', () => {
const urlWithHash = getDashboardUrl({
pathname: 'path',
filters,
@@ -51,7 +51,7 @@ describe('getChartIdsFromLayout', () => {
);
});
- it('should encode filters with standalone', () => {
+ test('should encode filters with standalone', () => {
const urlWithStandalone = getDashboardUrl({
pathname: 'path',
filters,
@@ -62,7 +62,7 @@ describe('getChartIdsFromLayout', () => {
);
});
- it('should encode filters with missing standalone', () => {
+ test('should encode filters with missing standalone', () => {
const urlWithStandalone = getDashboardUrl({
pathname: 'path',
filters,
@@ -73,7 +73,7 @@ describe('getChartIdsFromLayout', () => {
);
});
- it('should encode filters with missing filters', () => {
+ test('should encode filters with missing filters', () => {
const urlWithStandalone = getDashboardUrl({
pathname: 'path',
filters: undefined,
@@ -84,7 +84,7 @@ describe('getChartIdsFromLayout', () => {
);
});
- it('should preserve unknown filters', () => {
+ test('should preserve unknown filters', () => {
const windowSpy = jest.spyOn(window, 'window', 'get');
windowSpy.mockImplementation(() => ({
location: {
@@ -102,7 +102,7 @@ describe('getChartIdsFromLayout', () => {
windowSpy.mockRestore();
});
- it('should process native filters key', () => {
+ test('should process native filters key', () => {
const windowSpy = jest.spyOn(window, 'window', 'get');
windowSpy.mockImplementation(() => ({
location: {
diff --git a/superset-frontend/src/dashboard/util/getDetailedComponentWidth.test.js b/superset-frontend/src/dashboard/util/getDetailedComponentWidth.test.js
index c19306141b..94dddd0409 100644
--- a/superset-frontend/src/dashboard/util/getDetailedComponentWidth.test.js
+++ b/superset-frontend/src/dashboard/util/getDetailedComponentWidth.test.js
@@ -24,7 +24,7 @@ import {
} from 'src/dashboard/util/constants';
describe('getDetailedComponentWidth', () => {
- it('should return an object with width, minimumWidth, and occupiedWidth', () => {
+ test('should return an object with width, minimumWidth, and occupiedWidth', () => {
expect(
Object.keys(getDetailedComponentWidth({ id: '_', components: {} })),
).toEqual(
@@ -33,7 +33,7 @@ describe('getDetailedComponentWidth', () => {
});
describe('width', () => {
- it('should be undefined if the component is not resizable and has no defined width', () => {
+ test('should be undefined if the component is not resizable and has no defined width', () => {
const empty = {
width: undefined,
occupiedWidth: undefined,
@@ -59,7 +59,7 @@ describe('getDetailedComponentWidth', () => {
).toEqual(empty);
});
- it('should match component meta width for resizable components', () => {
+ test('should match component meta width for resizable components', () => {
expect(
getDetailedComponentWidth({
component: { id: '', type: types.CHART_TYPE, meta: { width: 1 } },
@@ -80,7 +80,7 @@ describe('getDetailedComponentWidth', () => {
).toEqual({ width: 3, occupiedWidth: 0, minimumWidth: 1 });
});
- it('should be GRID_COLUMN_COUNT for row components WITHOUT parents', () => {
+ test('should be GRID_COLUMN_COUNT for row components WITHOUT parents', () => {
expect(
getDetailedComponentWidth({
id: 'row',
@@ -93,7 +93,7 @@ describe('getDetailedComponentWidth', () => {
});
});
- it('should match parent width for row components WITH parents', () => {
+ test('should match parent width for row components WITH parents', () => {
expect(
getDetailedComponentWidth({
id: 'row',
@@ -114,7 +114,7 @@ describe('getDetailedComponentWidth', () => {
});
});
- it('should use either id or component (to support new components)', () => {
+ test('should use either id or component (to support new components)', () => {
expect(
getDetailedComponentWidth({
id: 'id',
@@ -133,7 +133,7 @@ describe('getDetailedComponentWidth', () => {
});
describe('occupiedWidth', () => {
- it('should reflect the sum of child widths for row components', () => {
+ test('should reflect the sum of child widths for row components', () => {
expect(
getDetailedComponentWidth({
id: 'row',
@@ -149,7 +149,7 @@ describe('getDetailedComponentWidth', () => {
).toEqual({ width: 12, occupiedWidth: 7, minimumWidth: 7 });
});
- it('should always be zero for column components', () => {
+ test('should always be zero for column components', () => {
expect(
getDetailedComponentWidth({
component: { id: '', type: types.COLUMN_TYPE, meta: { width: 2 } },
@@ -159,7 +159,7 @@ describe('getDetailedComponentWidth', () => {
});
describe('minimumWidth', () => {
- it('should equal GRID_MIN_COLUMN_COUNT for resizable components', () => {
+ test('should equal GRID_MIN_COLUMN_COUNT for resizable components', () => {
expect(
getDetailedComponentWidth({
component: { id: '', type: types.CHART_TYPE, meta: { width: 1 } },
@@ -191,7 +191,7 @@ describe('getDetailedComponentWidth', () => {
});
});
- it('should equal the width of row children for column components with row children', () => {
+ test('should equal the width of row children for column components with row children', () => {
expect(
getDetailedComponentWidth({
id: 'column',
@@ -221,7 +221,7 @@ describe('getDetailedComponentWidth', () => {
).toEqual({ width: 12, occupiedWidth: 0, minimumWidth: 7 });
});
- it('should equal occupiedWidth for row components', () => {
+ test('should equal occupiedWidth for row components', () => {
expect(
getDetailedComponentWidth({
id: 'row',
diff --git a/superset-frontend/src/dashboard/util/getDirectPathToTabIndex.test.ts b/superset-frontend/src/dashboard/util/getDirectPathToTabIndex.test.ts
index c9a0c769cd..4fb224d79b 100644
--- a/superset-frontend/src/dashboard/util/getDirectPathToTabIndex.test.ts
+++ b/superset-frontend/src/dashboard/util/getDirectPathToTabIndex.test.ts
@@ -19,7 +19,7 @@
import getDirectPathToTabIndex from './getDirectPathToTabIndex';
describe('getDirectPathToTabIndex', () => {
- it('builds path using parents, id, and child at index', () => {
+ test('builds path using parents, id, and child at index', () => {
const tabs = {
id: 'TABS_ID',
parents: ['ROOT', 'ROW_1'],
@@ -33,7 +33,7 @@ describe('getDirectPathToTabIndex', () => {
]);
});
- it('handles missing parents', () => {
+ test('handles missing parents', () => {
const tabs = {
id: 'TABS_ID',
children: ['TAB_A'],
diff --git a/superset-frontend/src/dashboard/util/getDropPosition.test.js b/superset-frontend/src/dashboard/util/getDropPosition.test.js
index 9fdd02afa6..df5bb66fd3 100644
--- a/superset-frontend/src/dashboard/util/getDropPosition.test.js
+++ b/superset-frontend/src/dashboard/util/getDropPosition.test.js
@@ -81,7 +81,7 @@ describe('getDropPosition', () => {
}
describe('invalid child + invalid sibling', () => {
- it('should return DROP_FORBIDDEN', () => {
+ test('should return DROP_FORBIDDEN', () => {
const result = getDropPosition(
// TAB is an invalid child + sibling of GRID > ROW
...getMocks({
@@ -95,7 +95,7 @@ describe('getDropPosition', () => {
});
describe('valid child + invalid sibling', () => {
- it('should return DROP_LEFT if component has NO children, and orientation is "row"', () => {
+ test('should return DROP_LEFT if component has NO children, and orientation is "row"', () => {
// HEADER is a valid child + invalid sibling of ROOT > GRID
const result = getDropPosition(
...getMocks({
@@ -107,7 +107,7 @@ describe('getDropPosition', () => {
expect(result).toBe(DROP_LEFT);
});
- it('should return DROP_RIGHT if component HAS children, and orientation is "row"', () => {
+ test('should return DROP_RIGHT if component HAS children, and orientation is "row"', () => {
const result = getDropPosition(
...getMocks({
parentType: DASHBOARD_ROOT_TYPE,
@@ -119,7 +119,7 @@ describe('getDropPosition', () => {
expect(result).toBe(DROP_RIGHT);
});
- it('should return DROP_TOP if component has NO children, and orientation is "column"', () => {
+ test('should return DROP_TOP if component has NO children, and orientation is "column"', () => {
const result = getDropPosition(
...getMocks({
parentType: DASHBOARD_ROOT_TYPE,
@@ -131,7 +131,7 @@ describe('getDropPosition', () => {
expect(result).toBe(DROP_TOP);
});
- it('should return DROP_BOTTOM if component HAS children, and orientation is "column"', () => {
+ test('should return DROP_BOTTOM if component HAS children, and orientation is "column"', () => {
const result = getDropPosition(
...getMocks({
parentType: DASHBOARD_ROOT_TYPE,
@@ -146,7 +146,7 @@ describe('getDropPosition', () => {
});
describe('invalid child + valid sibling', () => {
- it('should return DROP_TOP if orientation="row" and clientOffset is closer to component top than bottom', () => {
+ test('should return DROP_TOP if orientation="row" and clientOffset is closer to component top than bottom', () => {
const result = getDropPosition(
// HEADER is an invalid child but valid sibling of GRID > ROW
...getMocks({
@@ -163,7 +163,7 @@ describe('getDropPosition', () => {
expect(result).toBe(DROP_TOP);
});
- it('should return DROP_BOTTOM if orientation="row" and clientOffset is closer to component bottom than top', () => {
+ test('should return DROP_BOTTOM if orientation="row" and clientOffset is closer to component bottom than top', () => {
const result = getDropPosition(
...getMocks({
parentType: DASHBOARD_GRID_TYPE,
@@ -179,7 +179,7 @@ describe('getDropPosition', () => {
expect(result).toBe(DROP_BOTTOM);
});
- it('should return DROP_LEFT if orientation="column" and clientOffset is closer to component left than right', () => {
+ test('should return DROP_LEFT if orientation="column" and clientOffset is closer to component left than right', () => {
const result = getDropPosition(
...getMocks({
parentType: DASHBOARD_GRID_TYPE,
@@ -196,7 +196,7 @@ describe('getDropPosition', () => {
expect(result).toBe(DROP_LEFT);
});
- it('should return DROP_RIGHT if orientation="column" and clientOffset is closer to component right than left', () => {
+ test('should return DROP_RIGHT if orientation="column" and clientOffset is closer to component right than left', () => {
const result = getDropPosition(
...getMocks({
parentType: DASHBOARD_GRID_TYPE,
@@ -215,7 +215,7 @@ describe('getDropPosition', () => {
});
describe('child + valid sibling (row orientation)', () => {
- it('should return DROP_LEFT if component has NO children, and clientOffset is NOT near top/bottom sibling boundary', () => {
+ test('should return DROP_LEFT if component has NO children, and clientOffset is NOT near top/bottom sibling boundary', () => {
const result = getDropPosition(
// CHART is a valid child + sibling of GRID > ROW
...getMocks({
@@ -234,7 +234,7 @@ describe('getDropPosition', () => {
expect(result).toBe(DROP_LEFT);
});
- it('should return DROP_RIGHT if component HAS children, and clientOffset is NOT near top/bottom sibling boundary', () => {
+ test('should return DROP_RIGHT if component HAS children, and clientOffset is NOT near top/bottom sibling boundary', () => {
const result = getDropPosition(
...getMocks({
parentType: DASHBOARD_GRID_TYPE,
@@ -253,7 +253,7 @@ describe('getDropPosition', () => {
expect(result).toBe(DROP_RIGHT);
});
- it('should return DROP_TOP regardless of component children if clientOffset IS near top sibling boundary', () => {
+ test('should return DROP_TOP regardless of component children if clientOffset IS near top sibling boundary', () => {
const noChildren = getDropPosition(
...getMocks({
parentType: DASHBOARD_GRID_TYPE,
@@ -287,7 +287,7 @@ describe('getDropPosition', () => {
expect(withChildren).toBe(DROP_TOP);
});
- it('should return DROP_BOTTOM regardless of component children if clientOffset IS near bottom sibling boundary', () => {
+ test('should return DROP_BOTTOM regardless of component children if clientOffset IS near bottom sibling boundary', () => {
const noChildren = getDropPosition(
...getMocks({
parentType: DASHBOARD_GRID_TYPE,
@@ -323,7 +323,7 @@ describe('getDropPosition', () => {
});
describe('child + valid sibling (column orientation)', () => {
- it('should return DROP_TOP if component has NO children, and clientOffset is NOT near left/right sibling boundary', () => {
+ test('should return DROP_TOP if component has NO children, and clientOffset is NOT near left/right sibling boundary', () => {
const result = getDropPosition(
// CHART is a valid child + sibling of GRID > ROW
...getMocks({
@@ -343,7 +343,7 @@ describe('getDropPosition', () => {
expect(result).toBe(DROP_TOP);
});
- it('should return DROP_BOTTOM if component HAS children, and clientOffset is NOT near left/right sibling boundary', () => {
+ test('should return DROP_BOTTOM if component HAS children, and clientOffset is NOT near left/right sibling boundary', () => {
const result = getDropPosition(
...getMocks({
parentType: DASHBOARD_GRID_TYPE,
@@ -363,7 +363,7 @@ describe('getDropPosition', () => {
expect(result).toBe(DROP_BOTTOM);
});
- it('should return DROP_LEFT regardless of component children if clientOffset IS near left sibling boundary', () => {
+ test('should return DROP_LEFT regardless of component children if clientOffset IS near left sibling boundary', () => {
const noChildren = getDropPosition(
...getMocks({
parentType: DASHBOARD_GRID_TYPE,
@@ -399,7 +399,7 @@ describe('getDropPosition', () => {
expect(withChildren).toBe(DROP_LEFT);
});
- it('should return DROP_RIGHT regardless of component children if clientOffset IS near right sibling boundary', () => {
+ test('should return DROP_RIGHT regardless of component children if clientOffset IS near right sibling boundary', () => {
const noChildren = getDropPosition(
...getMocks({
parentType: DASHBOARD_GRID_TYPE,
diff --git a/superset-frontend/src/dashboard/util/getEffectiveExtraFilters.test.js b/superset-frontend/src/dashboard/util/getEffectiveExtraFilters.test.js
index 0a497775a1..82774f6f42 100644
--- a/superset-frontend/src/dashboard/util/getEffectiveExtraFilters.test.js
+++ b/superset-frontend/src/dashboard/util/getEffectiveExtraFilters.test.js
@@ -19,7 +19,7 @@
import getEffectiveExtraFilters from 'src/dashboard/util/charts/getEffectiveExtraFilters';
describe('getEffectiveExtraFilters', () => {
- it('should create valid filters', () => {
+ test('should create valid filters', () => {
const result = getEffectiveExtraFilters({
gender: ['girl'],
name: null,
diff --git a/superset-frontend/src/dashboard/util/getFilterConfigsFromFormdata.test.js b/superset-frontend/src/dashboard/util/getFilterConfigsFromFormdata.test.js
index 244f2433f6..78cbf288cd 100644
--- a/superset-frontend/src/dashboard/util/getFilterConfigsFromFormdata.test.js
+++ b/superset-frontend/src/dashboard/util/getFilterConfigsFromFormdata.test.js
@@ -36,7 +36,7 @@ describe('getFilterConfigsFromFormdata', () => {
time_range: '2018-12-30T00:00:00+:+last+saturday',
};
- it('should add time grain', () => {
+ test('should add time grain', () => {
const result = getFilterConfigsFromFormdata({
...testFormdata,
show_sqla_time_granularity: true,
@@ -46,7 +46,7 @@ describe('getFilterConfigsFromFormdata', () => {
});
});
- it('should add time column', () => {
+ test('should add time column', () => {
const result = getFilterConfigsFromFormdata({
...testFormdata,
show_sqla_time_column: true,
@@ -56,7 +56,7 @@ describe('getFilterConfigsFromFormdata', () => {
});
});
- it('should use default value and treat empty defaults as null', () => {
+ test('should use default value and treat empty defaults as null', () => {
const result = getFilterConfigsFromFormdata({
...testFormdata,
show_sqla_time_column: true,
@@ -78,7 +78,7 @@ describe('getFilterConfigsFromFormdata', () => {
});
});
- it('should read multi values from form_data', () => {
+ test('should read multi values from form_data', () => {
const result = getFilterConfigsFromFormdata({
...testFormdata,
filter_configs: [
diff --git a/superset-frontend/src/dashboard/util/getFilterScopeFromNodesTree.test.js b/superset-frontend/src/dashboard/util/getFilterScopeFromNodesTree.test.js
index f29d6d25f0..c0080aab45 100644
--- a/superset-frontend/src/dashboard/util/getFilterScopeFromNodesTree.test.js
+++ b/superset-frontend/src/dashboard/util/getFilterScopeFromNodesTree.test.js
@@ -19,7 +19,7 @@
import getFilterScopeFromNodesTree from 'src/dashboard/util/getFilterScopeFromNodesTree';
describe('getFilterScopeFromNodesTree', () => {
- it('should return empty scope', () => {
+ test('should return empty scope', () => {
const nodes = [];
expect(
getFilterScopeFromNodesTree({
@@ -30,7 +30,7 @@ describe('getFilterScopeFromNodesTree', () => {
).toEqual({});
});
- it('should return scope for simple grid', () => {
+ test('should return scope for simple grid', () => {
const nodes = [
{
label: 'All dashboard',
@@ -284,7 +284,7 @@ describe('getFilterScopeFromNodesTree', () => {
},
];
- it('root level tab scope', () => {
+ test('root level tab scope', () => {
const checkedChartIds = [106];
expect(
getFilterScopeFromNodesTree({
@@ -298,7 +298,7 @@ describe('getFilterScopeFromNodesTree', () => {
});
});
- it('global scope', () => {
+ test('global scope', () => {
const checkedChartIds = [106, 104, 101, 102, 103, 105];
expect(
getFilterScopeFromNodesTree({
@@ -312,7 +312,7 @@ describe('getFilterScopeFromNodesTree', () => {
});
});
- it('row level tab scope', () => {
+ test('row level tab scope', () => {
const checkedChartIds = [103, 105];
expect(
getFilterScopeFromNodesTree({
@@ -326,7 +326,7 @@ describe('getFilterScopeFromNodesTree', () => {
});
});
- it('mixed row level and root level scope', () => {
+ test('mixed row level and root level scope', () => {
const checkedChartIds = [103, 105, 106];
expect(
getFilterScopeFromNodesTree({
@@ -340,7 +340,7 @@ describe('getFilterScopeFromNodesTree', () => {
});
});
- it('mixed row level tab and chart scope', () => {
+ test('mixed row level tab and chart scope', () => {
const checkedChartIds = [103, 105, 102];
expect(
getFilterScopeFromNodesTree({
@@ -354,7 +354,7 @@ describe('getFilterScopeFromNodesTree', () => {
});
});
- it('exclude sub-tab', () => {
+ test('exclude sub-tab', () => {
const checkedChartIds = [103, 104, 105];
expect(
getFilterScopeFromNodesTree({
@@ -368,7 +368,7 @@ describe('getFilterScopeFromNodesTree', () => {
});
});
- it('exclude top-tab', () => {
+ test('exclude top-tab', () => {
const checkedChartIds = [106, 109];
expect(
getFilterScopeFromNodesTree({
@@ -382,7 +382,7 @@ describe('getFilterScopeFromNodesTree', () => {
});
});
- it('exclude nested sub-tab', () => {
+ test('exclude nested sub-tab', () => {
// another layout for test:
// - filter_109
// - chart_106
diff --git a/superset-frontend/src/dashboard/util/getFormDataWithExtraFilters.test.ts b/superset-frontend/src/dashboard/util/getFormDataWithExtraFilters.test.ts
index 0f6a550488..321606f288 100644
--- a/superset-frontend/src/dashboard/util/getFormDataWithExtraFilters.test.ts
+++ b/superset-frontend/src/dashboard/util/getFormDataWithExtraFilters.test.ts
@@ -72,7 +72,7 @@ describe('getFormDataWithExtraFilters', () => {
allSliceIds: [chartId],
};
- it('should include filters from the passed filters', () => {
+ test('should include filters from the passed filters', () => {
const result = getFormDataWithExtraFilters(mockArgs);
expect(result.extra_filters).toHaveLength(2);
expect(result.extra_filters[0]).toEqual({
@@ -87,7 +87,7 @@ describe('getFormDataWithExtraFilters', () => {
});
});
- it('should compose extra control', () => {
+ test('should compose extra control', () => {
const result: CachedFormDataWithExtraControls =
getFormDataWithExtraFilters(mockArgs);
expect(result.stack).toEqual('Stacked');
diff --git a/superset-frontend/src/dashboard/util/getLeafComponentIdFromPath.test.js b/superset-frontend/src/dashboard/util/getLeafComponentIdFromPath.test.js
index 9f3a659017..e5e0f85eba 100644
--- a/superset-frontend/src/dashboard/util/getLeafComponentIdFromPath.test.js
+++ b/superset-frontend/src/dashboard/util/getLeafComponentIdFromPath.test.js
@@ -24,11 +24,11 @@ describe('getLeafComponentIdFromPath', () => {
const path = dashboardFilters[filterId].directPathToFilter;
const leaf = path.slice().pop();
- it('should return component id', () => {
+ test('should return component id', () => {
expect(getLeafComponentIdFromPath(path)).toBe(leaf);
});
- it('should not return label component', () => {
+ test('should not return label component', () => {
const updatedPath =
dashboardFilters[filterId].directPathToFilter.concat('LABEL-test123');
expect(getLeafComponentIdFromPath(updatedPath)).toBe(leaf);
diff --git a/superset-frontend/src/dashboard/util/isDashboardEmpty.test.ts b/superset-frontend/src/dashboard/util/isDashboardEmpty.test.ts
index 0ebf5b0ed8..0e867aa5bf 100644
--- a/superset-frontend/src/dashboard/util/isDashboardEmpty.test.ts
+++ b/superset-frontend/src/dashboard/util/isDashboardEmpty.test.ts
@@ -32,11 +32,11 @@ describe('isDashboardEmpty', () => {
},
};
- it('should return true for empty dashboard', () => {
+ test('should return true for empty dashboard', () => {
expect(isDashboardEmpty(emptyLayout)).toBe(true);
});
- it('should return false for non-empty dashboard', () => {
+ test('should return false for non-empty dashboard', () => {
expect(isDashboardEmpty(testLayout)).toBe(false);
});
});
diff --git a/superset-frontend/src/dashboard/util/isDashboardLoading.test.ts b/superset-frontend/src/dashboard/util/isDashboardLoading.test.ts
index ee6aa85915..edde481a73 100644
--- a/superset-frontend/src/dashboard/util/isDashboardLoading.test.ts
+++ b/superset-frontend/src/dashboard/util/isDashboardLoading.test.ts
@@ -19,7 +19,7 @@
import isDashboardLoading, { ChartLoadTimestamps } from './isDashboardLoading';
describe('isDashboardLoading', () => {
- it('returns false when no charts are loading', () => {
+ test('returns false when no charts are loading', () => {
const charts: Record<string, ChartLoadTimestamps> = {
a: { chartUpdateStartTime: 1, chartUpdateEndTime: 2 },
b: { chartUpdateStartTime: 5, chartUpdateEndTime: 5 },
@@ -27,7 +27,7 @@ describe('isDashboardLoading', () => {
expect(isDashboardLoading(charts)).toBe(false);
});
- it('returns true when any chart has start > end', () => {
+ test('returns true when any chart has start > end', () => {
const charts: Record<string, ChartLoadTimestamps> = {
a: { chartUpdateStartTime: 10, chartUpdateEndTime: 5 },
b: { chartUpdateStartTime: 1, chartUpdateEndTime: 2 },
@@ -35,14 +35,14 @@ describe('isDashboardLoading', () => {
expect(isDashboardLoading(charts)).toBe(true);
});
- it('treats missing end as 0', () => {
+ test('treats missing end as 0', () => {
const charts: Record<string, ChartLoadTimestamps> = {
a: { chartUpdateStartTime: 1 },
};
expect(isDashboardLoading(charts)).toBe(true);
});
- it('handles empty charts object', () => {
+ test('handles empty charts object', () => {
expect(isDashboardLoading({})).toBe(false);
});
});
diff --git a/superset-frontend/src/dashboard/util/isValidChild.test.ts b/superset-frontend/src/dashboard/util/isValidChild.test.ts
index 413cbfc956..4fe82620c5 100644
--- a/superset-frontend/src/dashboard/util/isValidChild.test.ts
+++ b/superset-frontend/src/dashboard/util/isValidChild.test.ts
@@ -96,7 +96,7 @@ describe('isValidChild', () => {
if (i > 0 && !didTest[testKey]) {
didTest[testKey] = true;
- it(`(${exampleIdx})${getIndentation(
+ test(`(${exampleIdx})${getIndentation(
childDepth,
)}${parentType} (depth ${parentDepth}) > ${childType} ✅`, () => {
expect(
@@ -144,7 +144,7 @@ describe('isValidChild', () => {
if (typeof parentType !== 'string')
throw TypeError('parent must be string');
- it(`(${exampleIdx})${getIndentation(
+ test(`(${exampleIdx})${getIndentation(
childDepth,
)}${parentType} (depth ${parentDepth}) > ${childType} ❌`, () => {
expect(
diff --git a/superset-frontend/src/dashboard/util/newComponentFactory.test.js b/superset-frontend/src/dashboard/util/newComponentFactory.test.js
index 069af58dd2..339a214d71 100644
--- a/superset-frontend/src/dashboard/util/newComponentFactory.test.js
+++ b/superset-frontend/src/dashboard/util/newComponentFactory.test.js
@@ -48,7 +48,7 @@ const types = [
describe('newEntityFactory', () => {
types.forEach(type => {
- it(`returns a new ${type}`, () => {
+ test(`returns a new ${type}`, () => {
const result = newComponentFactory(type);
expect(result.type).toBe(type);
@@ -58,7 +58,7 @@ describe('newEntityFactory', () => {
});
});
- it('adds passed meta data to the entity', () => {
+ test('adds passed meta data to the entity', () => {
const banana = 'banana';
const result = newComponentFactory(CHART_TYPE, { banana });
expect(result.meta.banana).toBe(banana);
diff --git a/superset-frontend/src/dashboard/util/newEntitiesFromDrop.test.js b/superset-frontend/src/dashboard/util/newEntitiesFromDrop.test.js
index 6ab80569de..8db47800c8 100644
--- a/superset-frontend/src/dashboard/util/newEntitiesFromDrop.test.js
+++ b/superset-frontend/src/dashboard/util/newEntitiesFromDrop.test.js
@@ -26,7 +26,7 @@ import {
} from 'src/dashboard/util/componentTypes';
describe('newEntitiesFromDrop', () => {
- it('should return a new Entity of appropriate type, and add it to the drop target children', () => {
+ test('should return a new Entity of appropriate type, and add it to the drop target children', () => {
const result = newEntitiesFromDrop({
dropResult: {
destination: { id: 'a', index: 0 },
@@ -48,7 +48,7 @@ describe('newEntitiesFromDrop', () => {
expect(result[newId].type).toBe(CHART_TYPE);
});
- it('should create Tab AND Tabs components if the drag entity is Tabs', () => {
+ test('should create Tab AND Tabs components if the drag entity is Tabs', () => {
const result = newEntitiesFromDrop({
dropResult: {
destination: { id: 'a', index: 0 },
@@ -73,7 +73,7 @@ describe('newEntitiesFromDrop', () => {
expect(result[newTabId].type).toBe(TAB_TYPE);
});
- it('should create a Row if the drag entity should be wrapped in a row', () => {
+ test('should create a Row if the drag entity should be wrapped in a row', () => {
const result = newEntitiesFromDrop({
dropResult: {
destination: { id: 'a', index: 0 },
diff --git a/superset-frontend/src/dashboard/util/permissionUtils.test.ts b/superset-frontend/src/dashboard/util/permissionUtils.test.ts
index 8f99688727..b0f0fca6d2 100644
--- a/superset-frontend/src/dashboard/util/permissionUtils.test.ts
+++ b/superset-frontend/src/dashboard/util/permissionUtils.test.ts
@@ -105,24 +105,24 @@ jest.mock('@superset-ui/core', () => ({
const mockedIsFeatureEnabled = isFeatureEnabled as jest.Mock;
describe('canUserEditDashboard', () => {
- it('allows owners to edit', () => {
+ test('allows owners to edit', () => {
expect(canUserEditDashboard(dashboard, ownerUser)).toEqual(true);
});
- it('allows admin users to edit regardless of ownership', () => {
+ test('allows admin users to edit regardless of ownership', () => {
expect(canUserEditDashboard(dashboard, adminUser)).toEqual(true);
});
- it('rejects non-owners', () => {
+ test('rejects non-owners', () => {
expect(canUserEditDashboard(dashboard, outsiderUser)).toEqual(false);
});
- it('rejects nonexistent users', () => {
+ test('rejects nonexistent users', () => {
expect(canUserEditDashboard(dashboard, null)).toEqual(false);
});
- it('rejects missing roles', () => {
+ test('rejects missing roles', () => {
// in redux, when there is no user, the user is actually set to an empty object,
// so we need to handle missing roles as well as a missing user.s
expect(canUserEditDashboard(dashboard, {})).toEqual(false);
});
- it('rejects "admins" if the admin role does not have edit rights for some reason', () => {
+ test('rejects "admins" if the admin role does not have edit rights for some reason', () => {
expect(
canUserEditDashboard(dashboard, {
...adminUser,
@@ -195,15 +195,15 @@ describe('canUserSaveAsDashboard with RBAC feature flag disabled', () => {
mockedIsFeatureEnabled.mockRestore();
});
- it('allows owners', () => {
+ test('allows owners', () => {
expect(canUserSaveAsDashboard(dashboard, ownerUser)).toEqual(true);
});
- it('allows admin users', () => {
+ test('allows admin users', () => {
expect(canUserSaveAsDashboard(dashboard, adminUser)).toEqual(true);
});
- it('allows non-owners', () => {
+ test('allows non-owners', () => {
expect(canUserSaveAsDashboard(dashboard, outsiderUser)).toEqual(true);
});
});
@@ -219,15 +219,15 @@ describe('canUserSaveAsDashboard with RBAC feature flag enabled', () => {
mockedIsFeatureEnabled.mockRestore();
});
- it('allows owners', () => {
+ test('allows owners', () => {
expect(canUserSaveAsDashboard(dashboard, ownerUser)).toEqual(true);
});
- it('allows admin users', () => {
+ test('allows admin users', () => {
expect(canUserSaveAsDashboard(dashboard, adminUser)).toEqual(true);
});
- it('reject non-owners', () => {
+ test('reject non-owners', () => {
expect(canUserSaveAsDashboard(dashboard, outsiderUser)).toEqual(false);
});
});
diff --git a/superset-frontend/src/dashboard/util/updateComponentParentsList.test.js b/superset-frontend/src/dashboard/util/updateComponentParentsList.test.js
index c5a15d7290..2111c0e1e2 100644
--- a/superset-frontend/src/dashboard/util/updateComponentParentsList.test.js
+++ b/superset-frontend/src/dashboard/util/updateComponentParentsList.test.js
@@ -44,7 +44,7 @@ describe('updateComponentParentsList', () => {
...dashboardLayoutWithTabs.present,
};
- it('should handle empty layout', () => {
+ test('should handle empty layout', () => {
const nextState = {
...emptyLayout,
};
@@ -57,7 +57,7 @@ describe('updateComponentParentsList', () => {
expect(nextState.GRID_ID.parents).toEqual(['ROOT_ID']);
});
- it('should handle grid layout', () => {
+ test('should handle grid layout', () => {
const nextState = {
...gridLayout,
};
@@ -76,7 +76,7 @@ describe('updateComponentParentsList', () => {
]);
});
- it('should handle root level tabs', () => {
+ test('should handle root level tabs', () => {
const nextState = {
...tabsLayout,
};
@@ -97,7 +97,7 @@ describe('updateComponentParentsList', () => {
});
describe('updateComponentParentsList with bad inputs', () => {
- it('should handle invalid parameters and not throw error', () => {
+ test('should handle invalid parameters and not throw error', () => {
updateComponentParentsList({
currentComponent: undefined,
layout: undefined,
diff --git a/superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.test.tsx b/superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.test.tsx
index a2047bf2aa..075cda7edc 100644
--- a/superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.test.tsx
+++ b/superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.test.tsx
@@ -51,7 +51,7 @@ describe('useFilterFocusHighlightStyles', () => {
store,
});
- it('should return no style if filter not in scope', async () => {
+ test('should return no style if filter not in scope', async () => {
renderWrapper(10);
const container = screen.getByTestId('test-component');
@@ -60,7 +60,7 @@ describe('useFilterFocusHighlightStyles', () => {
expect(styles.opacity).toBeFalsy();
});
- it('should return unfocused styles if chart is not in scope of focused native filter', async () => {
+ test('should return unfocused styles if chart is not in scope of focused native filter', async () => {
mockGetRelatedCharts.mockReturnValue([]);
const store = createMockStore({
nativeFilters: {
@@ -80,7 +80,7 @@ describe('useFilterFocusHighlightStyles', () => {
expect(parseFloat(styles.opacity)).toBe(0.3);
});
- it('should return unfocused styles if chart is not in scope of hovered native filter', async () => {
+ test('should return unfocused styles if chart is not in scope of hovered native filter', async () => {
mockGetRelatedCharts.mockReturnValue([]);
const store = createMockStore({
nativeFilters: {
@@ -100,7 +100,7 @@ describe('useFilterFocusHighlightStyles', () => {
expect(parseFloat(styles.opacity)).toBe(0.3);
});
- it('should return focused styles if chart is in scope of focused native filter', async () => {
+ test('should return focused styles if chart is in scope of focused native filter', async () => {
const chartId = 18;
mockGetRelatedCharts.mockReturnValue([chartId]);
const store = createMockStore({
@@ -121,7 +121,7 @@ describe('useFilterFocusHighlightStyles', () => {
expect(parseFloat(styles.opacity)).toBe(1);
});
- it('should return focused styles if chart is in scope of hovered native filter', async () => {
+ test('should return focused styles if chart is in scope of hovered native filter', async () => {
const chartId = 18;
mockGetRelatedCharts.mockReturnValue([chartId]);
const store = createMockStore({
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..d08f877f27 100644
--- a/superset-frontend/src/explore/actions/exploreActions.test.js
+++ b/superset-frontend/src/explore/actions/exploreActions.test.js
@@ -78,14 +78,14 @@ const METRICS = [
];
describe('reducers', () => {
- it('Does not set a control value if control does not exist', () => {
+ test('Does not set a control value if control does not exist', () => {
const newState = exploreReducer(
defaultState,
actions.setControlValue('NEW_FIELD', 'x', []),
);
expect(newState.controls.NEW_FIELD).toBeUndefined();
});
- it('setControlValue works as expected with a Select control', () => {
+ test('setControlValue works as expected with a Select control', () => {
const newState = exploreReducer(
defaultState,
actions.setControlValue('y_axis_format', '$,.2f', []),
@@ -93,7 +93,7 @@ describe('reducers', () => {
expect(newState.controls.y_axis_format.value).toBe('$,.2f');
expect(newState.form_data.y_axis_format).toBe('$,.2f');
});
- it('Keeps the column config when metric column positions are swapped', () => {
+ test('Keeps the column config when metric column positions are swapped', () => {
const mockedState = {
...defaultState,
controls: {
@@ -153,7 +153,7 @@ describe('reducers', () => {
);
});
- it('Keeps the column config when metric column name is updated', () => {
+ test('Keeps the column config when metric column name is updated', () => {
const mockedState = {
...defaultState,
controls: {
diff --git a/superset-frontend/src/explore/components/EmbedCodeContent.test.jsx b/superset-frontend/src/explore/components/EmbedCodeContent.test.jsx
index d295641feb..cc942a5fd2 100644
--- a/superset-frontend/src/explore/components/EmbedCodeContent.test.jsx
+++ b/superset-frontend/src/explore/components/EmbedCodeContent.test.jsx
@@ -25,11 +25,11 @@ const url = 'http://localhost/explore/p/100';
fetchMock.post('glob:*/api/v1/explore/permalink', { url });
describe('EmbedCodeButton', () => {
- it('renders', () => {
+ test('renders', () => {
expect(isValidElement(<EmbedCodeContent />)).toBe(true);
});
- it('returns correct embed code', async () => {
+ test('returns correct embed code', async () => {
render(<EmbedCodeContent />, { useRedux: true });
expect(await screen.findByText('iframe', { exact: false })).toBeVisible();
expect(await screen.findByText('/iframe', { exact: false })).toBeVisible();
diff --git a/superset-frontend/src/explore/components/ExploreChartPanel/ExploreChartPanel.test.jsx b/superset-frontend/src/explore/components/ExploreChartPanel/ExploreChartPanel.test.jsx
index 185fdbd65f..11345be2e7 100644
--- a/superset-frontend/src/explore/components/ExploreChartPanel/ExploreChartPanel.test.jsx
+++ b/superset-frontend/src/explore/components/ExploreChartPanel/ExploreChartPanel.test.jsx
@@ -162,7 +162,7 @@ describe('ChartContainer', () => {
expect(screen.queryByText(/cached/i)).not.toBeInTheDocument();
});
- it('hides gutter when collapsing data panel', async () => {
+ test('hides gutter when collapsing data panel', async () => {
const props = createProps();
setItem(LocalStorageKeys.IsDatapanelOpen, true);
const { container } = render(<ChartContainer {...props} />, {
diff --git a/superset-frontend/src/explore/components/controls/CheckboxControl.test.tsx b/superset-frontend/src/explore/components/controls/CheckboxControl.test.tsx
index 8deae24516..5af03d214d 100644
--- a/superset-frontend/src/explore/components/controls/CheckboxControl.test.tsx
+++ b/superset-frontend/src/explore/components/controls/CheckboxControl.test.tsx
@@ -31,7 +31,7 @@ const setup = (overrides = {}) => (
);
describe('CheckboxControl', () => {
- it('renders a Checkbox', () => {
+ test('renders a Checkbox', () => {
render(setup());
const checkbox = screen.getByRole('checkbox');
@@ -39,7 +39,7 @@ describe('CheckboxControl', () => {
expect(checkbox).not.toBeChecked();
});
- it('Checks the box when the label is clicked', () => {
+ test('Checks the box when the label is clicked', () => {
render(setup());
const label = screen.getByRole('button', {
name: /checkbox label/i,
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..b899f087e0 100644
--- a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointsControl.test.tsx
+++ b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointsControl.test.tsx
@@ -51,7 +51,7 @@ describe('ColorBreakpointsControl', () => {
jest.clearAllMocks();
});
- it('should render with default props', () => {
+ test('should render with default props', () => {
renderComponent();
expect(screen.getByText('Click to add new breakpoint')).toBeInTheDocument();
});
diff --git a/superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx b/superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx
index 97b3646281..124612fe9a 100644
--- a/superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx
+++ b/superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx
@@ -45,7 +45,7 @@ describe('ColorPickerControl', () => {
jest.clearAllMocks();
});
- it('renders a ColorPicker component', () => {
+ test('renders a ColorPicker component', () => {
render(<ColorPickerControl {...defaultProps} />);
// AntD ColorPicker renders a trigger element with class
@@ -55,14 +55,14 @@ describe('ColorPickerControl', () => {
expect(colorPickerTrigger).toBeInTheDocument();
});
- it('displays the correct color value', () => {
+ test('displays the correct color value', () => {
render(<ColorPickerControl {...defaultProps} />);
// The color should be displayed as hex #007A87 (uppercase in AntD)
expect(screen.getByText('#007A87')).toBeInTheDocument();
});
- it('calls onChange with RGB values when color changes', async () => {
+ test('calls onChange with RGB values when color changes', async () => {
const onChange = jest.fn();
render(<ColorPickerControl {...defaultProps} onChange={onChange} />);
@@ -80,7 +80,7 @@ describe('ColorPickerControl', () => {
// as it uses complex internal components. The main functionality is covered by the component itself.
});
- it('includes preset colors from the categorical scheme', () => {
+ test('includes preset colors from the categorical scheme', () => {
render(<ColorPickerControl {...defaultProps} />);
// The component should have access to the preset colors from the registry
diff --git a/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.jsx b/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.jsx
index d6204a0ed4..c9bdd10aef 100644
--- a/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.jsx
+++ b/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.jsx
@@ -83,17 +83,17 @@ describe('DatasourceControl', () => {
};
};
- it('should not render Modal', () => {
+ test('should not render Modal', () => {
setup();
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
});
- it('should not render ChangeDatasourceModal', () => {
+ test('should not render ChangeDatasourceModal', () => {
setup();
expect(screen.queryByTestId('Swap dataset-modal')).not.toBeInTheDocument();
});
- it('show or hide Edit Datasource option', async () => {
+ test('show or hide Edit Datasource option', async () => {
const {
rendered: { container, rerender },
store,
@@ -127,7 +127,7 @@ describe('DatasourceControl', () => {
});
});
- it('should render health check message', async () => {
+ test('should render health check message', async () => {
setup();
const modalTrigger = screen.getByLabelText('warning');
expect(modalTrigger).toBeInTheDocument();
@@ -141,7 +141,7 @@ describe('DatasourceControl', () => {
});
});
- it('Gets Datasource Title', () => {
+ test('Gets Datasource Title', () => {
const sql = 'This is the sql';
const name = 'this is a name';
const emptyResult = '';
diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/tests/CalendarFrame.test.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/tests/CalendarFrame.test.tsx
index b859d737b5..2b5f9c7ba8 100644
--- a/superset-frontend/src/explore/components/controls/DateFilterControl/tests/CalendarFrame.test.tsx
+++ b/superset-frontend/src/explore/components/controls/DateFilterControl/tests/CalendarFrame.test.tsx
@@ -23,21 +23,21 @@ import { PreviousCalendarWeek, PreviousCalendarQuarter } from '../types';
import { CALENDAR_RANGE_OPTIONS } from '../utils/constants';
describe('CalendarFrame', () => {
- it('calls onChange with PreviousCalendarWeek if value is not in CALENDAR_RANGE_SET', () => {
+ test('calls onChange with PreviousCalendarWeek if value is not in CALENDAR_RANGE_SET', () => {
const mockOnChange = jest.fn();
render(<CalendarFrame onChange={mockOnChange} value="invalid-value" />);
expect(mockOnChange).toHaveBeenCalledWith(PreviousCalendarWeek);
});
- it('renders null if value is not in CALENDAR_RANGE_SET', () => {
+ test('renders null if value is not in CALENDAR_RANGE_SET', () => {
render(<CalendarFrame onChange={jest.fn()} value="invalid-value" />);
expect(
screen.queryByText('Configure Time Range: Previous...'),
).not.toBeInTheDocument();
});
- it('renders the correct number of radio options', () => {
+ test('renders the correct number of radio options', () => {
render(<CalendarFrame onChange={jest.fn()} value={PreviousCalendarWeek} />);
const radios = screen.getAllByRole('radio');
expect(radios).toHaveLength(CALENDAR_RANGE_OPTIONS.length);
@@ -46,7 +46,7 @@ describe('CalendarFrame', () => {
});
});
- it('calls onChange with the correct value when a radio button is selected', () => {
+ test('calls onChange with the correct value when a radio button is selected', () => {
const mockOnChange = jest.fn();
render(
<CalendarFrame
@@ -62,7 +62,7 @@ describe('CalendarFrame', () => {
expect(mockOnChange).toHaveBeenCalledWith(secondOption.value);
});
- it('renders the section title correctly', () => {
+ test('renders the section title correctly', () => {
render(
<CalendarFrame
onChange={jest.fn()}
@@ -74,7 +74,7 @@ describe('CalendarFrame', () => {
).toBeInTheDocument();
});
- it('ensures the third option is PreviousCalendarQuarter', () => {
+ test('ensures the third option is PreviousCalendarQuarter', () => {
render(
<CalendarFrame
onChange={jest.fn()}
diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/tests/utils.test.ts b/superset-frontend/src/explore/components/controls/DateFilterControl/tests/utils.test.ts
index 0facc4e39f..5a7d0a805d 100644
--- a/superset-frontend/src/explore/components/controls/DateFilterControl/tests/utils.test.ts
+++ b/superset-frontend/src/explore/components/controls/DateFilterControl/tests/utils.test.ts
@@ -21,7 +21,7 @@ import { customTimeRangeEncode } from 'src/explore/components/controls/DateFilte
describe('Custom TimeRange', () => {
describe('customTimeRangeEncode', () => {
- it('1) specific : specific', () => {
+ test('1) specific : specific', () => {
expect(
customTimeRangeEncode({
sinceDatetime: '2021-01-20T00:00:00',
@@ -38,7 +38,7 @@ describe('Custom TimeRange', () => {
).toEqual('2021-01-20T00:00:00 : 2021-01-27T00:00:00');
});
- it('2) specific : relative', () => {
+ test('2) specific : relative', () => {
expect(
customTimeRangeEncode({
sinceDatetime: '2021-01-20T00:00:00',
@@ -57,7 +57,7 @@ describe('Custom TimeRange', () => {
);
});
- it('3) now : relative', () => {
+ test('3) now : relative', () => {
expect(
customTimeRangeEncode({
sinceDatetime: 'now',
@@ -74,7 +74,7 @@ describe('Custom TimeRange', () => {
).toEqual('now : DATEADD(DATETIME("now"), 7, day)');
});
- it('4) today : relative', () => {
+ test('4) today : relative', () => {
expect(
customTimeRangeEncode({
sinceDatetime: 'today',
@@ -91,7 +91,7 @@ describe('Custom TimeRange', () => {
).toEqual('today : DATEADD(DATETIME("today"), 7, day)');
});
- it('5) relative : specific', () => {
+ test('5) relative : specific', () => {
expect(
customTimeRangeEncode({
sinceDatetime: '2021-01-27T00:00:00',
@@ -110,7 +110,7 @@ describe('Custom TimeRange', () => {
);
});
- it('6) relative : now', () => {
+ test('6) relative : now', () => {
expect(
customTimeRangeEncode({
sinceDatetime: 'now',
@@ -127,7 +127,7 @@ describe('Custom TimeRange', () => {
).toEqual('DATEADD(DATETIME("now"), -7, day) : now');
});
- it('7) relative : today', () => {
+ test('7) relative : today', () => {
expect(
customTimeRangeEncode({
sinceDatetime: 'today',
@@ -144,7 +144,7 @@ describe('Custom TimeRange', () => {
).toEqual('DATEADD(DATETIME("today"), -7, day) : today');
});
- it('8) relative : relative (now)', () => {
+ test('8) relative : relative (now)', () => {
expect(
customTimeRangeEncode({
sinceDatetime: 'now',
@@ -163,7 +163,7 @@ describe('Custom TimeRange', () => {
);
});
- it('9) relative : relative (date/time)', () => {
+ test('9) relative : relative (date/time)', () => {
expect(
customTimeRangeEncode({
sinceDatetime: '2021-01-27T00:00:00',
diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilter/AdhocFilter.test.js b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilter/AdhocFilter.test.js
index 7ac2a79e4b..bf963c5cf5 100644
--- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilter/AdhocFilter.test.js
+++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilter/AdhocFilter.test.js
@@ -21,7 +21,7 @@ import { Operators } from 'src/explore/constants';
import { ExpressionTypes, Clauses } from '../types';
describe('AdhocFilter', () => {
- it('sets filterOptionName in constructor', () => {
+ test('sets filterOptionName in constructor', () => {
const adhocFilter = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'value',
@@ -44,7 +44,7 @@ describe('AdhocFilter', () => {
});
});
- it('can create altered duplicates', () => {
+ test('can create altered duplicates', () => {
const adhocFilter1 = new AdhocFilter({
isNew: true,
expressionType: ExpressionTypes.Simple,
@@ -68,7 +68,7 @@ describe('AdhocFilter', () => {
expect(adhocFilter2.isNew).toStrictEqual(false);
});
- it('can verify equality', () => {
+ test('can verify equality', () => {
const adhocFilter1 = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'value',
@@ -84,7 +84,7 @@ describe('AdhocFilter', () => {
expect(adhocFilter1 === adhocFilter2).toBe(false);
});
- it('can verify inequality', () => {
+ test('can verify inequality', () => {
const adhocFilter1 = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'value',
@@ -110,7 +110,7 @@ describe('AdhocFilter', () => {
expect(adhocFilter3.equals(adhocFilter4)).toBe(false);
});
- it('can determine if it is valid', () => {
+ test('can determine if it is valid', () => {
const adhocFilter1 = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'value',
@@ -206,7 +206,7 @@ describe('AdhocFilter', () => {
expect(adhocFilter10.isValid()).toBe(true);
});
- it('can translate from simple expressions to sql expressions', () => {
+ test('can translate from simple expressions to sql expressions', () => {
const adhocFilter1 = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'value',
@@ -225,7 +225,7 @@ describe('AdhocFilter', () => {
});
expect(adhocFilter2.translateToSql()).toBe('SUM(value) <> 5');
});
- it('sets comparator to undefined when operator is IS_NULL', () => {
+ test('sets comparator to undefined when operator is IS_NULL', () => {
const adhocFilter = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'SUM(value)',
@@ -236,7 +236,7 @@ describe('AdhocFilter', () => {
});
expect(adhocFilter.comparator).toBe(undefined);
});
- it('sets comparator to undefined when operator is IS_NOT_NULL', () => {
+ test('sets comparator to undefined when operator is IS_NOT_NULL', () => {
const adhocFilter = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'SUM(value)',
@@ -247,7 +247,7 @@ describe('AdhocFilter', () => {
});
expect(adhocFilter.comparator).toBe(undefined);
});
- it('sets comparator to undefined when operator is IS_TRUE', () => {
+ test('sets comparator to undefined when operator is IS_TRUE', () => {
const adhocFilter = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'col',
@@ -258,7 +258,7 @@ describe('AdhocFilter', () => {
});
expect(adhocFilter.comparator).toBe(undefined);
});
- it('sets comparator to undefined when operator is IS_FALSE', () => {
+ test('sets comparator to undefined when operator is IS_FALSE', () => {
const adhocFilter = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'col',
@@ -269,14 +269,14 @@ describe('AdhocFilter', () => {
});
expect(adhocFilter.comparator).toBe(undefined);
});
- it('sets the label properly if subject is a string', () => {
+ test('sets the label properly if subject is a string', () => {
const adhocFilter = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'order_date',
});
expect(adhocFilter.getDefaultLabel()).toBe('order_date');
});
- it('sets the label properly if subject is an object with the column_date property', () => {
+ test('sets the label properly if subject is an object with the column_date property', () => {
const adhocFilter = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: {
@@ -285,7 +285,7 @@ describe('AdhocFilter', () => {
});
expect(adhocFilter.getDefaultLabel()).toBe('year');
});
- it('sets the label to empty is there is no column_name in the object', () => {
+ test('sets the label to empty is there is no column_name in the object', () => {
const adhocFilter = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: {
@@ -294,7 +294,7 @@ describe('AdhocFilter', () => {
});
expect(adhocFilter.getDefaultLabel()).toBe('');
});
- it('sets the label to empty is there is no subject', () => {
+ test('sets the label to empty is there is no subject', () => {
const adhocFilter = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: undefined,
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..67fb2b8905 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
@@ -74,7 +74,7 @@ const renderComponent = (props: Partial<Props> = {}) =>
});
describe('AdhocFilterControl', () => {
- it('should render with default props', () => {
+ test('should render with default props', () => {
renderComponent();
expect(screen.getByText('Add filter')).toBeInTheDocument();
expect(screen.getByTestId('adhoc-filter-control')).toBeInTheDocument();
@@ -111,13 +111,13 @@ describe('AdhocFilterControl', () => {
expect(onChange).toHaveBeenCalledWith([]);
});
- it('should show add filter button when no filters exist', () => {
+ test('should show add filter button when no filters exist', () => {
renderComponent();
const addButton = screen.getByTestId('add-filter-button');
expect(addButton).toBeInTheDocument();
});
- it('should handle partition column data', async () => {
+ test('should handle partition column data', async () => {
const mockPartitionColumn = 'date_column';
const mockResponse = {
partitions: {
diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/AdhocFilterEditPopover.test.jsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/AdhocFilterEditPopover.test.jsx
index d573f99efe..d1a6b96078 100644
--- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/AdhocFilterEditPopover.test.jsx
+++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/AdhocFilterEditPopover.test.jsx
@@ -75,7 +75,7 @@ const renderPopover = (props = {}) =>
});
describe('AdhocFilterEditPopover', () => {
- it('renders simple tab content by default', () => {
+ test('renders simple tab content by default', () => {
renderPopover();
expect(screen.getByRole('tablist')).toBeInTheDocument();
@@ -85,7 +85,7 @@ describe('AdhocFilterEditPopover', () => {
expect(screen.getByText('Simple')).toBeInTheDocument();
});
- it('renders sql tab content when the adhoc filter expressionType is sql', () => {
+ test('renders sql tab content when the adhoc filter expressionType is sql', () => {
renderPopover({ adhocFilter: sqlAdhocFilter });
expect(screen.getByRole('tablist')).toBeInTheDocument();
@@ -96,7 +96,7 @@ describe('AdhocFilterEditPopover', () => {
);
});
- it('renders error message when filter is faulty', () => {
+ test('renders error message when filter is faulty', () => {
renderPopover({ adhocFilter: faultyAdhocFilter });
expect(screen.getByRole('tablist')).toBeInTheDocument();
@@ -107,7 +107,7 @@ describe('AdhocFilterEditPopover', () => {
).toBeDisabled();
});
- it.skip('updates the filter when changes are made', async () => {
+ test.skip('updates the filter when changes are made', async () => {
const onChange = jest.fn();
renderPopover({
onChange,
@@ -137,7 +137,7 @@ describe('AdhocFilterEditPopover', () => {
);
});
- it('enables save button when valid changes are made', async () => {
+ test('enables save button when valid changes are made', async () => {
renderPopover({ adhocFilter: simpleAdhocFilter });
// Find the subject select by its test id
@@ -157,7 +157,7 @@ describe('AdhocFilterEditPopover', () => {
expect(saveButton).toBeEnabled();
});
- it('disables save button when filter is invalid', () => {
+ test('disables save button when filter is invalid', () => {
renderPopover({ adhocFilter: faultyAdhocFilter });
const saveButton = screen.getByTestId(
@@ -166,7 +166,7 @@ describe('AdhocFilterEditPopover', () => {
expect(saveButton).toBeDisabled();
});
- it('initiates resize when resize handle is dragged', async () => {
+ test('initiates resize when resize handle is dragged', async () => {
const onResize = jest.fn();
renderPopover({ onResize });
@@ -178,7 +178,7 @@ describe('AdhocFilterEditPopover', () => {
expect(onResize).toHaveBeenCalled();
});
- it('closes popover when close button is clicked', async () => {
+ test('closes popover when close button is clicked', async () => {
const onClose = jest.fn();
renderPopover({ onClose });
diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/AdhocFilterEditPopoverSimpleTabContent.test.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/AdhocFilterEditPopoverSimpleTabContent.test.tsx
index 04018e819c..b923033d97 100644
--- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/AdhocFilterEditPopoverSimpleTabContent.test.tsx
+++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/AdhocFilterEditPopoverSimpleTabContent.test.tsx
@@ -147,11 +147,11 @@ jest.mock('@superset-ui/core', () => ({
const mockedIsFeatureEnabled = isFeatureEnabled as jest.Mock;
describe('AdhocFilterEditPopoverSimpleTabContent', () => {
- it('can render the simple tab form', () => {
+ test('can render the simple tab form', () => {
expect(() => setup()).not.toThrow();
});
- it('shows boolean only operators when subject is boolean', () => {
+ test('shows boolean only operators when subject is boolean', () => {
const props = setup({
adhocFilter: new AdhocFilter({
expressionType: ExpressionTypes.Simple,
@@ -179,7 +179,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
Operators.IsFalse,
].map(operator => expect(isOperatorRelevant(operator, 'value')).toBe(true));
});
- it('shows boolean only operators when subject is number', () => {
+ test('shows boolean only operators when subject is number', () => {
const props = setup({
adhocFilter: new AdhocFilter({
expressionType: ExpressionTypes.Simple,
@@ -208,7 +208,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
].map(operator => expect(isOperatorRelevant(operator, 'value')).toBe(true));
});
- it('will convert from individual comparator to array if the operator changes to multi', () => {
+ test('will convert from individual comparator to array if the operator changes to multi', () => {
const props = setup();
const { onOperatorChange } = useSimpleTabFilterProps(props);
onOperatorChange(Operators.In);
@@ -217,7 +217,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
expect(props.onChange.lastCall.args[0].operatorId).toEqual(Operators.In);
});
- it('will convert from array to individual comparators if the operator changes from multi', () => {
+ test('will convert from array to individual comparators if the operator changes from multi', () => {
const props = setup({
adhocFilter: simpleMultiAdhocFilter,
});
@@ -233,7 +233,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
);
});
- it('passes the new adhocFilter to onChange after onComparatorChange', () => {
+ test('passes the new adhocFilter to onChange after onComparatorChange', () => {
const props = setup();
const { onComparatorChange } = useSimpleTabFilterProps(props);
onComparatorChange('20');
@@ -243,13 +243,13 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
);
});
- it('will filter operators for table datasources', () => {
+ test('will filter operators for table datasources', () => {
const props = setup({ datasource: { type: 'table' } });
const { isOperatorRelevant } = useSimpleTabFilterProps(props);
expect(isOperatorRelevant(Operators.Like, 'value')).toBe(true);
});
- it('will show LATEST PARTITION operator', () => {
+ test('will show LATEST PARTITION operator', () => {
const props = setup({
datasource: {
type: 'table',
@@ -264,7 +264,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
expect(isOperatorRelevant(Operators.LatestPartition, 'value')).toBe(false);
});
- it('will generate custom sqlExpression for LATEST PARTITION operator', () => {
+ test('will generate custom sqlExpression for LATEST PARTITION operator', () => {
const testAdhocFilter = new AdhocFilter({
expressionType: ExpressionTypes.Simple,
subject: 'ds',
@@ -293,7 +293,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
}),
);
});
- it('will not display boolean operators when column type is string', () => {
+ test('will not display boolean operators when column type is string', () => {
const props = setup({
datasource: {
type: 'table',
@@ -309,7 +309,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
expect(isOperatorRelevant(operator, 'value')).toBe(false);
});
});
- it('will display boolean operators when column is an expression', () => {
+ test('will display boolean operators when column is an expression', () => {
const props = setup({
datasource: {
type: 'table',
@@ -330,7 +330,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
expect(isOperatorRelevant(operator, 'value')).toBe(true);
});
});
- it('sets comparator to undefined when operator is IS_TRUE', () => {
+ test('sets comparator to undefined when operator is IS_TRUE', () => {
const props = setup();
const { onOperatorChange } = useSimpleTabFilterProps(props);
onOperatorChange(Operators.IsTrue);
@@ -339,7 +339,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
expect(props.onChange.lastCall.args[0].operator).toBe('IS TRUE');
expect(props.onChange.lastCall.args[0].comparator).toBe(undefined);
});
- it('sets comparator to undefined when operator is IS_FALSE', () => {
+ test('sets comparator to undefined when operator is IS_FALSE', () => {
const props = setup();
const { onOperatorChange } = useSimpleTabFilterProps(props);
onOperatorChange(Operators.IsFalse);
@@ -348,7 +348,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
expect(props.onChange.lastCall.args[0].operator).toBe('IS FALSE');
expect(props.onChange.lastCall.args[0].comparator).toBe(undefined);
});
- it('sets comparator to undefined when operator is IS_NULL or IS_NOT_NULL', () => {
+ test('sets comparator to undefined when operator is IS_NULL or IS_NOT_NULL', () => {
const props = setup();
const { onOperatorChange } = useSimpleTabFilterProps(props);
[Operators.IsNull, Operators.IsNotNull].forEach(op => {
@@ -407,7 +407,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent Advanced data Type Test', () =>
isFeatureEnabledMock.mockRestore();
});
- it('should not call API when column has no advanced data type', async () => {
+ test('should not call API when column has no advanced data type', async () => {
fetchMock.resetHistory();
const props = getAdvancedDataTypeTestProps();
@@ -434,7 +434,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent Advanced data Type Test', () =>
);
});
- it('should call API when column has advanced data type', async () => {
+ test('should call API when column has advanced data type', async () => {
fetchMock.resetHistory();
const props = getAdvancedDataTypeTestProps({
@@ -471,7 +471,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent Advanced data Type Test', () =>
expect(props.validHandler.lastCall.args[0]).toBe(true);
});
- it('save button should be disabled if error message from API is returned', async () => {
+ test('save button should be disabled if error message from API is returned', async () => {
fetchMock.resetHistory();
const props = getAdvancedDataTypeTestProps({
@@ -508,7 +508,7 @@ describe('AdhocFilterEditPopoverSimpleTabContent Advanced data Type Test', () =>
expect(props.validHandler.lastCall.args[0]).toBe(false);
});
- it('advanced data type operator list should update after API response', async () => {
+ test('advanced data type operator list should update after API response', async () => {
fetchMock.resetHistory();
const props = getAdvancedDataTypeTestProps({
diff --git a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetric.test.js b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetric.test.js
index 4edc21572f..54cd85f87e 100644
--- a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetric.test.js
+++ b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetric.test.js
@@ -24,7 +24,7 @@ import AdhocMetric, {
const valueColumn = { type: 'DOUBLE', column_name: 'value' };
describe('AdhocMetric', () => {
- it('sets label, hasCustomLabel and optionName in constructor', () => {
+ test('sets label, hasCustomLabel and optionName in constructor', () => {
const adhocMetric = new AdhocMetric({
column: valueColumn,
aggregate: AGGREGATES.SUM,
@@ -42,7 +42,7 @@ describe('AdhocMetric', () => {
});
});
- it('can create altered duplicates', () => {
+ test('can create altered duplicates', () => {
const adhocMetric1 = new AdhocMetric({
column: valueColumn,
aggregate: AGGREGATES.SUM,
@@ -58,7 +58,7 @@ describe('AdhocMetric', () => {
expect(adhocMetric2.aggregate).toBe(AGGREGATES.AVG);
});
- it('can verify equality', () => {
+ test('can verify equality', () => {
const adhocMetric1 = new AdhocMetric({
column: valueColumn,
aggregate: AGGREGATES.SUM,
@@ -69,7 +69,7 @@ describe('AdhocMetric', () => {
expect(adhocMetric1.equals(adhocMetric2)).toBe(true);
});
- it('can verify inequality', () => {
+ test('can verify inequality', () => {
const adhocMetric1 = new AdhocMetric({
column: valueColumn,
aggregate: AGGREGATES.SUM,
@@ -95,7 +95,7 @@ describe('AdhocMetric', () => {
expect(adhocMetric3.equals(adhocMetric4)).toBe(false);
});
- it('updates label if hasCustomLabel is false', () => {
+ test('updates label if hasCustomLabel is false', () => {
const adhocMetric1 = new AdhocMetric({
column: valueColumn,
aggregate: AGGREGATES.SUM,
@@ -107,7 +107,7 @@ describe('AdhocMetric', () => {
expect(adhocMetric2.label).toBe('AVG(value)');
});
- it('keeps label if hasCustomLabel is true', () => {
+ test('keeps label if hasCustomLabel is true', () => {
const adhocMetric1 = new AdhocMetric({
column: valueColumn,
aggregate: AGGREGATES.SUM,
@@ -121,7 +121,7 @@ describe('AdhocMetric', () => {
expect(adhocMetric2.label).toBe('label1');
});
- it('can determine if it is valid', () => {
+ test('can determine if it is valid', () => {
const adhocMetric1 = new AdhocMetric({
expressionType: EXPRESSION_TYPES.SIMPLE,
column: valueColumn,
@@ -170,7 +170,7 @@ describe('AdhocMetric', () => {
expect(adhocMetric5.isValid()).toBe(false);
});
- it('can translate back from sql expressions to simple expressions when possible', () => {
+ test('can translate back from sql expressions to simple expressions when possible', () => {
const adhocMetric = new AdhocMetric({
expressionType: EXPRESSION_TYPES.SQL,
sqlExpression: 'AVG(my_column)',
@@ -190,7 +190,7 @@ describe('AdhocMetric', () => {
expect(adhocMetric2.inferSqlExpressionAggregate()).toBeNull();
});
- it('will infer columns and aggregates when converting to a simple expression', () => {
+ test('will infer columns and aggregates when converting to a simple expression', () => {
const adhocMetric = new AdhocMetric({
expressionType: EXPRESSION_TYPES.SQL,
sqlExpression: 'AVG(my_column)',
@@ -212,7 +212,7 @@ describe('AdhocMetric', () => {
expect(adhocMetric3.column.column_name).toBe('value');
});
- it('should transform count_distinct SQL and do not change label if does not set metric label', () => {
+ test('should transform count_distinct SQL and do not change label if does not set metric label', () => {
const withBrackets = new AdhocMetric({
column: { type: 'TEXT', column_name: '(column-with-barckets)' },
aggregate: AGGREGATES.COUNT_DISTINCT,
diff --git a/superset-frontend/src/explore/components/controls/MetricControl/AggregateOption.test.tsx b/superset-frontend/src/explore/components/controls/MetricControl/AggregateOption.test.tsx
index e249e184c5..c923e4d52f 100644
--- a/superset-frontend/src/explore/components/controls/MetricControl/AggregateOption.test.tsx
+++ b/superset-frontend/src/explore/components/controls/MetricControl/AggregateOption.test.tsx
@@ -21,7 +21,7 @@ import { render, screen } from 'spec/helpers/testing-library';
import AggregateOption from 'src/explore/components/controls/MetricControl/AggregateOption';
describe('AggregateOption', () => {
- it('renders the aggregate', () => {
+ test('renders the aggregate', () => {
render(<AggregateOption aggregate={{ aggregate_name: 'SUM' }} />);
const aggregateOption = screen.getByText(/sum/i);
diff --git a/superset-frontend/src/explore/components/controls/MetricControl/FilterDefinitionOption.test.jsx b/superset-frontend/src/explore/components/controls/MetricControl/FilterDefinitionOption.test.jsx
index e03f8cf955..774ec57dab 100644
--- a/superset-frontend/src/explore/components/controls/MetricControl/FilterDefinitionOption.test.jsx
+++ b/superset-frontend/src/explore/components/controls/MetricControl/FilterDefinitionOption.test.jsx
@@ -37,17 +37,17 @@ const sumValueAdhocMetric = new AdhocMetric({
});
describe('FilterDefinitionOption', () => {
- it('renders a StyledColumnOption given a column', async () => {
+ test('renders a StyledColumnOption given a column', async () => {
render(<FilterDefinitionOption option={{ column_name: 'a_column' }} />);
await expect(screen.getByText('a_column')).toBeVisible();
});
- it('renders a StyledColumnOption given an adhoc metric', async () => {
+ test('renders a StyledColumnOption given an adhoc metric', async () => {
render(<FilterDefinitionOption option={sumValueAdhocMetric} />);
await expect(screen.getByText('SUM(source)')).toBeVisible();
});
- it('renders the metric name given a saved metric', async () => {
+ test('renders the metric name given a saved metric', async () => {
render(
<FilterDefinitionOption
option={{ saved_metric_name: 'my_custom_metric' }}
diff --git a/superset-frontend/src/explore/components/controls/SelectControl.test.jsx b/superset-frontend/src/explore/components/controls/SelectControl.test.jsx
index 25d88a8eb2..29e5c7a3b8 100644
--- a/superset-frontend/src/explore/components/controls/SelectControl.test.jsx
+++ b/superset-frontend/src/explore/components/controls/SelectControl.test.jsx
@@ -67,14 +67,14 @@ const renderSelectControl = (props = {}) => {
};
describe('SelectControl', () => {
- it('calls props.onChange when select', async () => {
+ test('calls props.onChange when select', async () => {
renderSelectControl();
defaultProps.onChange(50);
expect(defaultProps.onChange).toHaveBeenCalledWith(50);
});
describe('render', () => {
- it('renders with Select by default', () => {
+ test('renders with Select by default', () => {
renderSelectControl();
const selectorWrapper = screen.getByLabelText('Row Limit', {
selector: 'div',
@@ -87,7 +87,7 @@ describe('SelectControl', () => {
expect(selectorInput).toBeInTheDocument();
});
- it('renders as mode multiple', () => {
+ test('renders as mode multiple', () => {
renderSelectControl({ multi: true });
const selectorWrapper = screen.getByLabelText('Row Limit', {
selector: 'div',
@@ -102,7 +102,7 @@ describe('SelectControl', () => {
expect(screen.getByText('Select all (3)')).toBeInTheDocument();
});
- it('renders with allowNewOptions when freeForm', () => {
+ test('renders with allowNewOptions when freeForm', () => {
renderSelectControl({ freeForm: true });
const selectorWrapper = screen.getByLabelText('Row Limit', {
selector: 'div',
@@ -123,7 +123,7 @@ describe('SelectControl', () => {
);
});
- it('renders with allowNewOptions=false when freeForm=false', () => {
+ test('renders with allowNewOptions=false when freeForm=false', () => {
const container = renderSelectControl({ freeForm: false });
const selectorWrapper = screen.getByLabelText('Row Limit', {
selector: 'div',
@@ -148,7 +148,7 @@ describe('SelectControl', () => {
).toBeInTheDocument();
});
- it('renders with tokenSeparators', () => {
+ test('renders with tokenSeparators', () => {
renderSelectControl({ tokenSeparators: ['\n', '\t', ';'], multi: true });
const selectorWrapper = screen.getByLabelText('Row Limit', {
selector: 'div',
@@ -176,7 +176,7 @@ describe('SelectControl', () => {
describe('empty placeholder', () => {
describe('withMulti', () => {
- it('does not show a placeholder if there are no choices', () => {
+ test('does not show a placeholder if there are no choices', () => {
renderSelectControl({
choices: [],
multi: true,
@@ -186,7 +186,7 @@ describe('SelectControl', () => {
});
});
describe('withSingleChoice', () => {
- it('does not show a placeholder if there are no choices', async () => {
+ test('does not show a placeholder if there are no choices', async () => {
const container = renderSelectControl({
choices: [],
multi: false,
@@ -198,7 +198,7 @@ describe('SelectControl', () => {
});
});
describe('all choices selected', () => {
- it('does not show a placeholder', () => {
+ test('does not show a placeholder', () => {
const container = renderSelectControl({
multi: true,
value: ['today', '1 year ago'],
@@ -211,7 +211,7 @@ describe('SelectControl', () => {
});
});
describe('when select is multi', () => {
- it('does not render the placeholder when a selection has been made', () => {
+ test('does not render the placeholder when a selection has been made', () => {
renderSelectControl({
multi: true,
value: ['today'],
@@ -221,7 +221,7 @@ describe('SelectControl', () => {
});
});
describe('when select is single', () => {
- it('does not render the placeholder when a selection has been made', () => {
+ test('does not render the placeholder when a selection has been made', () => {
renderSelectControl({
multi: true,
value: 50,
@@ -233,13 +233,13 @@ describe('SelectControl', () => {
});
describe('getOptions', () => {
- it('returns the correct options', () => {
+ test('returns the correct options', () => {
expect(innerGetOptions(defaultProps)).toEqual(options);
});
});
describe('areAllValuesNumbers', () => {
- it('returns true when all values are numbers (array format)', () => {
+ test('returns true when all values are numbers (array format)', () => {
const items = [
[1, 'One'],
[2, 'Two'],
@@ -248,7 +248,7 @@ describe('SelectControl', () => {
expect(areAllValuesNumbers(items)).toBe(true);
});
- it('returns false when some values are not numbers (array format)', () => {
+ test('returns false when some values are not numbers (array format)', () => {
const items = [
[1, 'One'],
['two', 'Two'],
@@ -257,7 +257,7 @@ describe('SelectControl', () => {
expect(areAllValuesNumbers(items)).toBe(false);
});
- it('returns true when all values are numbers (object format)', () => {
+ test('returns true when all values are numbers (object format)', () => {
const items = [
{ value: 1, label: 'One' },
{ value: 2, label: 'Two' },
@@ -266,7 +266,7 @@ describe('SelectControl', () => {
expect(areAllValuesNumbers(items)).toBe(true);
});
- it('returns false when some values are not numbers (object format)', () => {
+ test('returns false when some values are not numbers (object format)', () => {
const items = [
{ value: 1, label: 'One' },
{ value: 'two', label: 'Two' },
@@ -275,17 +275,17 @@ describe('SelectControl', () => {
expect(areAllValuesNumbers(items)).toBe(false);
});
- it('returns true when all values are numbers (primitive format)', () => {
+ test('returns true when all values are numbers (primitive format)', () => {
const items = [1, 2, 3];
expect(areAllValuesNumbers(items)).toBe(true);
});
- it('returns false when some values are not numbers (primitive format)', () => {
+ test('returns false when some values are not numbers (primitive format)', () => {
const items = [1, 'two', 3];
expect(areAllValuesNumbers(items)).toBe(false);
});
- it('works with custom valueKey', () => {
+ test('works with custom valueKey', () => {
const items = [
{ id: 1, label: 'One' },
{ id: 2, label: 'Two' },
@@ -294,7 +294,7 @@ describe('SelectControl', () => {
expect(areAllValuesNumbers(items, 'id')).toBe(true);
});
- it('returns false for empty items', () => {
+ test('returns false for empty items', () => {
expect(areAllValuesNumbers([])).toBe(false);
expect(areAllValuesNumbers(null)).toBe(false);
expect(areAllValuesNumbers(undefined)).toBe(false);
@@ -304,7 +304,7 @@ describe('SelectControl', () => {
describe('getSortComparator', () => {
const mockExplicitComparator = (a, b) => a.label.localeCompare(b.label);
- it('returns explicit comparator when provided', () => {
+ test('returns explicit comparator when provided', () => {
const choices = [
[1, 'One'],
[2, 'Two'],
@@ -318,7 +318,7 @@ describe('SelectControl', () => {
expect(result).toBe(mockExplicitComparator);
});
- it('returns number comparator for numeric choices', () => {
+ test('returns number comparator for numeric choices', () => {
const choices = [
[1, 'One'],
[2, 'Two'],
@@ -328,7 +328,7 @@ describe('SelectControl', () => {
expect(result).not.toBe(mockExplicitComparator);
});
- it('returns number comparator for numeric options', () => {
+ test('returns number comparator for numeric options', () => {
const options = [
{ value: 1, label: 'One' },
{ value: 2, label: 'Two' },
@@ -338,7 +338,7 @@ describe('SelectControl', () => {
expect(result).not.toBe(mockExplicitComparator);
});
- it('prioritizes options over choices when both are numeric', () => {
+ test('prioritizes options over choices when both are numeric', () => {
const choices = [
[1, 'One'],
[2, 'Two'],
@@ -351,7 +351,7 @@ describe('SelectControl', () => {
expect(typeof result).toBe('function');
});
- it('returns undefined for non-numeric choices', () => {
+ test('returns undefined for non-numeric choices', () => {
const choices = [
['one', 'One'],
['two', 'Two'],
@@ -360,7 +360,7 @@ describe('SelectControl', () => {
expect(result).toBeUndefined();
});
- it('returns undefined for non-numeric options', () => {
+ test('returns undefined for non-numeric options', () => {
const options = [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' },
@@ -369,14 +369,14 @@ describe('SelectControl', () => {
expect(result).toBeUndefined();
});
- it('returns undefined when no choices or options provided', () => {
+ test('returns undefined when no choices or options provided', () => {
const result = getSortComparator(null, null, 'value', null);
expect(result).toBeUndefined();
});
});
describe('numeric sorting integration', () => {
- it('applies numeric sorting to choices automatically', () => {
+ test('applies numeric sorting to choices automatically', () => {
const numericChoices = [
[3, 'Three'],
[1, 'One'],
@@ -392,7 +392,7 @@ describe('SelectControl', () => {
expect(selectorWrapper).toBeInTheDocument();
});
- it('applies numeric sorting to options automatically', () => {
+ test('applies numeric sorting to options automatically', () => {
const numericOptions = [
{ value: 3, label: 'Three' },
{ value: 1, label: 'One' },
@@ -407,7 +407,7 @@ describe('SelectControl', () => {
expect(selectorWrapper).toBeInTheDocument();
});
- it('does not apply numeric sorting to mixed-type choices', () => {
+ test('does not apply numeric sorting to mixed-type choices', () => {
const mixedChoices = [
[1, 'One'],
['two', 'Two'],
@@ -422,7 +422,7 @@ describe('SelectControl', () => {
expect(selectorWrapper).toBeInTheDocument();
});
- it('respects explicit sortComparator over automatic numeric sorting', () => {
+ test('respects explicit sortComparator over automatic numeric sorting', () => {
const numericChoices = [
[3, 'Three'],
[1, 'One'],
diff --git a/superset-frontend/src/explore/components/controls/TextAreaControl.test.jsx b/superset-frontend/src/explore/components/controls/TextAreaControl.test.jsx
index dff4d3ef54..c3deaa5ce3 100644
--- a/superset-frontend/src/explore/components/controls/TextAreaControl.test.jsx
+++ b/superset-frontend/src/explore/components/controls/TextAreaControl.test.jsx
@@ -32,19 +32,19 @@ const defaultProps = {
};
describe('TextArea', () => {
- it('renders a FormControl', () => {
+ test('renders a FormControl', () => {
render(<TextAreaControl {...defaultProps} />);
expect(screen.getByRole('textbox')).toBeVisible();
});
- it('calls onChange when toggled', () => {
+ test('calls onChange when toggled', () => {
render(<TextAreaControl {...defaultProps} />);
const textArea = screen.getByRole('textbox');
fireEvent.change(textArea, { target: { value: 'x' } });
expect(defaultProps.onChange).toHaveBeenCalledWith('x');
});
- it('renders a AceEditor when language is specified', async () => {
+ test('renders a AceEditor when language is specified', async () => {
const props = { ...defaultProps, language: 'markdown' };
const { container } = render(<TextAreaControl {...props} />);
expect(screen.queryByRole('textbox')).not.toBeInTheDocument();
@@ -53,7 +53,7 @@ describe('TextArea', () => {
});
});
- it('calls onAreaEditorChange when entering in the AceEditor', () => {
+ test('calls onAreaEditorChange when entering in the AceEditor', () => {
const props = { ...defaultProps, language: 'markdown' };
render(<TextAreaControl {...props} />);
const textArea = screen.getByRole('textbox');
diff --git a/superset-frontend/src/explore/components/controls/TimeOffsetControl.test.tsx b/superset-frontend/src/explore/components/controls/TimeOffsetControl.test.tsx
index fac75f662a..30f02dbb17 100644
--- a/superset-frontend/src/explore/components/controls/TimeOffsetControl.test.tsx
+++ b/superset-frontend/src/explore/components/controls/TimeOffsetControl.test.tsx
@@ -55,7 +55,7 @@ describe('TimeOffsetControls', () => {
return { store, props };
};
- it('TimeOffsetControl renders DatePicker when startDate is set', () => {
+ test('TimeOffsetControl renders DatePicker when startDate is set', () => {
setup();
const datePickerInput = screen.getByRole('textbox');
expect(datePickerInput).toBeInTheDocument();
@@ -64,7 +64,7 @@ describe('TimeOffsetControls', () => {
// Our Time comparison control depends on this string for supporting date deletion on date picker
// That's why this test is linked to the TimeOffsetControl component
- it('Dayjs should return "Invalid date" when parsing an invalid date string', () => {
+ test('Dayjs should return "Invalid date" when parsing an invalid date string', () => {
const invalidDate = extendedDayjs('not-a-date');
expect(invalidDate.format()).toBe(INVALID_DATE);
});
diff --git a/superset-frontend/src/explore/components/controls/ViewportControl.test.jsx b/superset-frontend/src/explore/components/controls/ViewportControl.test.jsx
index df4fea1e8e..983ba48b75 100644
--- a/superset-frontend/src/explore/components/controls/ViewportControl.test.jsx
+++ b/superset-frontend/src/explore/components/controls/ViewportControl.test.jsx
@@ -37,18 +37,18 @@ describe('ViewportControl', () => {
render(<ViewportControl {...defaultProps} />);
});
- it('renders a OverlayTrigger if clicked', () => {
+ test('renders a OverlayTrigger if clicked', () => {
expect(screen.getByTestId('foo-header')).toBeInTheDocument(); // Presence of ControlHeader
userEvent.click(screen.getByText(renderedCoordinate));
expect(screen.getByText('Viewport')).toBeInTheDocument(); // Presence of Popover
});
- it('renders a Popover with 5 TextControl if clicked', () => {
+ test('renders a Popover with 5 TextControl if clicked', () => {
userEvent.click(screen.getByText(renderedCoordinate));
expect(screen.queryAllByTestId('inline-name')).toHaveLength(5);
});
- it('renders a summary in the label', () => {
+ test('renders a summary in the label', () => {
expect(screen.getByText(renderedCoordinate)).toBeInTheDocument();
});
});
diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.jsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.jsx
index 1451ef9b54..833e019563 100644
--- a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.jsx
+++ b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.jsx
@@ -85,7 +85,7 @@ describe('VizTypeControl', () => {
await waitForEffects();
}, 30000); // Increase beforeEach timeout
- it('calls onChange when submitted', async () => {
+ test('calls onChange when submitted', async () => {
const thumbnail = await screen.findByTestId('viztype-selector-container', {
timeout: 15000,
});
@@ -106,7 +106,7 @@ describe('VizTypeControl', () => {
expect(defaultProps.onChange.called).toBe(true);
}, 30000);
- it('filters images based on text input', async () => {
+ test('filters images based on text input', async () => {
const thumbnails = await screen.findByTestId('viztype-selector-container', {
timeout: 15000,
});
diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx
index 2ebe403d3d..db91cb67ba 100644
--- a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx
+++ b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx
@@ -116,7 +116,7 @@ describe('VizTypeControl', () => {
jest.clearAllMocks();
});
- it('Fast viz switcher tiles render', async () => {
+ test('Fast viz switcher tiles render', async () => {
const props = {
...defaultProps,
value: VizType.Line,
@@ -151,7 +151,7 @@ describe('VizTypeControl', () => {
).toBeInTheDocument();
});
- it('Render viz tiles when non-featured chart is selected', async () => {
+ test('Render viz tiles when non-featured chart is selected', async () => {
const props = {
...defaultProps,
value: 'line',
@@ -165,7 +165,7 @@ describe('VizTypeControl', () => {
).toBeVisible();
});
- it('Render viz tiles when non-featured is rendered', async () => {
+ test('Render viz tiles when non-featured is rendered', async () => {
const props = {
...defaultProps,
value: VizType.Sankey,
@@ -192,7 +192,7 @@ describe('VizTypeControl', () => {
).toBeVisible();
});
- it('Change viz type on click', async () => {
+ test('Change viz type on click', async () => {
const props = {
...defaultProps,
value: VizType.Line,
@@ -209,7 +209,7 @@ describe('VizTypeControl', () => {
expect(props.onChange).toHaveBeenCalledWith('table');
});
- it('Open viz gallery modal on "View all charts" click', async () => {
+ test('Open viz gallery modal on "View all charts" click', async () => {
await waitForRenderWrapper({ ...defaultProps, isModalOpenInit: false });
expect(
screen.queryByText('Select a visualization type'),
@@ -220,7 +220,7 @@ describe('VizTypeControl', () => {
).toBeInTheDocument();
});
- it('Search visualization type', async () => {
+ test('Search visualization type', async () => {
await waitForRenderWrapper();
const visualizations = screen.getByTestId(getTestId('viz-row'));
@@ -248,7 +248,7 @@ describe('VizTypeControl', () => {
).not.toBeInTheDocument();
});
- it('Submit on viz type double-click', async () => {
+ test('Submit on viz type double-click', async () => {
await waitForRenderWrapper();
userEvent.click(screen.getByRole('tab', { name: 'All charts' }));
const visualizations = screen.getByTestId(getTestId('viz-row'));
@@ -260,7 +260,7 @@ describe('VizTypeControl', () => {
expect(defaultProps.onChange).toHaveBeenCalledWith(VizType.Line);
});
- it('Search input is focused when modal opens', async () => {
+ test('Search input is focused when modal opens', async () => {
// Mock the focus method to track if it was called
const focusSpy = jest.fn();
const originalFocus = HTMLInputElement.prototype.focus;
@@ -278,7 +278,7 @@ describe('VizTypeControl', () => {
HTMLInputElement.prototype.focus = originalFocus;
});
- it('Navigate categories and select visualization type', async () => {
+ test('Navigate categories and select visualization type', async () => {
await waitForRenderWrapper();
const visualizations = screen.getByTestId(getTestId('viz-row'));
@@ -308,7 +308,7 @@ describe('VizTypeControl', () => {
expect(defaultProps.onChange).toHaveBeenCalledWith(VizType.BigNumberTotal);
});
- it('Handle category switching between different chart types', async () => {
+ test('Handle category switching between different chart types', async () => {
await waitForRenderWrapper();
const visualizations = screen.getByTestId(getTestId('viz-row'));
diff --git a/superset-frontend/src/explore/components/controls/ZoomConfigControl/zoomUtil.test.ts b/superset-frontend/src/explore/components/controls/ZoomConfigControl/zoomUtil.test.ts
index 95756ad02f..68e7a5a6c0 100644
--- a/superset-frontend/src/explore/components/controls/ZoomConfigControl/zoomUtil.test.ts
+++ b/superset-frontend/src/explore/components/controls/ZoomConfigControl/zoomUtil.test.ts
@@ -37,7 +37,7 @@ const zoomConfigValues = {
describe('zoomUtil', () => {
describe('computeConfigValues', () => {
- it('computes fixed values', () => {
+ test('computes fixed values', () => {
const height = 100;
const width = 100;
@@ -60,7 +60,7 @@ describe('zoomUtil', () => {
});
});
- it('computes linear values', () => {
+ test('computes linear values', () => {
const height = 100;
const width = 100;
@@ -85,7 +85,7 @@ describe('zoomUtil', () => {
});
});
- it('computes exponential values', () => {
+ test('computes exponential values', () => {
const height = 100;
const width = 100;
@@ -113,7 +113,7 @@ describe('zoomUtil', () => {
});
describe('zoomConfigsToData', () => {
- it('returns correct output', () => {
+ test('returns correct output', () => {
const result = zoomConfigsToData(zoomConfigValues);
expect(result.length).toEqual(Object.keys(zoomConfigValues).length);
@@ -129,11 +129,11 @@ describe('zoomUtil', () => {
};
const result = toFixedConfig(configs);
- it('has correct type', () => {
+ test('has correct type', () => {
expect(result.type).toEqual('FIXED');
});
- it('returns correct result', () => {
+ test('returns correct result', () => {
expect(result.values[4]).toEqual({
width: 100,
height: 100,
@@ -155,11 +155,11 @@ describe('zoomUtil', () => {
};
const result = toLinearConfig(configs);
- it('has correct type', () => {
+ test('has correct type', () => {
expect(result.type).toEqual('LINEAR');
});
- it('returns correct result', () => {
+ test('returns correct result', () => {
expect(result.values[4]).toEqual({
width: 98,
height: 98,
@@ -181,10 +181,10 @@ describe('zoomUtil', () => {
};
// @ts-ignore
const result = toExpConfig(configs);
- it('has correct type', () => {
+ test('has correct type', () => {
expect(result.type).toEqual('EXP');
});
- it('returns correct result', () => {
+ test('returns correct result', () => {
expect(result.values[4]).toEqual({
width: 93,
height: 93,
diff --git a/superset-frontend/src/explore/components/controls/withAsyncVerification.test.tsx b/superset-frontend/src/explore/components/controls/withAsyncVerification.test.tsx
index cef0c74002..eaa7f6f9db 100644
--- a/superset-frontend/src/explore/components/controls/withAsyncVerification.test.tsx
+++ b/superset-frontend/src/explore/components/controls/withAsyncVerification.test.tsx
@@ -83,7 +83,7 @@ async function setup({
}
describe('VerifiedMetricsControl', () => {
- it('should call verify correctly', async () => {
+ test('should call verify correctly', async () => {
expect.assertions(3);
const { verifier, props, rerender, VerifiedControl } = await setup();
@@ -100,7 +100,7 @@ describe('VerifiedMetricsControl', () => {
);
});
- it('should trigger onChange event', async () => {
+ test('should trigger onChange event', async () => {
expect.assertions(2);
const mockOnChange = jest.fn();
const { verifier, props } = await setup({
diff --git a/superset-frontend/src/explore/controlPanels/Separator.test.ts b/superset-frontend/src/explore/controlPanels/Separator.test.ts
index 42212c4927..989b974f61 100644
--- a/superset-frontend/src/explore/controlPanels/Separator.test.ts
+++ b/superset-frontend/src/explore/controlPanels/Separator.test.ts
@@ -53,14 +53,14 @@ function getCodeControlMapStateToProps() {
}
describe('Separator control panel config', () => {
- it('defaults language to markdown when markup_type is missing', () => {
+ test('defaults language to markdown when markup_type is missing', () => {
const mapStateToProps = getCodeControlMapStateToProps();
const state: Partial<ControlPanelState> = {};
const result = mapStateToProps(state);
expect(result.language).toBe('markdown');
});
- it('uses markup_type value when provided', () => {
+ test('uses markup_type value when provided', () => {
const mapStateToProps = getCodeControlMapStateToProps();
const state: Partial<ControlPanelState> = {
controls: {
diff --git a/superset-frontend/src/explore/controlUtils/controlUtils.test.tsx b/superset-frontend/src/explore/controlUtils/controlUtils.test.tsx
index 24fb753b8f..cd99cd66f6 100644
--- a/superset-frontend/src/explore/controlUtils/controlUtils.test.tsx
+++ b/superset-frontend/src/explore/controlUtils/controlUtils.test.tsx
@@ -94,12 +94,12 @@ describe('controlUtils', () => {
});
describe('getControlConfig', () => {
- it('returns a valid spatial controlConfig', () => {
+ test('returns a valid spatial controlConfig', () => {
const spatialControl = getControlConfig('color_scheme', 'test-chart');
expect(spatialControl?.type).toEqual('ColorSchemeControl');
});
- it('overrides according to vizType', () => {
+ test('overrides according to vizType', () => {
let control = getKnownControlConfig('color_scheme', 'test-chart');
expect(control.label).toEqual('Color Scheme');
@@ -107,7 +107,7 @@ describe('controlUtils', () => {
expect(control.label).toEqual('My beautiful colors');
});
- it(
+ test(
'returns correct control config when control config is defined ' +
'in the control panel definition',
() => {
@@ -130,7 +130,7 @@ describe('controlUtils', () => {
});
describe('applyMapStateToPropsToControl,', () => {
- it('applies state to props as expected', () => {
+ test('applies state to props as expected', () => {
let control = getKnownControlConfig('all_columns', 'table');
control = applyMapStateToPropsToControl(control, state);
expect(control.options).toEqual([{ column_name: 'a' }]);
@@ -138,18 +138,18 @@ describe('controlUtils', () => {
});
describe('getControlState', () => {
- it('to still have the functions', () => {
+ test('to still have the functions', () => {
const control = getKnownControlState('metrics', 'table', state, 'a');
expect(typeof control.mapStateToProps).toBe('function');
expect(typeof control.validators?.[0]).toBe('function');
});
- it('to make sure value is array', () => {
+ test('to make sure value is array', () => {
const control = getKnownControlState('all_columns', 'table', state, 'a');
expect(control.value).toEqual(['a']);
});
- it('removes missing/invalid choice', () => {
+ test('removes missing/invalid choice', () => {
let control = getControlState(
'stacked_style',
'test-chart',
@@ -162,22 +162,22 @@ describe('controlUtils', () => {
expect(control?.value).toBeNull();
});
- it('returns null for nonexistent field', () => {
+ test('returns null for nonexistent field', () => {
const control = getControlState('NON_EXISTENT', 'table', state);
expect(control).toBeNull();
});
- it('metrics control should be empty by default', () => {
+ test('metrics control should be empty by default', () => {
const control = getControlState('metrics', 'table', state);
expect(control?.default).toBeUndefined();
});
- it('metric control should be empty by default', () => {
+ test('metric control should be empty by default', () => {
const control = getControlState('metric', 'table', state);
expect(control?.default).toBeUndefined();
});
- it('should not apply mapStateToProps when initializing', () => {
+ test('should not apply mapStateToProps when initializing', () => {
const control = getControlState('metrics', 'table', {
...state,
controls: undefined,
@@ -187,11 +187,11 @@ describe('controlUtils', () => {
});
describe('validateControl', () => {
- it('validates the control, returns an error if empty', () => {
+ test('validates the control, returns an error if empty', () => {
const control = getControlState('metric', 'table', state, null);
expect(control?.validationErrors).toEqual(['cannot be empty']);
});
- it('should not validate if control panel is initializing', () => {
+ test('should not validate if control panel is initializing', () => {
const control = getControlState(
'metric',
'table',
@@ -203,7 +203,7 @@ describe('controlUtils', () => {
});
describe('findControlItem', () => {
- it('find control as a string', () => {
+ test('find control as a string', () => {
const controlItem = findControlItem(
controlPanelSectionsChartOptions,
'color_scheme',
@@ -211,7 +211,7 @@ describe('controlUtils', () => {
expect(controlItem).toEqual('color_scheme');
});
- it('find control as a control object', () => {
+ test('find control as a control object', () => {
let controlItem = findControlItem(
controlPanelSectionsChartOptions,
'rose_area_proportion',
@@ -227,7 +227,7 @@ describe('controlUtils', () => {
expect(controlItem).toHaveProperty('config');
});
- it('returns null when key is not found', () => {
+ test('returns null when key is not found', () => {
const controlItem = findControlItem(
controlPanelSectionsChartOptions,
'non_existing_key',
diff --git a/superset-frontend/src/explore/exploreUtils/exploreUtils.test.jsx b/superset-frontend/src/explore/exploreUtils/exploreUtils.test.jsx
index 61dbf138ef..bec522814a 100644
--- a/superset-frontend/src/explore/exploreUtils/exploreUtils.test.jsx
+++ b/superset-frontend/src/explore/exploreUtils/exploreUtils.test.jsx
@@ -40,7 +40,7 @@ describe('exploreUtils', () => {
}
describe('getExploreUrl', () => {
- it('generates proper base url', () => {
+ test('generates proper base url', () => {
// This assertion is to show clearly the value of location.href
// in the context of unit tests.
expect(location.href).toBe('http://localhost/');
@@ -53,7 +53,7 @@ describe('exploreUtils', () => {
});
compareURI(URI(url), URI('/explore/'));
});
- it('generates proper json url', () => {
+ test('generates proper json url', () => {
const url = getExploreUrl({
formData,
endpointType: 'json',
@@ -62,7 +62,7 @@ describe('exploreUtils', () => {
});
compareURI(URI(url), URI('/superset/explore_json/'));
});
- it('generates proper json forced url', () => {
+ test('generates proper json forced url', () => {
const url = getExploreUrl({
formData,
endpointType: 'json',
@@ -74,7 +74,7 @@ describe('exploreUtils', () => {
URI('/superset/explore_json/').search({ force: 'true' }),
);
});
- it('generates proper csv URL', () => {
+ test('generates proper csv URL', () => {
const url = getExploreUrl({
formData,
endpointType: 'csv',
@@ -86,7 +86,7 @@ describe('exploreUtils', () => {
URI('/superset/explore_json/').search({ csv: 'true' }),
);
});
- it('generates proper standalone URL', () => {
+ test('generates proper standalone URL', () => {
const url = getExploreUrl({
formData,
endpointType: 'standalone',
@@ -100,7 +100,7 @@ describe('exploreUtils', () => {
}),
);
});
- it('preserves main URLs params', () => {
+ test('preserves main URLs params', () => {
const url = getExploreUrl({
formData,
endpointType: 'json',
@@ -112,7 +112,7 @@ describe('exploreUtils', () => {
URI('/superset/explore_json/').search({ foo: 'bar' }),
);
});
- it('generate proper save slice url', () => {
+ test('generate proper save slice url', () => {
const url = getExploreUrl({
formData,
endpointType: 'json',
@@ -143,7 +143,7 @@ describe('exploreUtils', () => {
stub.restore();
});
- it('generate url to different domains', () => {
+ test('generate url to different domains', () => {
let url = getExploreUrl({
formData,
endpointType: 'json',
@@ -175,7 +175,7 @@ describe('exploreUtils', () => {
});
expect(url).toMatch(availableDomains[1]);
});
- it('not generate url to different domains without flag', () => {
+ test('not generate url to different domains without flag', () => {
let csvURL = getExploreUrl({
formData,
endpointType: 'csv',
@@ -191,7 +191,7 @@ describe('exploreUtils', () => {
});
describe('buildV1ChartDataPayload', () => {
- it('generate valid request payload despite no registered buildQuery', async () => {
+ test('generate valid request payload despite no registered buildQuery', async () => {
const v1RequestPayload = await buildV1ChartDataPayload({
formData: { ...formData, viz_type: 'my_custom_viz' },
});
@@ -210,7 +210,7 @@ describe('exploreUtils', () => {
getChartMetadataRegistry().remove('my_legacy_viz').remove('my_v1_viz');
});
- it('returns true for legacy viz', () => {
+ test('returns true for legacy viz', () => {
const [useLegacyApi, parseMethod] = getQuerySettings({
...formData,
viz_type: 'my_legacy_viz',
@@ -219,7 +219,7 @@ describe('exploreUtils', () => {
expect(parseMethod).toBe('json-bigint');
});
- it('returns false for v1 viz', () => {
+ test('returns false for v1 viz', () => {
const [useLegacyApi, parseMethod] = getQuerySettings({
...formData,
viz_type: 'my_v1_viz',
@@ -228,7 +228,7 @@ describe('exploreUtils', () => {
expect(parseMethod).toBe('json-bigint');
});
- it('returns false for formData with unregistered viz_type', () => {
+ test('returns false for formData with unregistered viz_type', () => {
const [useLegacyApi, parseMethod] = getQuerySettings({
...formData,
viz_type: 'undefined_viz',
@@ -237,7 +237,7 @@ describe('exploreUtils', () => {
expect(parseMethod).toBe('json-bigint');
});
- it('returns false for formData without viz_type', () => {
+ test('returns false for formData without viz_type', () => {
const [useLegacyApi, parseMethod] = getQuerySettings(formData);
expect(useLegacyApi).toBe(false);
expect(parseMethod).toBe('json-bigint');
@@ -245,20 +245,20 @@ describe('exploreUtils', () => {
});
describe('getSimpleSQLExpression', () => {
- it('returns empty string when subject is undefined', () => {
+ test('returns empty string when subject is undefined', () => {
expect(getSimpleSQLExpression(undefined, '=', 10)).toBe('');
expect(getSimpleSQLExpression()).toBe('');
});
- it("returns subject when it's provided and operator is undefined", () => {
+ test("returns subject when it's provided and operator is undefined", () => {
expect(getSimpleSQLExpression('col', undefined, 10)).toBe('col');
expect(getSimpleSQLExpression('col')).toBe('col');
});
- it("returns subject and operator when they're provided and comparator is undefined", () => {
+ test("returns subject and operator when they're provided and comparator is undefined", () => {
expect(getSimpleSQLExpression('col', '=')).toBe('col =');
expect(getSimpleSQLExpression('col', 'IN')).toBe('col IN');
expect(getSimpleSQLExpression('col', 'IN', [])).toBe('col IN');
});
- it('returns full expression when subject, operator and comparator are provided', () => {
+ test('returns full expression when subject, operator and comparator are provided', () => {
expect(getSimpleSQLExpression('col', '=', 'comp')).toBe("col = 'comp'");
expect(getSimpleSQLExpression('col', '=', "it's an apostrophe")).toBe(
"col = 'it''s an apostrophe'",
@@ -282,7 +282,7 @@ describe('exploreUtils', () => {
});
describe('.exploreChart()', () => {
- it('postForm', () => {
+ test('postForm', () => {
const postFormSpy = jest.spyOn(SupersetClient, 'postForm');
postFormSpy.mockImplementation(jest.fn());
diff --git a/superset-frontend/src/explore/exploreUtils/getChartDataUri.test.ts b/superset-frontend/src/explore/exploreUtils/getChartDataUri.test.ts
index c4f0e82bdc..4eed81990e 100644
--- a/superset-frontend/src/explore/exploreUtils/getChartDataUri.test.ts
+++ b/superset-frontend/src/explore/exploreUtils/getChartDataUri.test.ts
@@ -26,7 +26,7 @@ describe('Get ChartUri', () => {
(path: string) => `/prefix${path}`,
);
- it('Get ChartUri when allowDomainSharding:false', () => {
+ test('Get ChartUri when allowDomainSharding:false', () => {
expect(
getChartDataUri({
path: '/path',
@@ -53,7 +53,7 @@ describe('Get ChartUri', () => {
});
});
- it('Get ChartUri when allowDomainSharding:true', () => {
+ test('Get ChartUri when allowDomainSharding:true', () => {
expect(
getChartDataUri({
path: '/path-allowDomainSharding-true',
diff --git a/superset-frontend/src/explore/store.test.jsx b/superset-frontend/src/explore/store.test.jsx
index e308c88eb5..69c2022671 100644
--- a/superset-frontend/src/explore/store.test.jsx
+++ b/superset-frontend/src/explore/store.test.jsx
@@ -41,7 +41,7 @@ describe('store', () => {
SCOPED_FILTER: false,
};
- it('applies default to formData if the key is missing', () => {
+ test('applies default to formData if the key is missing', () => {
const inputFormData = {
datasource: '11_table',
viz_type: 'test-chart',
@@ -57,7 +57,7 @@ describe('store', () => {
expect(outputFormData.row_limit).toEqual(888);
});
- it('keeps null if key is defined with null', () => {
+ test('keeps null if key is defined with null', () => {
const inputFormData = {
datasource: '11_table',
viz_type: 'test-chart',
diff --git a/superset-frontend/src/features/alerts/components/NotificationMethod.test.tsx b/superset-frontend/src/features/alerts/components/NotificationMethod.test.tsx
index b9b46e6069..12ade24f8b 100644
--- a/superset-frontend/src/features/alerts/components/NotificationMethod.test.tsx
+++ b/superset-frontend/src/features/alerts/components/NotificationMethod.test.tsx
@@ -68,7 +68,7 @@ describe('NotificationMethod', () => {
cleanup();
});
- it('should render the component', () => {
+ test('should render the component', () => {
render(
<NotificationMethod
setting={mockSetting}
@@ -89,7 +89,7 @@ describe('NotificationMethod', () => {
expect(screen.getByText('Email recipients')).toBeInTheDocument();
});
- it('should call onRemove when the delete button is clicked', () => {
+ test('should call onRemove when the delete button is clicked', () => {
render(
<NotificationMethod
setting={mockSetting}
@@ -109,7 +109,7 @@ describe('NotificationMethod', () => {
expect(mockOnRemove).toHaveBeenCalledWith(1);
});
- it('should update recipient value when input changes', () => {
+ test('should update recipient value when input changes', () => {
render(
<NotificationMethod
setting={mockSetting}
@@ -134,7 +134,7 @@ describe('NotificationMethod', () => {
});
});
- it('should call onRecipientsChange when the recipients value is changed', () => {
+ test('should call onRecipientsChange when the recipients value is changed', () => {
render(
<NotificationMethod
setting={mockSetting}
@@ -159,7 +159,7 @@ describe('NotificationMethod', () => {
});
});
- it('should correctly map recipients when method is SlackV2', () => {
+ test('should correctly map recipients when method is SlackV2', () => {
const method = 'SlackV2';
const recipientValue = 'user1,user2';
const slackOptions: { label: string; value: string }[] = [
@@ -175,7 +175,7 @@ describe('NotificationMethod', () => {
]);
});
- it('should return an empty array when recipientValue is an empty string', () => {
+ test('should return an empty array when recipientValue is an empty string', () => {
const method = 'SlackV2';
const recipientValue = '';
const slackOptions: { label: string; value: string }[] = [
@@ -188,7 +188,7 @@ describe('NotificationMethod', () => {
expect(result).toEqual([]);
});
- it('should correctly map recipients when method is Slack with updated recipient values', () => {
+ test('should correctly map recipients when method is Slack with updated recipient values', () => {
const method = 'Slack';
const recipientValue = 'User One,User Two';
const slackOptions: { label: string; value: string }[] = [
@@ -203,7 +203,7 @@ describe('NotificationMethod', () => {
{ label: 'User Two', value: 'user2' },
]);
});
- it('should render CC and BCC fields when method is Email and visibility flags are true', () => {
+ test('should render CC and BCC fields when method is Email and visibility flags are true', () => {
const defaultProps = {
setting: {
method: NotificationMethodOption.Email,
@@ -230,7 +230,7 @@ describe('NotificationMethod', () => {
expect(getByTestId('cc')).toBeInTheDocument();
expect(getByTestId('bcc')).toBeInTheDocument();
});
- it('should render CC and BCC fields with correct values when method is Email', () => {
+ test('should render CC and BCC fields with correct values when method is Email', () => {
const defaultProps = {
setting: {
method: NotificationMethodOption.Email,
@@ -257,7 +257,7 @@ describe('NotificationMethod', () => {
expect(getByTestId('cc')).toHaveValue('cc1@example.com');
expect(getByTestId('bcc')).toHaveValue('bcc1@example.com');
});
- it('should not render CC and BCC fields when method is not Email', () => {
+ test('should not render CC and BCC fields when method is not Email', () => {
const defaultProps = {
setting: {
method: NotificationMethodOption.Slack,
@@ -285,7 +285,7 @@ describe('NotificationMethod', () => {
expect(queryByTestId('bcc')).not.toBeInTheDocument();
});
// Handle empty recipients list gracefully
- it('should handle empty recipients list gracefully', () => {
+ test('should handle empty recipients list gracefully', () => {
const defaultProps = {
setting: {
method: NotificationMethodOption.Email,
@@ -312,7 +312,7 @@ describe('NotificationMethod', () => {
expect(queryByTestId('cc')).not.toBeInTheDocument();
expect(queryByTestId('bcc')).not.toBeInTheDocument();
});
- it('shows the right combo when ff is false', async () => {
+ test('shows the right combo when ff is false', async () => {
/* should show the div with "Recipients are separated by"
when FeatureFlag.AlertReportSlackV2 is false and fetchSlackChannels errors
*/
@@ -347,7 +347,7 @@ describe('NotificationMethod', () => {
).toBeInTheDocument();
});
});
- it('shows the textbox when the fetch fails', async () => {
+ test('shows the textbox when the fetch fails', async () => {
/* should show the div with "Recipients are separated by"
when FeatureFlag.AlertReportSlackV2 is true and fetchSlackChannels errors
*/
@@ -383,7 +383,7 @@ describe('NotificationMethod', () => {
).toBeInTheDocument();
});
});
- it('shows the dropdown when ff is true and slackChannels succeed', async () => {
+ test('shows the dropdown when ff is true and slackChannels succeed', async () => {
/* should show the Select channels dropdown
when FeatureFlag.AlertReportSlackV2 is true and fetchSlackChannels succeeds
*/
@@ -422,7 +422,7 @@ describe('NotificationMethod', () => {
expect(screen.getByTitle('Slack')).toBeInTheDocument();
});
});
- it('shows the textarea when ff is true and slackChannels fail', async () => {
+ test('shows the textarea when ff is true and slackChannels fail', async () => {
/* should show the Select channels dropdown
when FeatureFlag.AlertReportSlackV2 is true and fetchSlackChannels succeeds
*/
@@ -456,7 +456,7 @@ describe('NotificationMethod', () => {
screen.getByText('Recipients are separated by "," or ";"'),
).toBeInTheDocument();
});
- it('shows the textarea when ff is true and slackChannels fail and slack is selected', async () => {
+ test('shows the textarea when ff is true and slackChannels fail and slack is selected', async () => {
/* should show the Select channels dropdown
when FeatureFlag.AlertReportSlackV2 is true and fetchSlackChannels succeeds
*/
@@ -491,7 +491,7 @@ describe('NotificationMethod', () => {
).toBeInTheDocument();
});
- it('shows the textarea when ff is true, slackChannels fail and slack is selected', async () => {
+ test('shows the textarea when ff is true, slackChannels fail and slack is selected', async () => {
window.featureFlags = { [FeatureFlag.AlertReportSlackV2]: true };
jest.spyOn(SupersetClient, 'get').mockImplementation(() => {
throw new Error('Error fetching Slack channels');
@@ -519,7 +519,7 @@ describe('NotificationMethod', () => {
});
describe('RefreshLabel functionality', () => {
- it('should call updateSlackOptions with force true when RefreshLabel is clicked', async () => {
+ test('should call updateSlackOptions with force true when RefreshLabel is clicked', async () => {
// Set feature flag so that SlackV2 branch renders RefreshLabel
window.featureFlags = { [FeatureFlag.AlertReportSlackV2]: true };
// Spy on SupersetClient.get which is called by updateSlackOptions
diff --git a/superset-frontend/src/features/alerts/components/RecipientIcon.test.tsx b/superset-frontend/src/features/alerts/components/RecipientIcon.test.tsx
index d3dc44dfa5..8274f9ee20 100644
--- a/superset-frontend/src/features/alerts/components/RecipientIcon.test.tsx
+++ b/superset-frontend/src/features/alerts/components/RecipientIcon.test.tsx
@@ -21,7 +21,7 @@ import RecipientIcon from './RecipientIcon';
import { NotificationMethodOption } from '../types';
describe('RecipientIcon', () => {
- it('should render the email icon when type is Email', () => {
+ test('should render the email icon when type is Email', () => {
const { container } = render(
<RecipientIcon type={NotificationMethodOption.Email} />,
);
@@ -29,27 +29,27 @@ describe('RecipientIcon', () => {
expect(emailIcon).toBeInTheDocument();
});
- it('should render the Slack icon when type is Slack', () => {
+ test('should render the Slack icon when type is Slack', () => {
render(<RecipientIcon type={NotificationMethodOption.Slack} />);
const regexPattern = new RegExp(NotificationMethodOption.Slack, 'i');
const slackIcon = screen.getByLabelText(regexPattern);
expect(slackIcon).toBeInTheDocument();
});
- it('should render the Slack icon when type is SlackV2', () => {
+ test('should render the Slack icon when type is SlackV2', () => {
render(<RecipientIcon type={NotificationMethodOption.SlackV2} />);
const regexPattern = new RegExp(NotificationMethodOption.Slack, 'i');
const slackIcon = screen.getByLabelText(regexPattern);
expect(slackIcon).toBeInTheDocument();
});
- it('should not render any icon when type is not recognized', () => {
+ test('should not render any icon when type is not recognized', () => {
render(<RecipientIcon type="unknown" />);
const icons = screen.queryByLabelText(/.*/);
expect(icons).not.toBeInTheDocument();
});
- it('All recipient types should have consistent accessibility attributes', () => {
+ test('All recipient types should have consistent accessibility attributes', () => {
const types = [
NotificationMethodOption.Email,
NotificationMethodOption.Slack,
diff --git a/superset-frontend/src/features/allEntities/AllEntitiesTable.test.tsx b/superset-frontend/src/features/allEntities/AllEntitiesTable.test.tsx
index c55c04e742..a3b080e943 100644
--- a/superset-frontend/src/features/allEntities/AllEntitiesTable.test.tsx
+++ b/superset-frontend/src/features/allEntities/AllEntitiesTable.test.tsx
@@ -91,7 +91,7 @@ describe('AllEntitiesTable', () => {
jest.restoreAllMocks();
});
- it('renders when empty with button to tag if user has perm', () => {
+ test('renders when empty with button to tag if user has perm', () => {
render(
<AllEntitiesTable
search=""
@@ -109,7 +109,7 @@ describe('AllEntitiesTable', () => {
expect(screen.getByText('Add tag to entities')).toBeInTheDocument();
});
- it('renders when empty without button to tag if user does not have perm', () => {
+ test('renders when empty without button to tag if user does not have perm', () => {
render(
<AllEntitiesTable
search=""
@@ -127,7 +127,7 @@ describe('AllEntitiesTable', () => {
expect(screen.queryByText('Add tag to entities')).not.toBeInTheDocument();
});
- it('renders the correct tags for each object type', () => {
+ test('renders the correct tags for each object type', () => {
render(
<AllEntitiesTable
search=""
@@ -151,7 +151,7 @@ describe('AllEntitiesTable', () => {
expect(screen.getByText('Engagement')).toBeInTheDocument();
});
- it('Only list asset types that have entities', () => {
+ test('Only list asset types that have entities', () => {
const mockObjects = {
dashboard: [],
chart: [mockObjectsWithTags.chart[0]],
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/DatabaseConnectionForm/EncryptedField.test.tsx b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.test.tsx
index b29d03c929..a7f881c11b 100644
--- a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.test.tsx
+++ b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.test.tsx
@@ -102,7 +102,7 @@ describe('EncryptedField', () => {
});
describe('Engine-to-Field Mapping', () => {
- it.each(supportedEngines)(
+ test.each(supportedEngines)(
'resolves field name for %s engine → %s field',
(engine, expectedField) => {
const mockDb = createMockDb(engine);
@@ -115,7 +115,7 @@ describe('EncryptedField', () => {
},
);
- it('handles unmapped engines gracefully', () => {
+ test('handles unmapped engines gracefully', () => {
const unmappedEngine = 'unknown-engine-xyz';
const mockDb = createMockDb(unmappedEngine);
const props = { ...defaultProps, db: mockDb };
@@ -126,7 +126,7 @@ describe('EncryptedField', () => {
expect(props.changeMethods.onParametersChange).toHaveBeenCalledTimes(1);
});
- it.each([
+ test.each([
['null engine', null, null],
['undefined engine', undefined, undefined],
['empty string engine', '', ''],
@@ -170,7 +170,7 @@ describe('EncryptedField', () => {
},
];
- it.each(testCases)(
+ test.each(testCases)(
'processes $description correctly',
({ input, expected }) => {
const mockDb = createMockDb('gsheets', {
@@ -185,7 +185,7 @@ describe('EncryptedField', () => {
},
);
- it('handles null/undefined parameters', () => {
+ test('handles null/undefined parameters', () => {
const mockDb = createMockDb('gsheets', {});
const props = { ...defaultProps, db: mockDb, isEditMode: true };
@@ -197,7 +197,7 @@ describe('EncryptedField', () => {
});
describe('Conditional Rendering Logic', () => {
- it('shows upload selector in create mode', () => {
+ test('shows upload selector in create mode', () => {
const props = { ...defaultProps, isEditMode: false, editNewDb: false };
render(<EncryptedField {...props} />);
@@ -211,7 +211,7 @@ describe('EncryptedField', () => {
expect(screen.queryByRole('textbox')).not.toBeInTheDocument();
});
- it('shows textarea in edit mode', () => {
+ test('shows textarea in edit mode', () => {
const props = { ...defaultProps, isEditMode: true, editNewDb: false };
render(<EncryptedField {...props} />);
@@ -225,7 +225,7 @@ describe('EncryptedField', () => {
expect(screen.getByRole('textbox')).toBeInTheDocument();
});
- it('shows textarea when editNewDb is true', () => {
+ test('shows textarea when editNewDb is true', () => {
const props = { ...defaultProps, isEditMode: false, editNewDb: true };
render(<EncryptedField {...props} />);
@@ -242,7 +242,7 @@ describe('EncryptedField', () => {
});
describe('Upload Option State Management', () => {
- it('defaults to upload option', () => {
+ test('defaults to upload option', () => {
const props = { ...defaultProps, isEditMode: false };
render(<EncryptedField {...props} />);
@@ -251,7 +251,7 @@ describe('EncryptedField', () => {
expect(screen.queryByRole('textbox')).not.toBeInTheDocument();
});
- it('switches to copy-paste option', () => {
+ test('switches to copy-paste option', () => {
const props = { ...defaultProps, isEditMode: false };
render(<EncryptedField {...props} />);
@@ -270,7 +270,7 @@ describe('EncryptedField', () => {
});
describe('Form Integration Contract', () => {
- it.each(supportedEngines)(
+ test.each(supportedEngines)(
'calls onParametersChange with correct field name for %s engine',
(engine, fieldName) => {
const mockDb = createMockDb(engine);
@@ -287,7 +287,7 @@ describe('EncryptedField', () => {
},
);
- it('initializes with empty value on mount', () => {
+ test('initializes with empty value on mount', () => {
const props = { ...defaultProps };
render(<EncryptedField {...props} />);
@@ -299,7 +299,7 @@ describe('EncryptedField', () => {
);
});
- it('renders correctly with default props', () => {
+ test('renders correctly with default props', () => {
const props = { ...defaultProps };
expect(() => render(<EncryptedField {...props} />)).not.toThrow();
@@ -316,7 +316,7 @@ describe('EncryptedField', () => {
});
describe('Error Boundaries', () => {
- it('renders gracefully when database prop is missing', () => {
+ test('renders gracefully when database prop is missing', () => {
const props = { ...defaultProps, db: undefined };
expect(() => render(<EncryptedField {...props} />)).not.toThrow();
@@ -325,7 +325,7 @@ describe('EncryptedField', () => {
expectParametersChange(props.changeMethods, undefined, '');
});
- it('renders gracefully with malformed database parameters', () => {
+ test('renders gracefully with malformed database parameters', () => {
const mockDb = createMockDb('gsheets', {
service_account_info: Symbol('test-symbol'),
});
@@ -341,7 +341,7 @@ describe('EncryptedField', () => {
});
describe('Accessibility', () => {
- it('provides proper form labels and attributes', () => {
+ test('provides proper form labels and attributes', () => {
const props = { ...defaultProps, isEditMode: true };
render(<EncryptedField {...props} />);
@@ -356,7 +356,7 @@ describe('EncryptedField', () => {
);
});
- it('provides proper labels for upload method selection', () => {
+ test('provides proper labels for upload method selection', () => {
const props = { ...defaultProps, isEditMode: false };
render(<EncryptedField {...props} />);
diff --git a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/OAuth2ClientField.test.tsx b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/OAuth2ClientField.test.tsx
index 31410e47b7..d865cbf3a6 100644
--- a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/OAuth2ClientField.test.tsx
+++ b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/OAuth2ClientField.test.tsx
@@ -70,7 +70,7 @@ describe('OAuth2ClientField', () => {
jest.clearAllMocks();
});
- it('does not show input fields until the collapse trigger is clicked', () => {
+ test('does not show input fields until the collapse trigger is clicked', () => {
const { getByText, getByTestId, queryByTestId } = render(
<OAuth2ClientField {...defaultProps} />,
);
@@ -93,7 +93,7 @@ describe('OAuth2ClientField', () => {
expect(getByTestId('client-scope')).toBeInTheDocument();
});
- it('renders the OAuth2ClientField component with initial values', () => {
+ test('renders the OAuth2ClientField component with initial values', () => {
const { getByTestId, getByText } = render(
<OAuth2ClientField {...defaultProps} />,
);
@@ -112,7 +112,7 @@ describe('OAuth2ClientField', () => {
expect(getByTestId('client-scope')).toHaveValue('test-scope');
});
- it('handles input changes and triggers onEncryptedExtraInputChange', () => {
+ test('handles input changes and triggers onEncryptedExtraInputChange', () => {
const { getByTestId, getByText } = render(
<OAuth2ClientField {...defaultProps} />,
);
@@ -140,7 +140,7 @@ describe('OAuth2ClientField', () => {
);
});
- it('does not render when supports_oauth2 is false', () => {
+ test('does not render when supports_oauth2 is false', () => {
const props = {
...defaultProps,
db: {
@@ -156,7 +156,7 @@ describe('OAuth2ClientField', () => {
expect(queryByTestId('client-id')).not.toBeInTheDocument();
});
- it('renders empty fields when masked_encrypted_extra is empty', () => {
+ test('renders empty fields when masked_encrypted_extra is empty', () => {
const props = {
...defaultProps,
db: {
diff --git a/superset-frontend/src/features/databases/DatabaseModal/ExtraOptions.test.tsx b/superset-frontend/src/features/databases/DatabaseModal/ExtraOptions.test.tsx
index f0436fa32e..4caa939cfe 100644
--- a/superset-frontend/src/features/databases/DatabaseModal/ExtraOptions.test.tsx
+++ b/superset-frontend/src/features/databases/DatabaseModal/ExtraOptions.test.tsx
@@ -91,7 +91,7 @@ describe('ExtraOptions Component', () => {
jest.clearAllMocks();
});
- it('renders all main panels', () => {
+ test('renders all main panels', () => {
renderComponent();
expect(screen.getByText(t('SQL Lab'))).toBeInTheDocument();
@@ -100,7 +100,7 @@ describe('ExtraOptions Component', () => {
expect(screen.getByText(t('Other'))).toBeInTheDocument();
});
- it('calls onInputChange when "Expose database in SQL Lab" checkbox is clicked', () => {
+ test('calls onInputChange when "Expose database in SQL Lab" checkbox is clicked', () => {
renderComponent();
const sqlLabText = screen.getByText(t('SQL Lab'));
fireEvent.click(sqlLabText);
@@ -110,7 +110,7 @@ describe('ExtraOptions Component', () => {
expect(onInputChange).toHaveBeenCalled();
});
- it('calls onExtraInputChange when "Enable query cost estimation" checkbox is clicked', () => {
+ test('calls onExtraInputChange when "Enable query cost estimation" checkbox is clicked', () => {
renderComponent();
const sqlLabText = screen.getByText(t('SQL Lab'));
fireEvent.click(sqlLabText);
@@ -119,7 +119,7 @@ describe('ExtraOptions Component', () => {
expect(onExtraInputChange).toHaveBeenCalled();
});
- it('calls onExtraEditorChange when metadata_params json editor changes', async () => {
+ test('calls onExtraEditorChange when metadata_params json editor changes', async () => {
renderComponent();
// Click to open the editor tab/section
@@ -163,7 +163,7 @@ describe('ExtraOptions Component', () => {
});
});
- it('calls onTextChange when server certificate textarea is changed', () => {
+ test('calls onTextChange when server certificate textarea is changed', () => {
renderComponent();
// Click to open the security tab/section
const securityHeader = screen.getByText(t('Security'));
@@ -174,7 +174,7 @@ describe('ExtraOptions Component', () => {
expect(onTextChange).toHaveBeenCalled();
});
- it('handles input change for schema cache timeout', () => {
+ test('handles input change for schema cache timeout', () => {
renderComponent();
const performanceHeader = screen.getByText(t('Performance'));
fireEvent.click(performanceHeader);
@@ -183,7 +183,7 @@ describe('ExtraOptions Component', () => {
expect(onExtraInputChange).toHaveBeenCalled();
});
- it('handles input change for table cache timeout', () => {
+ test('handles input change for table cache timeout', () => {
renderComponent();
const performanceHeader = screen.getByText(t('Performance'));
fireEvent.click(performanceHeader);
@@ -192,7 +192,7 @@ describe('ExtraOptions Component', () => {
expect(onExtraInputChange).toHaveBeenCalled();
});
- it('renders the collaps tab correctly and resets to default tab after closing', () => {
+ test('renders the collaps tab correctly and resets to default tab after closing', () => {
const { rerender } = renderComponent();
const sqlLabTab = screen.getByRole('tab', {
name: /SQL Lab./i,
diff --git a/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx b/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx
index febe6bb357..988b2a6a8e 100644
--- a/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx
+++ b/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx
@@ -907,7 +907,7 @@ describe('DatabaseModal', () => {
expect(schemasForFileUploadText).not.toBeInTheDocument();
});
- it('renders the "Advanced" - SECURITY tab correctly after selecting Allow file uploads', async () => {
+ test('renders the "Advanced" - SECURITY tab correctly after selecting Allow file uploads', async () => {
setup();
// ---------- Components ----------
@@ -1410,13 +1410,13 @@ describe('DatabaseModal', () => {
});
describe('DatabaseModal w/ GSheet Engine', () => {
- it('enters step 2 of 2 when proper database is selected', async () => {
+ test('enters step 2 of 2 when proper database is selected', async () => {
setup({ dbEngine: 'Google Sheets' });
const step2of2text = await screen.findByText(/step 2 of 2/i);
expect(step2of2text).toBeInTheDocument();
});
- it('renders the "Advanced" - SECURITY tab without Allow File Upload Checkbox', async () => {
+ test('renders the "Advanced" - SECURITY tab without Allow File Upload Checkbox', async () => {
setup({ dbEngine: 'Google Sheets' });
// Click the "Advanced" tab
@@ -1454,7 +1454,7 @@ describe('DatabaseModal', () => {
expect(schemasForFileUploadText).not.toBeInTheDocument();
});
- it('if the SSH Tunneling toggle is not displayed, nothing should get displayed', async () => {
+ test('if the SSH Tunneling toggle is not displayed, nothing should get displayed', async () => {
setup({ dbEngine: 'Google Sheets' });
const SSHTunnelingToggle = screen.queryByTestId('ssh-tunnel-switch');
diff --git a/superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx b/superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx
index a2fac0b4e7..69af2ada4a 100644
--- a/superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx
+++ b/superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx
@@ -601,7 +601,7 @@ describe('File Extension Validation', () => {
});
describe('UploadDataModal Collapse Tabs', () => {
- it('renders the collaps tab CSV correctly and resets to default tab after closing', async () => {
+ test('renders the collaps tab CSV correctly and resets to default tab after closing', async () => {
const { rerender } = render(<UploadDataModal {...csvProps} />, {
useRedux: true,
});
@@ -621,7 +621,7 @@ describe('UploadDataModal Collapse Tabs', () => {
expect(generalInfoTab).toHaveAttribute('aria-expanded', 'true');
});
- it('renders the collaps tab Excel correctly and resets to default tab after closing', async () => {
+ test('renders the collaps tab Excel correctly and resets to default tab after closing', async () => {
const { rerender } = render(<UploadDataModal {...excelProps} />, {
useRedux: true,
});
@@ -641,7 +641,7 @@ describe('UploadDataModal Collapse Tabs', () => {
expect(generalInfoTab).toHaveAttribute('aria-expanded', 'true');
});
- it('renders the collaps tab Columnar correctly and resets to default tab after closing', async () => {
+ test('renders the collaps tab Columnar correctly and resets to default tab after closing', async () => {
const { rerender } = render(<UploadDataModal {...columnarProps} />, {
useRedux: true,
});
diff --git a/superset-frontend/src/features/datasets/AddDataset/RightPanel/RightPanel.test.tsx b/superset-frontend/src/features/datasets/AddDataset/RightPanel/RightPanel.test.tsx
index 6cf4a466d6..1beb4e05bc 100644
--- a/superset-frontend/src/features/datasets/AddDataset/RightPanel/RightPanel.test.tsx
+++ b/superset-frontend/src/features/datasets/AddDataset/RightPanel/RightPanel.test.tsx
@@ -20,7 +20,7 @@ import { render, screen } from 'spec/helpers/testing-library';
import RightPanel from 'src/features/datasets/AddDataset/RightPanel';
describe('RightPanel', () => {
- it('renders a blank state RightPanel', () => {
+ test('renders a blank state RightPanel', () => {
render(<RightPanel />);
expect(screen.getByText(/right panel/i)).toBeVisible();
diff --git a/superset-frontend/src/features/datasets/DatasetLayout/DatasetLayout.test.tsx b/superset-frontend/src/features/datasets/DatasetLayout/DatasetLayout.test.tsx
index 0c873b44c6..b8373a2083 100644
--- a/superset-frontend/src/features/datasets/DatasetLayout/DatasetLayout.test.tsx
+++ b/superset-frontend/src/features/datasets/DatasetLayout/DatasetLayout.test.tsx
@@ -33,7 +33,7 @@ jest.mock('react-router-dom', () => ({
}));
describe('DatasetLayout', () => {
- it('renders nothing when no components are passed in', () => {
+ test('renders nothing when no components are passed in', () => {
render(<DatasetLayout />, { useRouter: true });
const layoutWrapper = screen.getByTestId('dataset-layout-wrapper');
@@ -45,13 +45,13 @@ describe('DatasetLayout', () => {
const waitForRender = () =>
waitFor(() => render(<Header setDataset={mockSetDataset} />));
- it('renders a Header when passed in', async () => {
+ test('renders a Header when passed in', async () => {
await waitForRender();
expect(screen.getByText(/new dataset/i)).toBeVisible();
});
- it('renders a LeftPanel when passed in', async () => {
+ test('renders a LeftPanel when passed in', async () => {
render(
<DatasetLayout leftPanel={<LeftPanel setDataset={() => null} />} />,
{ useRedux: true, useRouter: true },
@@ -63,7 +63,7 @@ describe('DatasetLayout', () => {
expect(LeftPanel).toBeTruthy();
});
- it('renders a DatasetPanel when passed in', () => {
+ test('renders a DatasetPanel when passed in', () => {
render(<DatasetLayout datasetPanel={<DatasetPanel />} />, {
useRouter: true,
});
@@ -75,13 +75,13 @@ describe('DatasetLayout', () => {
expect(blankDatasetTitle).toBeVisible();
});
- it('renders a RightPanel when passed in', () => {
+ test('renders a RightPanel when passed in', () => {
render(<DatasetLayout rightPanel={RightPanel()} />, { useRouter: true });
expect(screen.getByText(/right panel/i)).toBeVisible();
});
- it('renders a Footer when passed in', () => {
+ test('renders a Footer when passed in', () => {
render(<DatasetLayout footer={<Footer url="" />} />, {
useRedux: true,
useRouter: true,
diff --git a/superset-frontend/src/features/home/DashboardTable.test.tsx b/superset-frontend/src/features/home/DashboardTable.test.tsx
index d7400254ff..745faa8d3d 100644
--- a/superset-frontend/src/features/home/DashboardTable.test.tsx
+++ b/superset-frontend/src/features/home/DashboardTable.test.tsx
@@ -142,7 +142,7 @@ describe('DashboardTable', () => {
}));
});
- it('renders loading state initially', () => {
+ test('renders loading state initially', () => {
render(
<Router history={history}>
<DashboardTable {...defaultProps} />
@@ -152,7 +152,7 @@ describe('DashboardTable', () => {
expect(screen.getByRole('img', { name: 'empty' })).toBeInTheDocument();
});
- it('renders empty state when no dashboards', async () => {
+ test('renders empty state when no dashboards', async () => {
render(
<Router history={history}>
<DashboardTable {...defaultProps} />
@@ -165,7 +165,7 @@ describe('DashboardTable', () => {
});
});
- it('renders dashboard cards when data is loaded', async () => {
+ test('renders dashboard cards when data is loaded', async () => {
jest.spyOn(hooks, 'useListViewResource').mockImplementation(() => ({
state: {
loading: false,
@@ -195,7 +195,7 @@ describe('DashboardTable', () => {
});
});
- it('switches to Mine tab correctly', async () => {
+ test('switches to Mine tab correctly', async () => {
const props = {
...defaultProps,
mine: mockDashboards,
@@ -215,7 +215,7 @@ describe('DashboardTable', () => {
});
});
- it('handles create dashboard button click', async () => {
+ test('handles create dashboard button click', async () => {
const assignMock = jest.fn();
Object.defineProperty(window, 'location', {
value: { assign: assignMock },
@@ -234,7 +234,7 @@ describe('DashboardTable', () => {
expect(assignMock).toHaveBeenCalledWith('/dashboard/new');
});
- it('switches to Other tab when available', async () => {
+ test('switches to Other tab when available', async () => {
const props = {
...defaultProps,
otherTabData: mockDashboards,
@@ -253,7 +253,7 @@ describe('DashboardTable', () => {
expect(otherTab).toHaveClass('active');
});
- it('handles bulk dashboard export', async () => {
+ test('handles bulk dashboard export', async () => {
const props = {
...defaultProps,
mine: mockDashboards,
@@ -282,7 +282,7 @@ describe('DashboardTable', () => {
expect(screen.getByRole('status')).toBeInTheDocument();
});
- it('handles dashboard deletion confirmation', async () => {
+ test('handles dashboard deletion confirmation', async () => {
const props = {
...defaultProps,
mine: mockDashboards,
diff --git a/superset-frontend/src/features/home/EmptyState.test.tsx b/superset-frontend/src/features/home/EmptyState.test.tsx
index a43fac1fe8..2b7dc88164 100644
--- a/superset-frontend/src/features/home/EmptyState.test.tsx
+++ b/superset-frontend/src/features/home/EmptyState.test.tsx
@@ -64,7 +64,7 @@ describe('EmptyState', () => {
];
variants.forEach(variant => {
- it(`renders an ${variant.tab} ${variant.tableName} empty state`, () => {
+ test(`renders an ${variant.tab} ${variant.tableName} empty state`, () => {
const { container } = render(<EmptyState {...variant} />);
// Select the first description node
@@ -76,7 +76,7 @@ describe('EmptyState', () => {
});
recents.forEach(recent => {
- it(`renders a ${recent.tab} ${recent.tableName} empty state`, () => {
+ test(`renders a ${recent.tab} ${recent.tableName} empty state`, () => {
const { container } = render(<EmptyState {...recent} />);
// Select the first description node
diff --git a/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.test.tsx b/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.test.tsx
index a14aa91c58..134d4c5b27 100644
--- a/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.test.tsx
+++ b/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.test.tsx
@@ -142,7 +142,7 @@ describe('Header Report Dropdown', () => {
mockedIsFeatureEnabled.mockRestore();
});
- it('renders correctly', () => {
+ test('renders correctly', () => {
const mockedProps = createProps();
act(() => {
setup(mockedProps, stateWithUserAndReport);
@@ -150,7 +150,7 @@ describe('Header Report Dropdown', () => {
expect(screen.getAllByRole('menuitem')[0]).toBeInTheDocument();
});
- it('renders the dropdown correctly', async () => {
+ test('renders the dropdown correctly', async () => {
const mockedProps = createProps();
act(() => {
setup(mockedProps, stateWithUserAndReport);
@@ -160,7 +160,7 @@ describe('Header Report Dropdown', () => {
expect(screen.getByText('Delete email report')).toBeInTheDocument();
});
- it('opens an edit modal', async () => {
+ test('opens an edit modal', async () => {
const mockedProps = createProps();
mockedProps.showReportModal = jest.fn();
act(() => {
@@ -171,7 +171,7 @@ describe('Header Report Dropdown', () => {
expect(mockedProps.showReportModal).toHaveBeenCalled();
});
- it('opens a delete modal', async () => {
+ test('opens a delete modal', async () => {
const mockedProps = createProps();
mockedProps.setCurrentReportDeleting = jest.fn();
act(() => {
@@ -182,7 +182,7 @@ describe('Header Report Dropdown', () => {
expect(mockedProps.setCurrentReportDeleting).toHaveBeenCalled();
});
- it('renders Manage Email Reports Menu if there is a report', async () => {
+ test('renders Manage Email Reports Menu if there is a report', async () => {
const mockedProps = createProps();
act(() => {
setup(mockedProps, stateWithUserAndReport);
@@ -192,7 +192,7 @@ describe('Header Report Dropdown', () => {
expect(screen.getByText('Delete email report')).toBeInTheDocument();
});
- it('renders Schedule Email Reports if there is a report', async () => {
+ test('renders Schedule Email Reports if there is a report', async () => {
const mockedProps = createProps();
act(() => {
@@ -203,7 +203,7 @@ describe('Header Report Dropdown', () => {
).toBeInTheDocument();
});
- it('renders Schedule Email Reports as long as user has permission through any role', async () => {
+ test('renders Schedule Email Reports as long as user has permission through any role', async () => {
const mockedProps = createProps();
act(() => {
setup(mockedProps, stateWithNonAdminUser);
@@ -214,7 +214,7 @@ describe('Header Report Dropdown', () => {
).toBeInTheDocument();
});
- it('do not render Schedule Email Reports if user no permission', () => {
+ test('do not render Schedule Email Reports if user no permission', () => {
const mockedProps = createProps();
act(() => {
diff --git a/superset-frontend/src/features/reports/ReportModal/ReportModal.test.tsx b/superset-frontend/src/features/reports/ReportModal/ReportModal.test.tsx
index 5b315e6440..ef4eba4a90 100644
--- a/superset-frontend/src/features/reports/ReportModal/ReportModal.test.tsx
+++ b/superset-frontend/src/features/reports/ReportModal/ReportModal.test.tsx
@@ -65,7 +65,7 @@ describe('Email Report Modal', () => {
render(<ReportModal {...defaultProps} />, { useRedux: true });
});
- it('inputs respond correctly', () => {
+ test('inputs respond correctly', () => {
// ----- Report name textbox
// Initial value
const reportNameTextbox = screen.getByTestId('report-name-test');
@@ -92,7 +92,7 @@ describe('Email Report Modal', () => {
expect(crontabInputs).toHaveLength(5);
});
- it('does not allow user to create a report without a name', () => {
+ test('does not allow user to create a report without a name', () => {
// Grab name textbox and add button
const reportNameTextbox = screen.getByTestId('report-name-test');
const addButton = screen.getByRole('button', { name: /add/i });
@@ -116,7 +116,7 @@ describe('Email Report Modal', () => {
dispatch = sinon.spy();
});
- it('creates a new email report', async () => {
+ test('creates a new email report', async () => {
// ---------- Render/value setup ----------
const reportValues = {
id: 1,
diff --git a/superset-frontend/src/features/rls/RowLevelSecurityModal.test.tsx b/superset-frontend/src/features/rls/RowLevelSecurityModal.test.tsx
index 47d8cf52f2..73376462cb 100644
--- a/superset-frontend/src/features/rls/RowLevelSecurityModal.test.tsx
+++ b/superset-frontend/src/features/rls/RowLevelSecurityModal.test.tsx
@@ -154,7 +154,7 @@ describe('Rule modal', () => {
return mounted;
}
- it('Sets correct title for adding new rule', async () => {
+ test('Sets correct title for adding new rule', async () => {
await renderAndWait(addNewRuleDefaultProps);
const title = screen.getByText('Add Rule');
expect(title).toBeInTheDocument();
@@ -163,7 +163,7 @@ describe('Rule modal', () => {
expect(fetchMock.calls(getRelatedRolesEndpoint)).toHaveLength(0);
});
- it('Sets correct title for editing existing rule', async () => {
+ test('Sets correct title for editing existing rule', async () => {
await renderAndWait({
...addNewRuleDefaultProps,
rule: {
@@ -181,7 +181,7 @@ describe('Rule modal', () => {
expect(fetchMock.calls(getRelatedRolesEndpoint)).toHaveLength(0);
});
- it('Fills correct values when editing rule', async () => {
+ test('Fills correct values when editing rule', async () => {
await renderAndWait({
...addNewRuleDefaultProps,
rule: {
@@ -225,7 +225,7 @@ describe('Rule modal', () => {
expect(description).toHaveValue('test description');
});
- it('Does not allow to create rule without name, tables and clause', async () => {
+ test('Does not allow to create rule without name, tables and clause', async () => {
jest.setTimeout(10000);
await renderAndWait(addNewRuleDefaultProps);
@@ -246,7 +246,7 @@ describe('Rule modal', () => {
expect(addButton).toBeEnabled();
});
- it('Creates a new rule', async () => {
+ test('Creates a new rule', async () => {
await renderAndWait(addNewRuleDefaultProps);
const addButton = screen.getByRole('button', { name: /add/i });
@@ -269,7 +269,7 @@ describe('Rule modal', () => {
);
});
- it('Updates existing rule', async () => {
+ test('Updates existing rule', async () => {
await renderAndWait({
...addNewRuleDefaultProps,
rule: {
diff --git a/superset-frontend/src/features/roles/RoleListAddModal.test.tsx b/superset-frontend/src/features/roles/RoleListAddModal.test.tsx
index 0c288bc093..39bccf1a73 100644
--- a/superset-frontend/src/features/roles/RoleListAddModal.test.tsx
+++ b/superset-frontend/src/features/roles/RoleListAddModal.test.tsx
@@ -51,25 +51,25 @@ describe('RoleListAddModal', () => {
],
};
- it('renders modal with form fields', () => {
+ test('renders modal with form fields', () => {
render(<RoleListAddModal {...mockProps} />);
expect(screen.getByText('Add Role')).toBeInTheDocument();
expect(screen.getByText('Role Name')).toBeInTheDocument();
expect(screen.getByText('Permissions')).toBeInTheDocument();
});
- it('calls onHide when cancel button is clicked', () => {
+ test('calls onHide when cancel button is clicked', () => {
render(<RoleListAddModal {...mockProps} />);
fireEvent.click(screen.getByTestId('modal-cancel-button'));
expect(mockProps.onHide).toHaveBeenCalled();
});
- it('disables save button when role name is empty', () => {
+ test('disables save button when role name is empty', () => {
render(<RoleListAddModal {...mockProps} />);
expect(screen.getByTestId('form-modal-save-button')).toBeDisabled();
});
- it('enables save button when role name is entered', () => {
+ test('enables save button when role name is entered', () => {
render(<RoleListAddModal {...mockProps} />);
fireEvent.change(screen.getByTestId('role-name-input'), {
target: { value: 'New Role' },
@@ -77,7 +77,7 @@ describe('RoleListAddModal', () => {
expect(screen.getByTestId('form-modal-save-button')).toBeEnabled();
});
- it('calls createRole when save button is clicked', async () => {
+ test('calls createRole when save button is clicked', async () => {
render(<RoleListAddModal {...mockProps} />);
fireEvent.change(screen.getByTestId('role-name-input'), {
diff --git a/superset-frontend/src/features/roles/RoleListDuplicateModal.test.tsx b/superset-frontend/src/features/roles/RoleListDuplicateModal.test.tsx
index 1b94708008..9c2713de4e 100644
--- a/superset-frontend/src/features/roles/RoleListDuplicateModal.test.tsx
+++ b/superset-frontend/src/features/roles/RoleListDuplicateModal.test.tsx
@@ -56,7 +56,7 @@ describe('RoleListDuplicateModal', () => {
onSave: jest.fn(),
};
- it('renders modal with form fields', () => {
+ test('renders modal with form fields', () => {
render(<RoleListDuplicateModal {...mockProps} />);
expect(
screen.getByText(`Duplicate role ${mockRole.name}`),
@@ -64,18 +64,18 @@ describe('RoleListDuplicateModal', () => {
expect(screen.getByText('Role Name')).toBeInTheDocument();
});
- it('calls onHide when cancel button is clicked', () => {
+ test('calls onHide when cancel button is clicked', () => {
render(<RoleListDuplicateModal {...mockProps} />);
fireEvent.click(screen.getByTestId('modal-cancel-button'));
expect(mockProps.onHide).toHaveBeenCalled();
});
- it('disables save button when role name is empty', () => {
+ test('disables save button when role name is empty', () => {
render(<RoleListDuplicateModal {...mockProps} />);
expect(screen.getByTestId('form-modal-save-button')).toBeDisabled();
});
- it('enables save button when role name is entered', () => {
+ test('enables save button when role name is entered', () => {
render(<RoleListDuplicateModal {...mockProps} />);
fireEvent.change(screen.getByTestId('role-name-input'), {
target: { value: 'New Role' },
@@ -83,7 +83,7 @@ describe('RoleListDuplicateModal', () => {
expect(screen.getByTestId('form-modal-save-button')).toBeEnabled();
});
- it('calls createRole when save button is clicked', async () => {
+ test('calls createRole when save button is clicked', async () => {
mockCreateRole.mockResolvedValue({ json: { id: 2 } } as any);
render(<RoleListDuplicateModal {...mockProps} />);
diff --git a/superset-frontend/src/features/roles/RoleListEditModal.test.tsx b/superset-frontend/src/features/roles/RoleListEditModal.test.tsx
index 0f6c96faf0..8298bea88d 100644
--- a/superset-frontend/src/features/roles/RoleListEditModal.test.tsx
+++ b/superset-frontend/src/features/roles/RoleListEditModal.test.tsx
@@ -110,7 +110,7 @@ describe('RoleListEditModal', () => {
groups: mockGroups,
};
- it('renders modal with correct title and fields', () => {
+ test('renders modal with correct title and fields', () => {
render(<RoleListEditModal {...mockProps} />);
expect(screen.getAllByText('Edit Role')[0]).toBeInTheDocument();
expect(screen.getByText('Role Name')).toBeInTheDocument();
@@ -118,13 +118,13 @@ describe('RoleListEditModal', () => {
expect(screen.getAllByText('Users')[0]).toBeInTheDocument();
});
- it('calls onHide when cancel button is clicked', () => {
+ test('calls onHide when cancel button is clicked', () => {
render(<RoleListEditModal {...mockProps} />);
fireEvent.click(screen.getByTestId('modal-cancel-button'));
expect(mockProps.onHide).toHaveBeenCalled();
});
- it('disables save button when role name is empty', () => {
+ test('disables save button when role name is empty', () => {
render(<RoleListEditModal {...mockProps} />);
fireEvent.change(screen.getByTestId('role-name-input'), {
target: { value: '' },
@@ -132,7 +132,7 @@ describe('RoleListEditModal', () => {
expect(screen.getByTestId('form-modal-save-button')).toBeDisabled();
});
- it('enables save button when role name is entered', () => {
+ test('enables save button when role name is entered', () => {
render(<RoleListEditModal {...mockProps} />);
fireEvent.change(screen.getByTestId('role-name-input'), {
target: { value: 'Updated Role' },
@@ -140,7 +140,7 @@ describe('RoleListEditModal', () => {
expect(screen.getByTestId('form-modal-save-button')).toBeEnabled();
});
- it('calls update functions when save button is clicked', async () => {
+ test('calls update functions when save button is clicked', async () => {
(SupersetClient.get as jest.Mock).mockImplementation(({ endpoint }) => {
if (endpoint?.includes('/api/v1/security/users/')) {
return Promise.resolve({
@@ -196,7 +196,7 @@ describe('RoleListEditModal', () => {
});
});
- it('switches tabs correctly', () => {
+ test('switches tabs correctly', () => {
render(<RoleListEditModal {...mockProps} />);
const usersTab = screen.getByRole('tab', { name: 'Users' });
diff --git a/superset-frontend/src/features/themes/api.test.ts b/superset-frontend/src/features/themes/api.test.ts
index 6545705e24..d7361ac82b 100644
--- a/superset-frontend/src/features/themes/api.test.ts
+++ b/superset-frontend/src/features/themes/api.test.ts
@@ -34,7 +34,7 @@ describe('Theme API', () => {
});
describe('setSystemDefaultTheme', () => {
- it('should call the correct endpoint with theme id', async () => {
+ test('should call the correct endpoint with theme id', async () => {
const mockResponse = { id: 1, result: 'success' };
fetchMock.put('glob:*/api/v1/theme/1/set_system_default', mockResponse);
@@ -45,7 +45,7 @@ describe('Theme API', () => {
);
});
- it('should handle errors properly', async () => {
+ test('should handle errors properly', async () => {
fetchMock.put('glob:*/api/v1/theme/1/set_system_default', {
throws: new Error('API Error'),
});
@@ -55,7 +55,7 @@ describe('Theme API', () => {
});
describe('setSystemDarkTheme', () => {
- it('should call the correct endpoint with theme id', async () => {
+ test('should call the correct endpoint with theme id', async () => {
const mockResponse = { id: 2, result: 'success' };
fetchMock.put('glob:*/api/v1/theme/2/set_system_dark', mockResponse);
@@ -66,7 +66,7 @@ describe('Theme API', () => {
);
});
- it('should handle errors properly', async () => {
+ test('should handle errors properly', async () => {
fetchMock.put('glob:*/api/v1/theme/2/set_system_dark', {
throws: new Error('API Error'),
});
@@ -76,7 +76,7 @@ describe('Theme API', () => {
});
describe('unsetSystemDefaultTheme', () => {
- it('should call the correct endpoint', async () => {
+ test('should call the correct endpoint', async () => {
const mockResponse = { result: 'success' };
fetchMock.delete(
'glob:*/api/v1/theme/unset_system_default',
@@ -90,7 +90,7 @@ describe('Theme API', () => {
);
});
- it('should handle errors properly', async () => {
+ test('should handle errors properly', async () => {
fetchMock.delete('glob:*/api/v1/theme/unset_system_default', {
throws: new Error('API Error'),
});
@@ -100,7 +100,7 @@ describe('Theme API', () => {
});
describe('unsetSystemDarkTheme', () => {
- it('should call the correct endpoint', async () => {
+ test('should call the correct endpoint', async () => {
const mockResponse = { result: 'success' };
fetchMock.delete('glob:*/api/v1/theme/unset_system_dark', mockResponse);
@@ -111,7 +111,7 @@ describe('Theme API', () => {
);
});
- it('should handle errors properly', async () => {
+ test('should handle errors properly', async () => {
fetchMock.delete('glob:*/api/v1/theme/unset_system_dark', {
throws: new Error('API Error'),
});
diff --git a/superset-frontend/src/features/themes/types.test.ts b/superset-frontend/src/features/themes/types.test.ts
index 1d4e5c190e..31afbc3208 100644
--- a/superset-frontend/src/features/themes/types.test.ts
+++ b/superset-frontend/src/features/themes/types.test.ts
@@ -21,7 +21,7 @@ import { ThemeObject } from './types';
describe('Theme Types', () => {
describe('ThemeObject', () => {
- it('should accept valid theme objects', () => {
+ test('should accept valid theme objects', () => {
const validTheme: ThemeObject = {
id: 1,
theme_name: 'Test Theme',
@@ -51,7 +51,7 @@ describe('Theme Types', () => {
expect(validTheme.is_system_dark).toBe(false);
});
- it('should handle optional fields', () => {
+ test('should handle optional fields', () => {
const minimalTheme: ThemeObject = {
theme_name: 'Minimal Theme',
json_data: '{}',
@@ -64,7 +64,7 @@ describe('Theme Types', () => {
expect(minimalTheme.is_system_dark).toBeUndefined();
});
- it('should handle system theme fields correctly', () => {
+ test('should handle system theme fields correctly', () => {
const systemTheme: ThemeObject = {
id: 2,
theme_name: 'System Theme',
@@ -79,7 +79,7 @@ describe('Theme Types', () => {
expect(systemTheme.is_system_dark).toBe(false);
});
- it('should handle both system default and dark flags', () => {
+ test('should handle both system default and dark flags', () => {
// This should not happen in practice (a theme shouldn't be both)
// but the type allows it for flexibility
const theme: ThemeObject = {
@@ -97,7 +97,7 @@ describe('Theme Types', () => {
});
describe('Theme JSON Data', () => {
- it('should parse valid JSON data', () => {
+ test('should parse valid JSON data', () => {
const theme: ThemeObject = {
theme_name: 'Parse Test',
json_data:
@@ -109,7 +109,7 @@ describe('Theme Types', () => {
expect(parsed.token.colorSuccess).toBe('#52c41a');
});
- it('should handle empty JSON', () => {
+ test('should handle empty JSON', () => {
const theme: ThemeObject = {
theme_name: 'Empty Theme',
json_data: '{}',
@@ -121,7 +121,7 @@ describe('Theme Types', () => {
});
describe('Type Guards', () => {
- it('should identify system themes', () => {
+ test('should identify system themes', () => {
const isSystemTheme = (theme: ThemeObject): boolean =>
theme.is_system === true;
@@ -141,7 +141,7 @@ describe('Theme Types', () => {
expect(isSystemTheme(userTheme)).toBe(false);
});
- it('should identify deletable themes', () => {
+ test('should identify deletable themes', () => {
const isDeletable = (theme: ThemeObject): boolean =>
!theme.is_system && !theme.is_system_default && !theme.is_system_dark;
diff --git a/superset-frontend/src/filters/components/Range/RangeFilterPlugin.test.tsx b/superset-frontend/src/filters/components/Range/RangeFilterPlugin.test.tsx
index 8940094f43..5015aa6f60 100644
--- a/superset-frontend/src/filters/components/Range/RangeFilterPlugin.test.tsx
+++ b/superset-frontend/src/filters/components/Range/RangeFilterPlugin.test.tsx
@@ -104,7 +104,7 @@ describe('RangeFilterPlugin', () => {
jest.clearAllMocks();
});
- it('should render two numerical inputs and a slider by default', () => {
+ test('should render two numerical inputs and a slider by default', () => {
getWrapper();
const inputs = screen.getAllByRole('spinbutton');
@@ -118,7 +118,7 @@ describe('RangeFilterPlugin', () => {
expect(sliders.length).toBeGreaterThan(0);
});
- it('should set the data mask to error when the range is incorrect', async () => {
+ test('should set the data mask to error when the range is incorrect', async () => {
getWrapper({ filterState: { value: [null, null] } });
const inputs = screen.getAllByRole('spinbutton');
@@ -144,7 +144,7 @@ describe('RangeFilterPlugin', () => {
});
});
- it('should call setDataMask with correct filter', () => {
+ test('should call setDataMask with correct filter', () => {
getWrapper();
expect(setDataMask).toHaveBeenCalledWith({
extraFormData: {
@@ -170,7 +170,7 @@ describe('RangeFilterPlugin', () => {
});
});
- it('should call setDataMask with correct greater than filter', () => {
+ test('should call setDataMask with correct greater than filter', () => {
getWrapper({
filterState: { value: [20, null] },
formData: {
@@ -201,7 +201,7 @@ describe('RangeFilterPlugin', () => {
expect(inputs[0]).toHaveValue('20');
});
- it('should call setDataMask with correct less than filter', () => {
+ test('should call setDataMask with correct less than filter', () => {
getWrapper({
filterState: { value: [null, 60] },
formData: {
@@ -231,7 +231,7 @@ describe('RangeFilterPlugin', () => {
expect(inputs[0]).toHaveValue('60');
});
- it('should call setDataMask with correct exact filter', () => {
+ test('should call setDataMask with correct exact filter', () => {
getWrapper({
formData: {
enableSingleValue: SingleValueType.Exact,
@@ -262,7 +262,7 @@ describe('RangeFilterPlugin', () => {
});
describe('Range Display Modes', () => {
- it('should render only the slider in slider mode', () => {
+ test('should render only the slider in slider mode', () => {
getWrapper({
formData: {
rangeDisplayMode: RangeDisplayMode.Slider,
@@ -275,7 +275,7 @@ describe('RangeFilterPlugin', () => {
expect(screen.queryAllByRole('spinbutton')).toHaveLength(0);
});
- it('should render only inputs in input mode', () => {
+ test('should render only inputs in input mode', () => {
getWrapper({
formData: {
rangeDisplayMode: RangeDisplayMode.Input,
@@ -288,7 +288,7 @@ describe('RangeFilterPlugin', () => {
expect(screen.queryAllByRole('slider')).toHaveLength(0);
});
- it('should render both slider and inputs in slider-and-input mode', () => {
+ test('should render both slider and inputs in slider-and-input mode', () => {
getWrapper({
formData: {
rangeDisplayMode: RangeDisplayMode.SliderAndInput,
@@ -304,7 +304,7 @@ describe('RangeFilterPlugin', () => {
expect(sliders.length).toBeGreaterThan(0);
});
- it('should default to slider-and-input mode when not specified', () => {
+ test('should default to slider-and-input mode when not specified', () => {
getWrapper({
formData: {
// No rangeDisplayMode specified
diff --git a/superset-frontend/src/filters/components/Select/buildQuery.test.ts b/superset-frontend/src/filters/components/Select/buildQuery.test.ts
index 44ea51a70a..735f81546f 100644
--- a/superset-frontend/src/filters/components/Select/buildQuery.test.ts
+++ b/superset-frontend/src/filters/components/Select/buildQuery.test.ts
@@ -38,7 +38,7 @@ describe('Select buildQuery', () => {
width: 100,
};
- it('should build a default query', () => {
+ test('should build a default query', () => {
const queryContext = buildQuery(formData);
expect(queryContext.queries.length).toEqual(1);
const [query] = queryContext.queries;
@@ -48,7 +48,7 @@ describe('Select buildQuery', () => {
expect(query.orderby).toEqual([]);
});
- it('should sort descending by metric', () => {
+ test('should sort descending by metric', () => {
const queryContext = buildQuery({
...formData,
sortMetric: 'my_metric',
@@ -61,7 +61,7 @@ describe('Select buildQuery', () => {
expect(query.orderby).toEqual([['my_metric', false]]);
});
- it('should sort ascending by metric', () => {
+ test('should sort ascending by metric', () => {
const queryContext = buildQuery({
...formData,
sortMetric: 'my_metric',
@@ -74,7 +74,7 @@ describe('Select buildQuery', () => {
expect(query.orderby).toEqual([['my_metric', true]]);
});
- it('should sort ascending by column', () => {
+ test('should sort ascending by column', () => {
const queryContext = buildQuery({
...formData,
sortAscending: true,
@@ -86,7 +86,7 @@ describe('Select buildQuery', () => {
expect(query.orderby).toEqual([['my_col', true]]);
});
- it('should sort descending by column', () => {
+ test('should sort descending by column', () => {
const queryContext = buildQuery({
...formData,
sortAscending: false,
@@ -98,7 +98,7 @@ describe('Select buildQuery', () => {
expect(query.orderby).toEqual([['my_col', false]]);
});
- it('should add text search parameter for string to query filter', () => {
+ test('should add text search parameter for string to query filter', () => {
const queryContext = buildQuery(formData, {
ownState: {
search: 'abc',
@@ -112,7 +112,7 @@ describe('Select buildQuery', () => {
]);
});
- it('should add text search parameter for numeric to query filter', () => {
+ test('should add text search parameter for numeric to query filter', () => {
const queryContext = buildQuery(formData, {
ownState: {
search: '123',
diff --git a/superset-frontend/src/filters/utils.test.ts b/superset-frontend/src/filters/utils.test.ts
index ebe521263c..d17abba66c 100644
--- a/superset-frontend/src/filters/utils.test.ts
+++ b/superset-frontend/src/filters/utils.test.ts
@@ -33,7 +33,7 @@ import { FALSE_STRING, NULL_STRING, TRUE_STRING } from 'src/utils/common';
describe('Filter utils', () => {
describe('getRangeExtraFormData', () => {
- it('getRangeExtraFormData - col: "testCol", lower: 1, upper: 2', () => {
+ test('getRangeExtraFormData - col: "testCol", lower: 1, upper: 2', () => {
expect(getRangeExtraFormData('testCol', 1, 2)).toEqual({
filters: [
{
@@ -49,7 +49,7 @@ describe('Filter utils', () => {
],
});
});
- it('getRangeExtraFormData - col: "testCol", lower: 0, upper: 0', () => {
+ test('getRangeExtraFormData - col: "testCol", lower: 0, upper: 0', () => {
expect(getRangeExtraFormData('testCol', 0, 0)).toEqual({
filters: [
{
@@ -60,7 +60,7 @@ describe('Filter utils', () => {
],
});
});
- it('getRangeExtraFormData - col: "testCol", lower: null, upper: 2', () => {
+ test('getRangeExtraFormData - col: "testCol", lower: null, upper: 2', () => {
expect(getRangeExtraFormData('testCol', null, 2)).toEqual({
filters: [
{
@@ -71,7 +71,7 @@ describe('Filter utils', () => {
],
});
});
- it('getRangeExtraFormData - col: "testCol", lower: 1, upper: undefined', () => {
+ test('getRangeExtraFormData - col: "testCol", lower: 1, upper: undefined', () => {
expect(getRangeExtraFormData('testCol', 1, undefined)).toEqual({
filters: [
{
@@ -84,7 +84,7 @@ describe('Filter utils', () => {
});
});
describe('getSelectExtraFormData', () => {
- it('getSelectExtraFormData - col: "testCol", value: ["value"], emptyFilter: false, inverseSelection: false', () => {
+ test('getSelectExtraFormData - col: "testCol", value: ["value"], emptyFilter: false, inverseSelection: false', () => {
expect(
getSelectExtraFormData('testCol', ['value'], false, false),
).toEqual({
@@ -97,7 +97,7 @@ describe('Filter utils', () => {
],
});
});
- it('getSelectExtraFormData - col: "testCol", value: ["value"], emptyFilter: true, inverseSelection: false', () => {
+ test('getSelectExtraFormData - col: "testCol", value: ["value"], emptyFilter: true, inverseSelection: false', () => {
expect(getSelectExtraFormData('testCol', ['value'], true, false)).toEqual(
{
adhoc_filters: [
@@ -110,7 +110,7 @@ describe('Filter utils', () => {
},
);
});
- it('getSelectExtraFormData - col: "testCol", value: ["value"], emptyFilter: false, inverseSelection: true', () => {
+ test('getSelectExtraFormData - col: "testCol", value: ["value"], emptyFilter: false, inverseSelection: true', () => {
expect(getSelectExtraFormData('testCol', ['value'], false, true)).toEqual(
{
filters: [
@@ -123,21 +123,21 @@ describe('Filter utils', () => {
},
);
});
- it('getSelectExtraFormData - col: "testCol", value: [], emptyFilter: false, inverseSelection: false', () => {
+ test('getSelectExtraFormData - col: "testCol", value: [], emptyFilter: false, inverseSelection: false', () => {
expect(getSelectExtraFormData('testCol', [], false, false)).toEqual({});
});
- it('getSelectExtraFormData - col: "testCol", value: undefined, emptyFilter: false, inverseSelection: false', () => {
+ test('getSelectExtraFormData - col: "testCol", value: undefined, emptyFilter: false, inverseSelection: false', () => {
expect(
getSelectExtraFormData('testCol', undefined, false, false),
).toEqual({});
});
- it('getSelectExtraFormData - col: "testCol", value: null, emptyFilter: false, inverseSelection: false', () => {
+ test('getSelectExtraFormData - col: "testCol", value: null, emptyFilter: false, inverseSelection: false', () => {
expect(getSelectExtraFormData('testCol', null, false, false)).toEqual({});
});
});
describe('getDataRecordFormatter', () => {
- it('default formatter returns expected values', () => {
+ test('default formatter returns expected values', () => {
const formatter = getDataRecordFormatter();
expect(formatter(null, GenericDataType.String)).toEqual(NULL_STRING);
expect(formatter(null, GenericDataType.Numeric)).toEqual(NULL_STRING);
@@ -173,7 +173,7 @@ describe('Filter utils', () => {
);
});
- it('formatter with defined formatters returns expected values', () => {
+ test('formatter with defined formatters returns expected values', () => {
const formatter = getDataRecordFormatter({
timeFormatter: getTimeFormatter(TimeFormats.DATABASE_DATETIME),
numberFormatter: getNumberFormatter(NumberFormats.SMART_NUMBER),
diff --git a/superset-frontend/src/hooks/apiResources/apiResources.test.ts b/superset-frontend/src/hooks/apiResources/apiResources.test.ts
index be966472a9..575ae10a5c 100644
--- a/superset-frontend/src/hooks/apiResources/apiResources.test.ts
+++ b/superset-frontend/src/hooks/apiResources/apiResources.test.ts
@@ -52,7 +52,7 @@ describe('apiResource hooks', () => {
});
describe('useApiResourceFullBody', () => {
- it('returns a loading state at the start', async () => {
+ test('returns a loading state at the start', async () => {
const { result } = renderHook(() =>
useApiResourceFullBody('/test/endpoint'),
);
@@ -66,7 +66,7 @@ describe('apiResource hooks', () => {
});
});
- it('resolves to the value from the api', async () => {
+ test('resolves to the value from the api', async () => {
const { result } = renderHook(() =>
useApiResourceFullBody('/test/endpoint'),
);
@@ -80,7 +80,7 @@ describe('apiResource hooks', () => {
});
});
- it('handles api errors', async () => {
+ test('handles api errors', async () => {
const fakeError = new Error('fake api error');
(makeApi as any).mockReturnValue(jest.fn().mockRejectedValue(fakeError));
const { result } = renderHook(() =>
@@ -98,7 +98,7 @@ describe('apiResource hooks', () => {
});
describe('useTransformedResource', () => {
- it('applies a transformation to the resource', () => {
+ test('applies a transformation to the resource', () => {
const { result } = renderHook(() =>
useTransformedResource(
{
@@ -119,7 +119,7 @@ describe('apiResource hooks', () => {
});
});
- it('works while loading', () => {
+ test('works while loading', () => {
const nameToAllCaps = (thing: any) => ({
...thing,
name: thing.name.toUpperCase(),
@@ -143,7 +143,7 @@ describe('apiResource hooks', () => {
});
describe('useApiV1Endpoint', () => {
- it('resolves to the value from the api', async () => {
+ test('resolves to the value from the api', async () => {
(makeApi as any).mockReturnValue(
jest.fn().mockResolvedValue({
meta: 'data',
diff --git a/superset-frontend/src/hooks/apiResources/dashboards.test.ts b/superset-frontend/src/hooks/apiResources/dashboards.test.ts
index 3a6265163e..a7e6864183 100644
--- a/superset-frontend/src/hooks/apiResources/dashboards.test.ts
+++ b/superset-frontend/src/hooks/apiResources/dashboards.test.ts
@@ -55,7 +55,7 @@ describe('useDashboardDatasets', () => {
fetchMock.reset();
});
- it('adds currencyFormats to datasets', async () => {
+ test('adds currencyFormats to datasets', async () => {
fetchMock.get('glob:*/api/v1/dashboard/*/datasets', {
result: mockDatasets,
});
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/hooks/useThemeMenuItems.test.tsx b/superset-frontend/src/hooks/useThemeMenuItems.test.tsx
index 3fbe74b424..d72bb9bad0 100644
--- a/superset-frontend/src/hooks/useThemeMenuItems.test.tsx
+++ b/superset-frontend/src/hooks/useThemeMenuItems.test.tsx
@@ -66,7 +66,7 @@ describe('useThemeMenuItems', () => {
jest.clearAllMocks();
});
- it('renders Light and Dark theme options by default', async () => {
+ test('renders Light and Dark theme options by default', async () => {
renderThemeMenu();
userEvent.hover(await screen.findByRole('menuitem'));
@@ -76,7 +76,7 @@ describe('useThemeMenuItems', () => {
expect(within(menu!).getByText('Dark')).toBeInTheDocument();
});
- it('does not render Match system option when allowOSPreference is false', async () => {
+ test('does not render Match system option when allowOSPreference is false', async () => {
renderThemeMenu({ ...defaultProps, allowOSPreference: false });
userEvent.hover(await screen.findByRole('menuitem'));
@@ -85,7 +85,7 @@ describe('useThemeMenuItems', () => {
});
});
- it('renders with allowOSPreference as true by default', async () => {
+ test('renders with allowOSPreference as true by default', async () => {
renderThemeMenu();
userEvent.hover(await screen.findByRole('menuitem'));
@@ -94,7 +94,7 @@ describe('useThemeMenuItems', () => {
expect(within(menu).getByText('Match system')).toBeInTheDocument();
});
- it('renders clear option when both hasLocalOverride and onClearLocalSettings are provided', async () => {
+ test('renders clear option when both hasLocalOverride and onClearLocalSettings are provided', async () => {
const mockClear = jest.fn();
renderThemeMenu({
...defaultProps,
@@ -108,7 +108,7 @@ describe('useThemeMenuItems', () => {
expect(within(menu).getByText('Clear local theme')).toBeInTheDocument();
});
- it('does not render clear option when hasLocalOverride is false', async () => {
+ test('does not render clear option when hasLocalOverride is false', async () => {
const mockClear = jest.fn();
renderThemeMenu({
...defaultProps,
@@ -123,7 +123,7 @@ describe('useThemeMenuItems', () => {
});
});
- it('calls setThemeMode with DEFAULT when Light is clicked', async () => {
+ test('calls setThemeMode with DEFAULT when Light is clicked', async () => {
const mockSet = jest.fn();
renderThemeMenu({ ...defaultProps, setThemeMode: mockSet });
@@ -134,7 +134,7 @@ describe('useThemeMenuItems', () => {
expect(mockSet).toHaveBeenCalledWith(ThemeMode.DEFAULT);
});
- it('calls setThemeMode with DARK when Dark is clicked', async () => {
+ test('calls setThemeMode with DARK when Dark is clicked', async () => {
const mockSet = jest.fn();
renderThemeMenu({ ...defaultProps, setThemeMode: mockSet });
@@ -145,7 +145,7 @@ describe('useThemeMenuItems', () => {
expect(mockSet).toHaveBeenCalledWith(ThemeMode.DARK);
});
- it('calls setThemeMode with SYSTEM when Match system is clicked', async () => {
+ test('calls setThemeMode with SYSTEM when Match system is clicked', async () => {
const mockSet = jest.fn();
renderThemeMenu({ ...defaultProps, setThemeMode: mockSet });
@@ -156,7 +156,7 @@ describe('useThemeMenuItems', () => {
expect(mockSet).toHaveBeenCalledWith(ThemeMode.SYSTEM);
});
- it('calls onClearLocalSettings when Clear local theme is clicked', async () => {
+ test('calls onClearLocalSettings when Clear local theme is clicked', async () => {
const mockClear = jest.fn();
renderThemeMenu({
...defaultProps,
@@ -171,27 +171,27 @@ describe('useThemeMenuItems', () => {
expect(mockClear).toHaveBeenCalledTimes(1);
});
- it('displays sun icon for DEFAULT theme', () => {
+ test('displays sun icon for DEFAULT theme', () => {
renderThemeMenu({ ...defaultProps, themeMode: ThemeMode.DEFAULT });
expect(screen.getByTestId('sun')).toBeInTheDocument();
});
- it('displays moon icon for DARK theme', () => {
+ test('displays moon icon for DARK theme', () => {
renderThemeMenu({ ...defaultProps, themeMode: ThemeMode.DARK });
expect(screen.getByTestId('moon')).toBeInTheDocument();
});
- it('displays format-painter icon for SYSTEM theme', () => {
+ test('displays format-painter icon for SYSTEM theme', () => {
renderThemeMenu({ ...defaultProps, themeMode: ThemeMode.SYSTEM });
expect(screen.getByTestId('format-painter')).toBeInTheDocument();
});
- it('displays override icon when hasLocalOverride is true', () => {
+ test('displays override icon when hasLocalOverride is true', () => {
renderThemeMenu({ ...defaultProps, hasLocalOverride: true });
expect(screen.getByTestId('thunderbolt')).toBeInTheDocument();
});
- it('renders Theme group header', async () => {
+ test('renders Theme group header', async () => {
renderThemeMenu();
userEvent.hover(await screen.findByRole('menuitem'));
@@ -200,7 +200,7 @@ describe('useThemeMenuItems', () => {
expect(within(menu).getByText('Theme')).toBeInTheDocument();
});
- it('renders sun icon for Light theme option', async () => {
+ test('renders sun icon for Light theme option', async () => {
renderThemeMenu();
userEvent.hover(await screen.findByRole('menuitem'));
@@ -210,7 +210,7 @@ describe('useThemeMenuItems', () => {
expect(within(lightOption!).getByTestId('sun')).toBeInTheDocument();
});
- it('renders moon icon for Dark theme option', async () => {
+ test('renders moon icon for Dark theme option', async () => {
renderThemeMenu();
userEvent.hover(await screen.findByRole('menuitem'));
@@ -220,7 +220,7 @@ describe('useThemeMenuItems', () => {
expect(within(darkOption!).getByTestId('moon')).toBeInTheDocument();
});
- it('renders format-painter icon for Match system option', async () => {
+ test('renders format-painter icon for Match system option', async () => {
renderThemeMenu({ ...defaultProps, allowOSPreference: true });
userEvent.hover(await screen.findByRole('menuitem'));
@@ -232,7 +232,7 @@ describe('useThemeMenuItems', () => {
).toBeInTheDocument();
});
- it('renders clear icon for Clear local theme option', async () => {
+ test('renders clear icon for Clear local theme option', async () => {
renderThemeMenu({
...defaultProps,
hasLocalOverride: true,
@@ -248,7 +248,7 @@ describe('useThemeMenuItems', () => {
expect(within(clearOption!).getByTestId('clear')).toBeInTheDocument();
});
- it('renders divider before clear option when clear option is present', async () => {
+ test('renders divider before clear option when clear option is present', async () => {
renderThemeMenu({
...defaultProps,
hasLocalOverride: true,
@@ -263,7 +263,7 @@ describe('useThemeMenuItems', () => {
expect(divider).toBeInTheDocument();
});
- it('does not render divider when clear option is not present', async () => {
+ test('does not render divider when clear option is not present', async () => {
renderThemeMenu({ ...defaultProps });
userEvent.hover(await screen.findByRole('menuitem'));
diff --git a/superset-frontend/src/hooks/useUnsavedChangesPrompt/useUnsavedChangesPrompt.test.tsx b/superset-frontend/src/hooks/useUnsavedChangesPrompt/useUnsavedChangesPrompt.test.tsx
index bc42cdcfc9..bbe0641b15 100644
--- a/superset-frontend/src/hooks/useUnsavedChangesPrompt/useUnsavedChangesPrompt.test.tsx
+++ b/superset-frontend/src/hooks/useUnsavedChangesPrompt/useUnsavedChangesPrompt.test.tsx
@@ -31,7 +31,7 @@ const wrapper = ({ children }: { children: React.ReactNode }) => (
);
describe('useUnsavedChangesPrompt', () => {
- it('should not show modal initially', () => {
+ test('should not show modal initially', () => {
const { result } = renderHook(
() =>
useUnsavedChangesPrompt({
@@ -44,7 +44,7 @@ describe('useUnsavedChangesPrompt', () => {
expect(result.current.showModal).toBe(false);
});
- it('should block navigation and show modal if there are unsaved changes', () => {
+ test('should block navigation and show modal if there are unsaved changes', () => {
const { result } = renderHook(
() =>
useUnsavedChangesPrompt({
@@ -64,7 +64,7 @@ describe('useUnsavedChangesPrompt', () => {
expect(result.current.showModal).toBe(true);
});
- it('should trigger onSave and hide modal on handleSaveAndCloseModal', async () => {
+ test('should trigger onSave and hide modal on handleSaveAndCloseModal', async () => {
const onSave = jest.fn().mockResolvedValue(undefined);
const { result } = renderHook(
@@ -84,7 +84,7 @@ describe('useUnsavedChangesPrompt', () => {
expect(result.current.showModal).toBe(false);
});
- it('should trigger manual save and not show modal again', async () => {
+ test('should trigger manual save and not show modal again', async () => {
const onSave = jest.fn().mockResolvedValue(undefined);
const { result } = renderHook(
diff --git a/superset-frontend/src/middleware/asyncEvent.test.ts b/superset-frontend/src/middleware/asyncEvent.test.ts
index 34afd66b7c..365c2b3c3b 100644
--- a/superset-frontend/src/middleware/asyncEvent.test.ts
+++ b/superset-frontend/src/middleware/asyncEvent.test.ts
@@ -119,7 +119,7 @@ describe('asyncEvent middleware', () => {
asyncEvent.init(config);
});
- it('resolves with chart data on event done status', async () => {
+ test('resolves with chart data on event done status', async () => {
const actualResolved =
await asyncEvent.waitForAsyncData(asyncPendingEvent);
expect(actualResolved).toEqual([chartData]);
@@ -128,7 +128,7 @@ describe('asyncEvent middleware', () => {
expect(fetchMock.calls(CACHED_DATA_ENDPOINT)).toHaveLength(1);
});
- it('rejects on event error status', async () => {
+ test('rejects on event error status', async () => {
fetchMock.reset();
fetchMock.get(EVENTS_ENDPOINT, {
status: 200,
@@ -148,7 +148,7 @@ describe('asyncEvent middleware', () => {
expect(fetchMock.calls(CACHED_DATA_ENDPOINT)).toHaveLength(0);
});
- it('rejects on cached data fetch error', async () => {
+ test('rejects on cached data fetch error', async () => {
fetchMock.reset();
fetchMock.get(EVENTS_ENDPOINT, {
status: 200,
@@ -198,7 +198,7 @@ describe('asyncEvent middleware', () => {
WS.clean();
});
- it('resolves with chart data on event done status', async () => {
+ test('resolves with chart data on event done status', async () => {
await wsServer.connected;
const promise = asyncEvent.waitForAsyncData(asyncPendingEvent);
@@ -211,7 +211,7 @@ describe('asyncEvent middleware', () => {
expect(fetchMock.calls(EVENTS_ENDPOINT)).toHaveLength(0);
});
- it('rejects on event error status', async () => {
+ test('rejects on event error status', async () => {
await wsServer.connected;
const promise = asyncEvent.waitForAsyncData(asyncPendingEvent);
@@ -226,7 +226,7 @@ describe('asyncEvent middleware', () => {
expect(fetchMock.calls(EVENTS_ENDPOINT)).toHaveLength(0);
});
- it('rejects on cached data fetch error', async () => {
+ test('rejects on cached data fetch error', async () => {
fetchMock.reset();
fetchMock.get(CACHED_DATA_ENDPOINT, {
status: 400,
@@ -251,7 +251,7 @@ describe('asyncEvent middleware', () => {
expect(fetchMock.calls(EVENTS_ENDPOINT)).toHaveLength(0);
});
- it('resolves when events are received before listener', async () => {
+ test('resolves when events are received before listener', async () => {
await wsServer.connected;
wsServer.send(JSON.stringify(asyncDoneEvent));
diff --git a/superset-frontend/src/middleware/logger.test.js b/superset-frontend/src/middleware/logger.test.js
index 0a28d42fde..38e158ff48 100644
--- a/superset-frontend/src/middleware/logger.test.js
+++ b/superset-frontend/src/middleware/logger.test.js
@@ -61,7 +61,7 @@ describe('logger middleware', () => {
timeSandbox.clock.reset();
});
- it('should listen to LOG_EVENT action type', () => {
+ test('should listen to LOG_EVENT action type', () => {
const action1 = {
type: 'ACTION_TYPE',
payload: {
@@ -72,7 +72,7 @@ describe('logger middleware', () => {
expect(next.callCount).toBe(1);
});
- it('should POST an event to /superset/log/ when called', () => {
+ test('should POST an event to /superset/log/ when called', () => {
logger(mockStore)(next)(action);
expect(next.callCount).toBe(0);
@@ -83,7 +83,7 @@ describe('logger middleware', () => {
);
});
- it('should include ts, start_offset, event_name, impression_id, source, and source_id in every event', () => {
+ test('should include ts, start_offset, event_name, impression_id, source, and source_id in every event', () => {
... 2877 lines suppressed ...