chore(lint): migrate Jest lint rules from eslint to oxlint (#37787)

Signed-off-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
Đỗ Trọng Hải
2026-02-08 16:44:42 +07:00
committed by GitHub
parent c4d2d42b3b
commit 563d9f1a3f
264 changed files with 1893 additions and 1952 deletions

View File

@@ -44,7 +44,7 @@ jest.mock('@superset-ui/chart-controls', () => {
});
describe('BigNumber Total Control Panel Config', () => {
it('should have the required control panel sections', () => {
test('should have the required control panel sections', () => {
expect(controlPanel).toHaveProperty('controlPanelSections');
const sections = controlPanel.controlPanelSections;
expect(Array.isArray(sections)).toBe(true);
@@ -74,7 +74,7 @@ describe('BigNumber Total Control Panel Config', () => {
expect(conditionalFormattingRow).toBeTruthy();
});
it('should have y_axis_format override with correct label', () => {
test('should have y_axis_format override with correct label', () => {
expect(controlPanel).toHaveProperty('controlOverrides');
expect(controlPanel.controlOverrides).toHaveProperty('y_axis_format');
expect(controlPanel.controlOverrides!.y_axis_format!.label).toBe(
@@ -82,7 +82,7 @@ describe('BigNumber Total Control Panel Config', () => {
);
});
it('should override formData metric using getStandardizedControls', () => {
test('should override formData metric using getStandardizedControls', () => {
const dummyFormData = { someProp: 'test' } as unknown as SqlaFormData;
const newFormData = controlPanel.formDataOverrides!(dummyFormData);

View File

@@ -66,7 +66,7 @@ describe('BigNumberTotal transformProps', () => {
const baseRawFormData = { dummy: 'raw' };
it('should return null bigNumber when no data is provided', () => {
test('should return null bigNumber when no data is provided', () => {
const chartProps = {
width: 400,
height: 300,
@@ -91,7 +91,7 @@ describe('BigNumberTotal transformProps', () => {
// colorThresholdFormatters fallback to empty array when getColorFormatters returns falsy
expect(result.colorThresholdFormatters).toEqual([]);
});
it('should convert subheader to subtitle', () => {
test('should convert subheader to subtitle', () => {
const chartProps = {
width: 400,
height: 300,
@@ -120,7 +120,7 @@ describe('BigNumberTotal transformProps', () => {
},
};
it('uses subtitle font size when subtitle is provided', () => {
test('uses subtitle font size when subtitle is provided', () => {
const result = transformProps({
...baseChartProps,
formData: {
@@ -139,7 +139,7 @@ describe('BigNumberTotal transformProps', () => {
expect(result.subtitleFontSize).toBe(0.4);
});
it('should compute bigNumber using parseMetricValue when data exists', () => {
test('should compute bigNumber using parseMetricValue when data exists', () => {
const chartProps = {
width: 500,
height: 400,
@@ -160,7 +160,7 @@ describe('BigNumberTotal transformProps', () => {
expect(result.bigNumber).toEqual(456);
});
it('should use formatTime as headerFormatter for Temporal or String types or forced formatting', () => {
test('should use formatTime as headerFormatter for Temporal or String types or forced formatting', () => {
// Case 1: Temporal type
const chartPropsTemporal = {
width: 600,
@@ -214,7 +214,7 @@ describe('BigNumberTotal transformProps', () => {
expect(resultForced.headerFormatter(5)).toBe('5pm');
});
it('should use numberFormatter as headerFormatter when not Temporal/String and no forced formatting', () => {
test('should use numberFormatter as headerFormatter when not Temporal/String and no forced formatting', () => {
const chartProps = {
width: 700,
height: 500,
@@ -231,7 +231,7 @@ describe('BigNumberTotal transformProps', () => {
expect(result.headerFormatter(500)).toBe('$500');
});
it('should propagate colorThresholdFormatters from getColorFormatters', () => {
test('should propagate colorThresholdFormatters from getColorFormatters', () => {
// Override the getColorFormatters mock to return specific value
const mockFormatters = [{ formatter: 'red' }];
(getColorFormatters as jest.Mock).mockReturnValueOnce(mockFormatters);

View File

@@ -49,7 +49,7 @@ describe('BigNumberWithTrendline buildQuery', () => {
aggregation: null,
};
it('creates raw metric query when aggregation is "raw"', () => {
test('creates raw metric query when aggregation is "raw"', () => {
const queryContext = buildQuery({ ...baseFormData, aggregation: 'raw' });
const bigNumberQuery = queryContext.queries[1];
@@ -58,7 +58,7 @@ describe('BigNumberWithTrendline buildQuery', () => {
expect(bigNumberQuery.columns).toEqual([]);
});
it('returns single query for aggregation methods that can be computed client-side', () => {
test('returns single query for aggregation methods that can be computed client-side', () => {
const queryContext = buildQuery({ ...baseFormData, aggregation: 'sum' });
expect(queryContext.queries.length).toBe(1);
@@ -70,7 +70,7 @@ describe('BigNumberWithTrendline buildQuery', () => {
]);
});
it('returns single query for LAST_VALUE aggregation', () => {
test('returns single query for LAST_VALUE aggregation', () => {
const queryContext = buildQuery({
...baseFormData,
aggregation: 'LAST_VALUE',
@@ -85,7 +85,7 @@ describe('BigNumberWithTrendline buildQuery', () => {
]);
});
it('returns two queries only for raw aggregation', () => {
test('returns two queries only for raw aggregation', () => {
const queryContext = buildQuery({ ...baseFormData, aggregation: 'raw' });
expect(queryContext.queries.length).toBe(2);

View File

@@ -123,7 +123,7 @@ describe('BigNumberWithTrendline transformProps', () => {
const baseHooks = { onContextMenu };
const baseRawFormData = { dummy: 'raw' };
it('should return null bigNumber when no data is provided', () => {
test('should return null bigNumber when no data is provided', () => {
const chartProps = {
width: 400,
height: 300,
@@ -142,7 +142,7 @@ describe('BigNumberWithTrendline transformProps', () => {
expect(result.subtitle).toBe('subtitle message');
});
it('should calculate subheader as percent change with suffix', () => {
test('should calculate subheader as percent change with suffix', () => {
const chartProps = {
width: 500,
height: 400,
@@ -169,7 +169,7 @@ describe('BigNumberWithTrendline transformProps', () => {
expect(result.subheader).toBe('10.0% WoW');
});
it('should compute bigNumber from parseMetricValue', () => {
test('should compute bigNumber from parseMetricValue', () => {
const chartProps = {
width: 600,
height: 450,
@@ -195,7 +195,7 @@ describe('BigNumberWithTrendline transformProps', () => {
expect(result.bigNumber).toEqual(456);
});
it('should use formatTime as headerFormatter for Temporal/String or forced', () => {
test('should use formatTime as headerFormatter for Temporal/String or forced', () => {
const formData = { ...baseFormData, forceTimestampFormatting: true };
const chartProps = {
width: 600,
@@ -222,7 +222,7 @@ describe('BigNumberWithTrendline transformProps', () => {
expect(result.headerFormatter(5)).toBe('5pm');
});
it('should use numberFormatter when not Temporal/String and not forced', () => {
test('should use numberFormatter when not Temporal/String and not forced', () => {
const formData = { ...baseFormData, forceTimestampFormatting: false };
const chartProps = {
width: 600,
@@ -247,7 +247,7 @@ describe('BigNumberWithTrendline transformProps', () => {
expect(result.headerFormatter.format(500)).toBe('$500');
});
it('should use last data point for comparison when big number comes from aggregated data', () => {
test('should use last data point for comparison when big number comes from aggregated data', () => {
const chartProps = {
width: 500,
height: 400,