diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/utils/formatters.ts b/superset-frontend/plugins/plugin-chart-echarts/src/utils/formatters.ts index 2c53abf3839..579a621abb3 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/utils/formatters.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/utils/formatters.ts @@ -88,7 +88,7 @@ export function getTooltipTimeFormatter( export function getXAxisFormatter( format?: string, -): TimeFormatter | StringConstructor | undefined { +): TimeFormatter | undefined { if (format === SMART_DATE_ID) { return getSmartDateFormatter(); } diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/utils/formatters.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/utils/formatters.test.ts index fb47deafa0b..df3ac5ddd28 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/utils/formatters.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/utils/formatters.test.ts @@ -74,9 +74,7 @@ describe('getXAxisFormatter', () => { expect(formatter).toEqual(expectedFormatter); }); - it('should return String constructor as fallback', () => { - // This test verifies that the String constructor is returned - // Note: the current logic may not reach this case, but keeping for completeness + it('should return undefined for falsy values', () => { const formatter = getXAxisFormatter(null as any); expect(formatter).toBeUndefined(); });