LuisSanchez commented on code in PR #36989:
URL: https://github.com/apache/superset/pull/36989#discussion_r2708821759
##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts:
##########
@@ -723,3 +727,169 @@ describe('legend sorting', () => {
]);
});
});
+
+const baseFormDataHorizontalBar: SqlaFormData = {
+ colorScheme: 'bnbColors',
+ datasource: '3__table',
+ granularity_sqla: '__timestamp',
+ metric: 'sum__num',
+ groupby: [],
+ viz_type: 'echarts_timeseries',
+ seriesType: EchartsTimeseriesSeriesType.Bar,
+ orientation: OrientationType.Horizontal,
+ truncateYAxis: true,
+ yAxisBounds: [null, null],
+};
+
+test('should set yAxis max to actual data max for horizontal bar charts', ()
=> {
+ const queriesData = [
+ {
+ data: [
+ { 'Series A': 15000, __timestamp: 599616000000 },
+ { 'Series A': 20000, __timestamp: 599916000000 },
+ { 'Series A': 18000, __timestamp: 600216000000 },
+ ],
Review Comment:
Even tho I prefer to set in a "hardcoded way" the timestamps for the tests
(mostly to avoid more functions or even flakies), I do see that in this file
the timestamp is used thoroughly so I had a complex discussion with some AI's
about it and I think we came up with a proper solution to the matter.
Check this helper utility for the timeseries module:
`superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/helpers.ts`
It should avoid redundancy and improve maintainability.
Let me know what do you think about it.
--
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]