bito-code-review[bot] commented on code in PR #34759:
URL: https://github.com/apache/superset/pull/34759#discussion_r2772563449
##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts:
##########
@@ -642,6 +642,116 @@ describe('Does transformProps transform series
correctly', () => {
'foo2, bar2': ['foo2', 'bar2'],
});
});
+
+ describe('Tooltip with long labels', () => {
+ it('should use axisValue for tooltip when available (richTooltip)', () => {
+ const longLabelData = [
+ {
+ data: [
+ {
+ 'This is a very long category name that would normally be
truncated': 100,
+ __timestamp: 599616000000,
+ },
+ {
+ 'Another extremely long category name for testing purposes': 200,
+ __timestamp: 599916000000,
+ },
+ ],
+ },
+ ];
+
+ const chartProps = new ChartProps({
+ ...chartPropsConfig,
+ formData: {
+ ...formData,
+ richTooltip: true,
+ },
+ queriesData: longLabelData,
+ });
+
+ const transformedProps = transformProps(
+ chartProps as EchartsTimeseriesChartProps,
+ );
+
+ // Get the tooltip formatter function
+ const tooltipFormatter = (transformedProps.echartOptions as any).tooltip
+ .formatter;
+
+ // Simulate params from ECharts with axisValue containing full label
+ const mockParams = [
+ {
+ axisValue:
+ 'This is a very long category name that would normally be
truncated',
+ value: [599616000000, 100],
+ seriesName:
+ 'This is a very long category name that would normally be
truncated',
+ },
+ ];
+
+ // Call the formatter and check it uses the full label
+ const result = tooltipFormatter(mockParams);
+ expect(result).toContain(
+ 'This is a very long category name that would normally be truncated',
+ );
+ });
Review Comment:
<!-- Bito Reply -->
This question isn’t related to the pull request. I can only help with
questions about the PR’s code or comments.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]