diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js index 39666417afa..c63532c97a9 100644 --- a/superset-frontend/.eslintrc.js +++ b/superset-frontend/.eslintrc.js @@ -83,7 +83,6 @@ module.exports = { 'plugin:react-hooks/recommended', 'plugin:react-prefer-function-component/recommended', 'plugin:storybook/recommended', - 'plugin:react-you-might-not-need-an-effect/legacy-recommended', ], parser: '@babel/eslint-parser', parserOptions: { @@ -273,6 +272,10 @@ module.exports = { { files: ['packages/**'], rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { devDependencies: true }, + ], 'no-restricted-imports': [ 'error', { @@ -324,7 +327,12 @@ module.exports = { '*.stories.tsx', '*.stories.jsx', 'fixtures.*', - 'playwright/**/*', + '**/test/**/*', + '**/tests/**/*', + 'spec/**/*', + '**/fixtures/**/*', + '**/__mocks__/**/*', + '**/spec/**/*', ], excludedFiles: 'cypress-base/cypress/**/*', plugins: ['jest', 'jest-dom', 'no-only-tests', 'testing-library'], @@ -348,7 +356,9 @@ module.exports = { devDependencies: true, }, ], + 'jest/consistent-test-it': 'error', 'no-only-tests/no-only-tests': 'error', + 'prefer-promise-reject-errors': 0, 'max-classes-per-file': 0, // temporary rules to help with migration - please re-enable! 'testing-library/await-async-queries': 0, @@ -387,6 +397,12 @@ module.exports = { '*.stories.tsx', '*.stories.jsx', 'fixtures.*', + '**/test/**/*', + '**/tests/**/*', + 'spec/**/*', + '**/fixtures/**/*', + '**/__mocks__/**/*', + '**/spec/**/*', 'cypress-base/cypress/**/*', 'Stories.tsx', 'packages/superset-ui-core/src/theme/index.tsx', @@ -400,10 +416,27 @@ module.exports = { }, }, { - files: ['playwright/**/*'], + // Override specifically for packages stories and overview files + // This must come LAST to override other rules + files: [ + 'packages/**/*.stories.*', + 'packages/**/*.overview.*', + 'packages/**/fixtures.*', + ], rules: { - 'import/no-unresolved': 0, // Playwright is not installed in main build - 'import/no-extraneous-dependencies': 0, // Playwright is not installed in main build + 'import/no-extraneous-dependencies': 'off', + }, + }, + { + // Allow @playwright/test imports in Playwright test files + files: ['playwright/**/*.ts', 'playwright/**/*.js'], + rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: true, + }, + ], }, }, ], @@ -412,7 +445,13 @@ module.exports = { 'theme-colors/no-literal-colors': 'error', 'icons/no-fa-icons-usage': 'error', 'i18n-strings/no-template-vars': ['error', true], - 'i18n-strings/sentence-case-buttons': 'error', + camelcase: [ + 'error', + { + allow: ['^UNSAFE_'], + properties: 'never', + }, + ], 'class-methods-use-this': 0, curly: 2, 'func-names': 0, diff --git a/superset-frontend/packages/generator-superset/.eslintrc b/superset-frontend/packages/generator-superset/.eslintrc deleted file mode 100644 index fd46989cba4..00000000000 --- a/superset-frontend/packages/generator-superset/.eslintrc +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -{ - "settings": { - "import/resolver": { - "typescript": {} - } - } -} diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/operators/aggregateOperator.test.ts b/superset-frontend/packages/superset-ui-chart-controls/test/operators/aggregateOperator.test.ts index 52e3e454078..ddc8d5785a8 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/operators/aggregateOperator.test.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/test/operators/aggregateOperator.test.ts @@ -40,7 +40,7 @@ describe('aggregationOperator', () => { granularity: 'month', }; - test('should return undefined for LAST_VALUE aggregation', () => { + it('should return undefined for LAST_VALUE aggregation', () => { const formDataWithLastValue = { ...formData, aggregation: 'LAST_VALUE', @@ -51,7 +51,7 @@ describe('aggregationOperator', () => { ).toBeUndefined(); }); - test('should return undefined when metrics is empty', () => { + it('should return undefined when metrics is empty', () => { const queryObjectWithoutMetrics = { ...queryObject, metrics: [], @@ -67,7 +67,7 @@ describe('aggregationOperator', () => { ).toBeUndefined(); }); - test('should apply sum aggregation to all metrics', () => { + it('should apply sum aggregation to all metrics', () => { const formDataWithSum = { ...formData, aggregation: 'sum', @@ -91,7 +91,7 @@ describe('aggregationOperator', () => { }); }); - test('should apply mean aggregation to all metrics', () => { + it('should apply mean aggregation to all metrics', () => { const formDataWithMean = { ...formData, aggregation: 'mean', @@ -115,7 +115,7 @@ describe('aggregationOperator', () => { }); }); - test('should use default aggregation when not specified', () => { + it('should use default aggregation when not specified', () => { expect(aggregationOperator(formData, queryObject)).toBeUndefined(); }); }); diff --git a/superset-frontend/packages/superset-ui-core/.eslintrc b/superset-frontend/packages/superset-ui-core/.eslintrc deleted file mode 100644 index e0ff7c67bb8..00000000000 --- a/superset-frontend/packages/superset-ui-core/.eslintrc +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -{ - "plugins": ["jest", "jest-dom", "no-only-tests", "testing-library"], - "env": { - "jest/globals": true - }, - "settings": { - "jest": { - "version": "detect" - } - }, - "extends": [ - "plugin:jest/recommended", - "plugin:jest-dom/recommended", - "plugin:testing-library/react" - ], - "overrides": [ - { - "files": [ - "**/*.stories.*", - "**/*.overview.*", - "**/fixtures.*" - ], - "rules": { - "import/no-extraneous-dependencies": "off" - } - } - ], - "rules": { - "import/no-extraneous-dependencies": ["error", { "devDependencies": true }], - "jest/consistent-test-it": "error", - "no-only-tests/no-only-tests": "error", - "prefer-promise-reject-errors": 0, - - "testing-library/no-node-access": "off", - "testing-library/prefer-screen-queries": "off", - "testing-library/no-container": "off", - "testing-library/await-async-queries": "off", - "testing-library/await-async-utils": "off", - "testing-library/no-await-sync-events": "off", - "testing-library/no-render-in-lifecycle": "off", - "testing-library/no-unnecessary-act": "off", - "testing-library/no-wait-for-multiple-assertions": "off", - "testing-library/await-async-events": "off", - "testing-library/no-wait-for-side-effects": "off", - "testing-library/prefer-presence-queries": "off", - "testing-library/render-result-naming-convention": "off", - "testing-library/prefer-find-by": "off", - "testing-library/no-manual-cleanup": "off" - } -} diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.test.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.test.tsx index a3d97f48803..23512663b68 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.test.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.test.tsx @@ -122,7 +122,7 @@ describe('DeckGLPolygon bucket generation logic', () => { const renderWithTheme = (component: React.ReactElement) => render({component}); - test('should use getBuckets for linear_palette color scheme', () => { + it('should use getBuckets for linear_palette color scheme', () => { const propsWithLinearPalette = { ...mockProps, formData: { @@ -138,7 +138,7 @@ describe('DeckGLPolygon bucket generation logic', () => { expect(mockGetColorBreakpointsBuckets).not.toHaveBeenCalled(); }); - test('should use getBuckets for fixed_color color scheme', () => { + it('should use getBuckets for fixed_color color scheme', () => { const propsWithFixedColor = { ...mockProps, formData: { @@ -154,7 +154,7 @@ describe('DeckGLPolygon bucket generation logic', () => { expect(mockGetColorBreakpointsBuckets).not.toHaveBeenCalled(); }); - test('should use getColorBreakpointsBuckets for color_breakpoints scheme', () => { + it('should use getColorBreakpointsBuckets for color_breakpoints scheme', () => { const propsWithBreakpoints = { ...mockProps, formData: { @@ -187,7 +187,7 @@ describe('DeckGLPolygon bucket generation logic', () => { expect(mockGetBuckets).not.toHaveBeenCalled(); }); - test('should use getBuckets when color_scheme_type is undefined (backward compatibility)', () => { + it('should use getBuckets when color_scheme_type is undefined (backward compatibility)', () => { const propsWithUndefinedScheme = { ...mockProps, formData: { @@ -203,7 +203,7 @@ describe('DeckGLPolygon bucket generation logic', () => { expect(mockGetColorBreakpointsBuckets).not.toHaveBeenCalled(); }); - test('should use getBuckets for unsupported color schemes (categorical_palette)', () => { + it('should use getBuckets for unsupported color schemes (categorical_palette)', () => { const propsWithUnsupportedScheme = { ...mockProps, formData: { @@ -230,7 +230,7 @@ describe('DeckGLPolygon Error Handling and Edge Cases', () => { const renderWithTheme = (component: React.ReactElement) => render({component}); - test('handles empty features data gracefully', () => { + it('handles empty features data gracefully', () => { const propsWithEmptyData = { ...mockProps, payload: { @@ -249,7 +249,7 @@ describe('DeckGLPolygon Error Handling and Edge Cases', () => { expect(mockGetColorBreakpointsBuckets).not.toHaveBeenCalled(); }); - test('handles missing color_breakpoints for color_breakpoints scheme', () => { + it('handles missing color_breakpoints for color_breakpoints scheme', () => { const propsWithMissingBreakpoints = { ...mockProps, formData: { @@ -266,7 +266,7 @@ describe('DeckGLPolygon Error Handling and Edge Cases', () => { expect(mockGetBuckets).not.toHaveBeenCalled(); }); - test('handles null legend_position correctly', () => { + it('handles null legend_position correctly', () => { const propsWithNullLegendPosition = { ...mockProps, formData: { @@ -294,7 +294,7 @@ describe('DeckGLPolygon Legend Integration', () => { const renderWithTheme = (component: React.ReactElement) => render({component}); - test('renders legend with non-empty categories when metric and linear_palette are defined', () => { + it('renders legend with non-empty categories when metric and linear_palette are defined', () => { const { container } = renderWithTheme(); // Verify the component renders and calls the correct bucket function @@ -309,7 +309,7 @@ describe('DeckGLPolygon Legend Integration', () => { expect(Object.keys(categoriesData)).toHaveLength(2); }); - test('does not render legend when metric is null', () => { + it('does not render legend when metric is null', () => { const propsWithoutMetric = { ...mockProps, formData: { @@ -326,7 +326,7 @@ describe('DeckGLPolygon Legend Integration', () => { }); describe('getPoints utility', () => { - test('extracts points from polygon data', () => { + it('extracts points from polygon data', () => { const data = [ { polygon: [ diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/spatialUtils.test.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/spatialUtils.test.ts index c169ed4c33f..fbe222f78f3 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/spatialUtils.test.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/spatialUtils.test.ts @@ -64,7 +64,7 @@ Object.defineProperty(document, 'getElementById', { const mockDecode = decode as jest.MockedFunction; describe('spatialUtils', () => { - test('getSpatialColumns returns correct columns for latlong type', () => { + it('getSpatialColumns returns correct columns for latlong type', () => { const spatial: SpatialFormData['spatial'] = { type: 'latlong', lonCol: 'longitude', @@ -75,7 +75,7 @@ describe('spatialUtils', () => { expect(result).toEqual(['longitude', 'latitude']); }); - test('getSpatialColumns returns correct columns for delimited type', () => { + it('getSpatialColumns returns correct columns for delimited type', () => { const spatial: SpatialFormData['spatial'] = { type: 'delimited', lonlatCol: 'coordinates', @@ -85,7 +85,7 @@ describe('spatialUtils', () => { expect(result).toEqual(['coordinates']); }); - test('getSpatialColumns returns correct columns for geohash type', () => { + it('getSpatialColumns returns correct columns for geohash type', () => { const spatial: SpatialFormData['spatial'] = { type: 'geohash', geohashCol: 'geohash_code', @@ -95,16 +95,16 @@ describe('spatialUtils', () => { expect(result).toEqual(['geohash_code']); }); - test('getSpatialColumns throws error when spatial is null', () => { + it('getSpatialColumns throws error when spatial is null', () => { expect(() => getSpatialColumns(null as any)).toThrow('Bad spatial key'); }); - test('getSpatialColumns throws error when spatial type is missing', () => { + it('getSpatialColumns throws error when spatial type is missing', () => { const spatial = {} as SpatialFormData['spatial']; expect(() => getSpatialColumns(spatial)).toThrow('Bad spatial key'); }); - test('getSpatialColumns throws error when latlong columns are missing', () => { + it('getSpatialColumns throws error when latlong columns are missing', () => { const spatial: SpatialFormData['spatial'] = { type: 'latlong', }; @@ -113,7 +113,7 @@ describe('spatialUtils', () => { ); }); - test('getSpatialColumns throws error when delimited column is missing', () => { + it('getSpatialColumns throws error when delimited column is missing', () => { const spatial: SpatialFormData['spatial'] = { type: 'delimited', }; @@ -122,7 +122,7 @@ describe('spatialUtils', () => { ); }); - test('getSpatialColumns throws error when geohash column is missing', () => { + it('getSpatialColumns throws error when geohash column is missing', () => { const spatial: SpatialFormData['spatial'] = { type: 'geohash', }; @@ -131,7 +131,7 @@ describe('spatialUtils', () => { ); }); - test('getSpatialColumns throws error for unknown spatial type', () => { + it('getSpatialColumns throws error for unknown spatial type', () => { const spatial = { type: 'unknown', } as any; @@ -140,7 +140,7 @@ describe('spatialUtils', () => { ); }); - test('addSpatialNullFilters adds null filters for spatial columns', () => { + it('addSpatialNullFilters adds null filters for spatial columns', () => { const spatial: SpatialFormData['spatial'] = { type: 'latlong', lonCol: 'longitude', @@ -159,7 +159,7 @@ describe('spatialUtils', () => { ]); }); - test('addSpatialNullFilters returns original filters when spatial is null', () => { + it('addSpatialNullFilters returns original filters when spatial is null', () => { const existingFilters: QueryObjectFilterClause[] = [ { col: 'test_col', op: '==', val: 'test' }, ]; @@ -168,7 +168,7 @@ describe('spatialUtils', () => { expect(result).toBe(existingFilters); }); - test('addSpatialNullFilters works with empty filters array', () => { + it('addSpatialNullFilters works with empty filters array', () => { const spatial: SpatialFormData['spatial'] = { type: 'delimited', lonlatCol: 'coordinates', @@ -181,7 +181,7 @@ describe('spatialUtils', () => { ]); }); - test('buildSpatialQuery throws error when spatial is missing', () => { + it('buildSpatialQuery throws error when spatial is missing', () => { const formData = {} as SpatialFormData; expect(() => buildSpatialQuery(formData)).toThrow( @@ -189,7 +189,7 @@ describe('spatialUtils', () => { ); }); - test('buildSpatialQuery calls buildQueryContext with correct parameters', () => { + it('buildSpatialQuery calls buildQueryContext with correct parameters', () => { const mockBuildQueryContext = jest.requireMock('@superset-ui/core').buildQueryContext; const formData: SpatialFormData = { @@ -209,7 +209,7 @@ describe('spatialUtils', () => { }); }); - test('processSpatialData processes latlong data correctly', () => { + it('processSpatialData processes latlong data correctly', () => { const records = [ { longitude: -122.4, latitude: 37.8, count: 10, extra: 'test1' }, { longitude: -122.5, latitude: 37.9, count: 20, extra: 'test2' }, @@ -237,7 +237,7 @@ describe('spatialUtils', () => { }); }); - test('processSpatialData processes delimited data correctly', () => { + it('processSpatialData processes delimited data correctly', () => { const records = [ { coordinates: '-122.4,37.8', count: 15 }, { coordinates: '-122.5,37.9', count: 25 }, @@ -257,7 +257,7 @@ describe('spatialUtils', () => { }); }); - test('processSpatialData processes geohash data correctly', () => { + it('processSpatialData processes geohash data correctly', () => { mockDecode.mockReturnValue({ latitude: 37.8, longitude: -122.4, @@ -284,7 +284,7 @@ describe('spatialUtils', () => { expect(mockDecode).toHaveBeenCalledWith('dr5regw3p'); }); - test('processSpatialData reverses coordinates when reverseCheckbox is true', () => { + it('processSpatialData reverses coordinates when reverseCheckbox is true', () => { const records = [{ longitude: -122.4, latitude: 37.8, count: 10 }]; const spatial: SpatialFormData['spatial'] = { type: 'latlong', @@ -298,7 +298,7 @@ describe('spatialUtils', () => { expect(result[0].position).toEqual([37.8, -122.4]); }); - test('processSpatialData handles invalid coordinates', () => { + it('processSpatialData handles invalid coordinates', () => { const records = [ { longitude: 'invalid', latitude: 37.8, count: 10 }, { longitude: -122.4, latitude: NaN, count: 20 }, @@ -318,7 +318,7 @@ describe('spatialUtils', () => { expect(result).toHaveLength(0); }); - test('processSpatialData handles missing metric values', () => { + it('processSpatialData handles missing metric values', () => { const records = [ { longitude: -122.4, latitude: 37.8, count: null }, { longitude: -122.5, latitude: 37.9 }, @@ -338,7 +338,7 @@ describe('spatialUtils', () => { expect(result[2].weight).toBe(1); }); - test('processSpatialData returns empty array for empty records', () => { + it('processSpatialData returns empty array for empty records', () => { const spatial: SpatialFormData['spatial'] = { type: 'latlong', lonCol: 'longitude', @@ -350,7 +350,7 @@ describe('spatialUtils', () => { expect(result).toEqual([]); }); - test('processSpatialData returns empty array when spatial is null', () => { + it('processSpatialData returns empty array when spatial is null', () => { const records = [{ longitude: -122.4, latitude: 37.8 }]; const result = processSpatialData(records, null as any); @@ -358,7 +358,7 @@ describe('spatialUtils', () => { expect(result).toEqual([]); }); - test('processSpatialData handles delimited coordinate edge cases', () => { + it('processSpatialData handles delimited coordinate edge cases', () => { const records = [ { coordinates: '', count: 10 }, { coordinates: null, count: 20 }, @@ -382,7 +382,7 @@ describe('spatialUtils', () => { }); }); - test('processSpatialData copies additional properties correctly', () => { + it('processSpatialData copies additional properties correctly', () => { const records = [ { longitude: -122.4, @@ -416,7 +416,7 @@ describe('spatialUtils', () => { expect(result[0]).not.toHaveProperty('extra_col'); }); - test('transformSpatialProps transforms chart props correctly', () => { + it('transformSpatialProps transforms chart props correctly', () => { const mockGetMetricLabel = jest.requireMock('@superset-ui/core').getMetricLabel; mockGetMetricLabel.mockReturnValue('count_label'); @@ -510,7 +510,7 @@ describe('spatialUtils', () => { expect(result.payload.data.metricLabels).toEqual(['count_label']); }); - test('transformSpatialProps handles missing hooks gracefully', () => { + it('transformSpatialProps handles missing hooks gracefully', () => { const chartProps: ChartProps = { datasource: { id: 1, @@ -556,7 +556,7 @@ describe('spatialUtils', () => { expect(typeof result.setTooltip).toBe('function'); }); - test('transformSpatialProps handles missing metric', () => { + it('transformSpatialProps handles missing metric', () => { const mockGetMetricLabel = jest.requireMock('@superset-ui/core').getMetricLabel; mockGetMetricLabel.mockReturnValue(undefined); diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/utils/themeOverrides.test.ts b/superset-frontend/plugins/plugin-chart-echarts/src/utils/themeOverrides.test.ts index 931f026cb5f..5cf6bbd01a4 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/utils/themeOverrides.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/utils/themeOverrides.test.ts @@ -19,7 +19,7 @@ import { mergeReplaceArrays } from '@superset-ui/core'; describe('Theme Override Deep Merge Behavior', () => { - test('should merge nested objects correctly', () => { + it('should merge nested objects correctly', () => { const baseOptions = { grid: { left: '5%', @@ -67,7 +67,7 @@ describe('Theme Override Deep Merge Behavior', () => { }); }); - test('should replace arrays instead of merging them', () => { + it('should replace arrays instead of merging them', () => { const baseOptions = { series: [ { name: 'Series 1', type: 'line' }, @@ -86,7 +86,7 @@ describe('Theme Override Deep Merge Behavior', () => { expect(result.series).toHaveLength(1); }); - test('should handle null overrides correctly', () => { + it('should handle null overrides correctly', () => { const baseOptions = { grid: { left: '5%', @@ -127,7 +127,7 @@ describe('Theme Override Deep Merge Behavior', () => { }); }); - test('should handle override precedence correctly', () => { + it('should handle override precedence correctly', () => { const baseTheme = { textStyle: { color: '#000', fontSize: 12 }, }; @@ -167,7 +167,7 @@ describe('Theme Override Deep Merge Behavior', () => { }); }); - test('should preserve deep nested structures', () => { + it('should preserve deep nested structures', () => { const baseOptions = { xAxis: { axisLabel: { @@ -215,7 +215,7 @@ describe('Theme Override Deep Merge Behavior', () => { }); }); - test('should handle function values correctly', () => { + it('should handle function values correctly', () => { const formatFunction = (value: any) => `${value}%`; const overrideFunction = (value: any) => `$${value}`; @@ -241,7 +241,7 @@ describe('Theme Override Deep Merge Behavior', () => { expect(result.yAxis.axisLabel.formatter('100')).toBe('$100'); }); - test('should handle empty objects and arrays', () => { + it('should handle empty objects and arrays', () => { const baseOptions = { series: [{ name: 'Test', data: [1, 2, 3] }], grid: { left: '5%' }, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts index a403a464e75..2ececa1a877 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts @@ -117,7 +117,7 @@ const chartPropsConfig = { theme: supersetTheme, }; -it('should transform chart props for viz with showQueryIdentifiers=false', () => { +test('should transform chart props for viz with showQueryIdentifiers=false', () => { const chartPropsConfigWithoutIdentifiers = { ...chartPropsConfig, formData: { @@ -158,7 +158,7 @@ it('should transform chart props for viz with showQueryIdentifiers=false', () => ]); }); -it('should transform chart props for viz with showQueryIdentifiers=true', () => { +test('should transform chart props for viz with showQueryIdentifiers=true', () => { const chartPropsConfigWithIdentifiers = { ...chartPropsConfig, formData: { @@ -259,7 +259,7 @@ describe('legend sorting', () => { }); }); -it('legend margin: top orientation sets grid.top correctly', () => { +test('legend margin: top orientation sets grid.top correctly', () => { const chartPropsConfigWithoutIdentifiers = { ...chartPropsConfig, formData: { @@ -274,7 +274,7 @@ it('legend margin: top orientation sets grid.top correctly', () => { expect((transformed.echartOptions.grid as any).top).toEqual(270); }); -it('legend margin: bottom orientation sets grid.bottom correctly', () => { +test('legend margin: bottom orientation sets grid.bottom correctly', () => { const chartPropsConfigWithoutIdentifiers = { ...chartPropsConfig, formData: { @@ -290,7 +290,7 @@ it('legend margin: bottom orientation sets grid.bottom correctly', () => { expect((transformed.echartOptions.grid as any).bottom).toEqual(270); }); -it('legend margin: left orientation sets grid.left correctly', () => { +test('legend margin: left orientation sets grid.left correctly', () => { const chartPropsConfigWithoutIdentifiers = { ...chartPropsConfig, formData: { @@ -306,7 +306,7 @@ it('legend margin: left orientation sets grid.left correctly', () => { expect((transformed.echartOptions.grid as any).left).toEqual(270); }); -it('legend margin: right orientation sets grid.right correctly', () => { +test('legend margin: right orientation sets grid.right correctly', () => { const chartPropsConfigWithoutIdentifiers = { ...chartPropsConfig, formData: { diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts index 8f04e1c4031..954221d56c8 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts @@ -32,7 +32,7 @@ const mockColorScale = jest.fn( describe('transformSeries', () => { const series = { name: 'test-series' }; - test('should use the colorScaleKey if timeShiftColor is enabled', () => { + it('should use the colorScaleKey if timeShiftColor is enabled', () => { const opts = { timeShiftColor: true, colorScaleKey: 'test-key', @@ -44,7 +44,7 @@ describe('transformSeries', () => { expect((result as any)?.itemStyle.color).toBe('color-for-test-key-1'); }); - test('should use seriesKey if timeShiftColor is not enabled', () => { + it('should use seriesKey if timeShiftColor is not enabled', () => { const opts = { timeShiftColor: false, seriesKey: 'series-key', @@ -56,7 +56,7 @@ describe('transformSeries', () => { expect((result as any)?.itemStyle.color).toBe('color-for-series-key-2'); }); - test('should apply border styles for bar series with connectNulls', () => { + it('should apply border styles for bar series with connectNulls', () => { const opts = { seriesType: EchartsTimeseriesSeriesType.Bar, connectNulls: true, @@ -72,7 +72,7 @@ describe('transformSeries', () => { ); }); - test('should not apply border styles for non-bar series', () => { + it('should not apply border styles for non-bar series', () => { const opts = { seriesType: EchartsTimeseriesSeriesType.Line, connectNulls: true, @@ -88,7 +88,7 @@ describe('transformSeries', () => { }); describe('transformNegativeLabelsPosition', () => { - test('label position bottom of negative value no Horizontal', () => { + it('label position bottom of negative value no Horizontal', () => { const isHorizontal = false; const series: SeriesOption = { data: [ @@ -112,7 +112,7 @@ describe('transformNegativeLabelsPosition', () => { expect((result as any)[4].label).toBe(undefined); }); - test('label position left of negative value is Horizontal', () => { + it('label position left of negative value is Horizontal', () => { const isHorizontal = true; const series: SeriesOption = { data: [ @@ -137,7 +137,7 @@ describe('transformNegativeLabelsPosition', () => { expect((result as any)[4].label.position).toBe('outside'); }); - test('label position to line type', () => { + it('label position to line type', () => { const isHorizontal = false; const series: SeriesOption = { data: [ @@ -165,7 +165,7 @@ describe('transformNegativeLabelsPosition', () => { expect((result as any)[4].label).toBe(undefined); }); - test('label position to bar type and stack', () => { + it('label position to bar type and stack', () => { const isHorizontal = false; const series: SeriesOption = { data: [ diff --git a/superset-frontend/spec/.eslintrc b/superset-frontend/spec/.eslintrc deleted file mode 100644 index 7e3683e803c..00000000000 --- a/superset-frontend/spec/.eslintrc +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -{ - "plugins": ["jest", "jest-dom", "no-only-tests", "testing-library"], - "env": { - "jest/globals": true - }, - "settings": { - "jest": { - "version": "detect" - } - }, - "extends": [ - "plugin:jest/recommended", - "plugin:jest-dom/recommended", - "plugin:testing-library/react" - ], - "rules": { - "import/no-extraneous-dependencies": ["error", { "devDependencies": true }], - "jest/consistent-test-it": "error", - "no-only-tests/no-only-tests": "error", - "prefer-promise-reject-errors": 0 - } -} diff --git a/superset-frontend/spec/javascripts/dashboard/.eslintrc b/superset-frontend/spec/javascripts/dashboard/.eslintrc deleted file mode 100644 index 7a8a576a8c5..00000000000 --- a/superset-frontend/spec/javascripts/dashboard/.eslintrc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "extends": "prettier", - "plugins": ["prettier"], - "rules": { - "prefer-template": 2, - "new-cap": 2, - "no-restricted-syntax": 2, - "guard-for-in": 2, - "prefer-arrow-callback": 2, - "func-names": 2, - "react/jsx-no-bind": 2, - "no-confusing-arrow": 2, - "jsx-a11y/no-static-element-interactions": 2, - "jsx-a11y/anchor-has-content": 2, - "react/require-default-props": 2, - "no-plusplus": 2, - "no-mixed-operators": 0, - "no-continue": 2, - "no-bitwise": 2, - "no-multi-assign": 2, - "no-restricted-properties": 2, - "no-prototype-builtins": 2, - "class-methods-use-this": 2, - "import/no-named-as-default": 2, - "react/no-unescaped-entities": 2, - "react/no-string-refs": 2, - "react/jsx-indent": 0, - "prettier/prettier": "error" - } -}