rusackas commented on code in PR #34759:
URL: https://github.com/apache/superset/pull/34759#discussion_r2772562270


##########
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:
   Addressed in 5f4e772. The test now uses distinct values for `axisValue` (the 
full category label) and `seriesName` ('Series A') to properly verify that 
`axisValue` is used for the tooltip title. The assertion specifically checks 
for the `fullCategoryLabel` which only comes from `axisValue`, not from 
`seriesName`.



-- 
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]

Reply via email to