mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore(lint): migrate Jest lint rules from eslint to oxlint (#37787)
Signed-off-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
@@ -119,7 +119,7 @@ describe('BigNumberWithTrendline', () => {
|
||||
);
|
||||
|
||||
describe('transformProps()', () => {
|
||||
it('should fallback and format time', () => {
|
||||
test('should fallback and format time', () => {
|
||||
const transformed = transformProps(props);
|
||||
// the first item is the last item sorted by __timestamp
|
||||
const lastDatum = transformed.trendLineData?.pop();
|
||||
@@ -140,7 +140,7 @@ describe('BigNumberWithTrendline', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('should respect datasource d3 format', () => {
|
||||
test('should respect datasource d3 format', () => {
|
||||
const propsWithDatasource = {
|
||||
...props,
|
||||
datasource: {
|
||||
@@ -162,7 +162,7 @@ describe('BigNumberWithTrendline', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('should format with datasource currency', () => {
|
||||
test('should format with datasource currency', () => {
|
||||
const propsWithDatasource = {
|
||||
...props,
|
||||
datasource: {
|
||||
@@ -188,7 +188,7 @@ describe('BigNumberWithTrendline', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('should show X axis when showXAxis is true', () => {
|
||||
test('should show X axis when showXAxis is true', () => {
|
||||
const transformed = transformProps({
|
||||
...props,
|
||||
formData: {
|
||||
@@ -199,7 +199,7 @@ describe('BigNumberWithTrendline', () => {
|
||||
expect((transformed.echartOptions?.xAxis as any).show).toBe(true);
|
||||
});
|
||||
|
||||
it('should not show X axis when showXAxis is false', () => {
|
||||
test('should not show X axis when showXAxis is false', () => {
|
||||
const transformed = transformProps({
|
||||
...props,
|
||||
formData: {
|
||||
@@ -210,7 +210,7 @@ describe('BigNumberWithTrendline', () => {
|
||||
expect((transformed.echartOptions?.xAxis as any).show).toBe(false);
|
||||
});
|
||||
|
||||
it('should show Y axis when showYAxis is true', () => {
|
||||
test('should show Y axis when showYAxis is true', () => {
|
||||
const transformed = transformProps({
|
||||
...props,
|
||||
formData: {
|
||||
@@ -221,7 +221,7 @@ describe('BigNumberWithTrendline', () => {
|
||||
expect((transformed.echartOptions?.yAxis as any).show).toBe(true);
|
||||
});
|
||||
|
||||
it('should not show Y axis when showYAxis is false', () => {
|
||||
test('should not show Y axis when showYAxis is false', () => {
|
||||
const transformed = transformProps({
|
||||
...props,
|
||||
formData: {
|
||||
@@ -233,7 +233,7 @@ describe('BigNumberWithTrendline', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should respect min/max label visibility settings', () => {
|
||||
test('should respect min/max label visibility settings', () => {
|
||||
const transformed = transformProps({
|
||||
...props,
|
||||
formData: {
|
||||
@@ -251,7 +251,7 @@ describe('BigNumberWithTrendline', () => {
|
||||
expect(yAxis.axisLabel.showMaxLabel).toBe(true);
|
||||
});
|
||||
|
||||
it('should use minimal grid when both axes are hidden', () => {
|
||||
test('should use minimal grid when both axes are hidden', () => {
|
||||
const transformed = transformProps({
|
||||
...props,
|
||||
formData: {
|
||||
@@ -269,7 +269,7 @@ describe('BigNumberWithTrendline', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should use expanded grid when either axis is shown', () => {
|
||||
test('should use expanded grid when either axis is shown', () => {
|
||||
const expandedGrid = {
|
||||
containLabel: true,
|
||||
bottom: TIMESERIES_CONSTANTS.gridOffsetBottom,
|
||||
@@ -365,7 +365,7 @@ describe('BigNumberWithTrendline - Aggregation Tests', () => {
|
||||
],
|
||||
} as unknown as BigNumberWithTrendlineChartProps;
|
||||
|
||||
it('should correctly calculate SUM', () => {
|
||||
test('should correctly calculate SUM', () => {
|
||||
const props = {
|
||||
...baseProps,
|
||||
formData: { ...baseProps.formData, aggregation: 'sum' },
|
||||
@@ -383,7 +383,7 @@ describe('BigNumberWithTrendline - Aggregation Tests', () => {
|
||||
expect(transformed.bigNumber).toStrictEqual(150);
|
||||
});
|
||||
|
||||
it('should correctly calculate AVG', () => {
|
||||
test('should correctly calculate AVG', () => {
|
||||
const props = {
|
||||
...baseProps,
|
||||
formData: { ...baseProps.formData, aggregation: 'mean' },
|
||||
@@ -401,7 +401,7 @@ describe('BigNumberWithTrendline - Aggregation Tests', () => {
|
||||
expect(transformed.bigNumber).toStrictEqual(37.5);
|
||||
});
|
||||
|
||||
it('should correctly calculate MIN', () => {
|
||||
test('should correctly calculate MIN', () => {
|
||||
const props = {
|
||||
...baseProps,
|
||||
formData: { ...baseProps.formData, aggregation: 'min' },
|
||||
@@ -419,7 +419,7 @@ describe('BigNumberWithTrendline - Aggregation Tests', () => {
|
||||
expect(transformed.bigNumber).toStrictEqual(10);
|
||||
});
|
||||
|
||||
it('should correctly calculate MAX', () => {
|
||||
test('should correctly calculate MAX', () => {
|
||||
const props = {
|
||||
...baseProps,
|
||||
formData: { ...baseProps.formData, aggregation: 'max' },
|
||||
@@ -437,7 +437,7 @@ describe('BigNumberWithTrendline - Aggregation Tests', () => {
|
||||
expect(transformed.bigNumber).toStrictEqual(60);
|
||||
});
|
||||
|
||||
it('should correctly calculate MEDIAN (odd count)', () => {
|
||||
test('should correctly calculate MEDIAN (odd count)', () => {
|
||||
const oddCountProps = {
|
||||
...baseProps,
|
||||
queriesData: [
|
||||
@@ -472,7 +472,7 @@ describe('BigNumberWithTrendline - Aggregation Tests', () => {
|
||||
expect(transformed.bigNumber).toStrictEqual(30);
|
||||
});
|
||||
|
||||
it('should correctly calculate MEDIAN (even count)', () => {
|
||||
test('should correctly calculate MEDIAN (even count)', () => {
|
||||
const props = {
|
||||
...propsWithEvenData,
|
||||
formData: { ...propsWithEvenData.formData, aggregation: 'median' },
|
||||
@@ -490,7 +490,7 @@ describe('BigNumberWithTrendline - Aggregation Tests', () => {
|
||||
expect(transformed.bigNumber).toStrictEqual(25);
|
||||
});
|
||||
|
||||
it('should return the LAST_VALUE correctly', () => {
|
||||
test('should return the LAST_VALUE correctly', () => {
|
||||
const transformed = transformProps(baseProps);
|
||||
expect(transformed.bigNumber).toStrictEqual(10);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user