amaannawab923 commented on code in PR #36416:
URL: https://github.com/apache/superset/pull/36416#discussion_r2665764634


##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts:
##########
@@ -723,3 +723,133 @@ describe('legend sorting', () => {
     ]);
   });
 });
+
+describe('EchartsTimeseries AUTO Mode Currency', () => {
+  it('should detect single currency and resolve AUTO mode', () => {
+    const chartProps = new ChartProps<SqlaFormData>({
+      ...chartPropsConfig,
+      formData: {
+        ...formData,
+        currencyFormat: { symbol: 'AUTO', symbolPosition: 'prefix' },
+      },
+      datasource: {
+        currencyCodeColumn: 'currency_code',
+        columnFormats: {},
+        currencyFormats: {},
+        verboseMap: {},
+      },
+      queriesData: [
+        {
+          data: [
+            {
+              'San Francisco': 1000,
+              __timestamp: 599616000000,
+              currency_code: 'USD',
+            },
+            {
+              'San Francisco': 2000,
+              __timestamp: 599916000000,
+              currency_code: 'USD',
+            },
+          ],
+        },
+      ],
+    });
+
+    const transformed = transformProps(
+      chartProps as EchartsTimeseriesChartProps,
+    );
+    // Y-axis formatter should contain $ for USD
+    const yAxisFormatter = (transformed.echartOptions.yAxis as any)?.axisLabel

Review Comment:
   Can we have a better type instead of any , we can extend the interface of 
EchartsTimeSeriesChartProps in order to accomodate yAxis



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