rusackas commented on code in PR #42491:
URL: https://github.com/apache/superset/pull/42491#discussion_r3680234792
##########
superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.test.tsx:
##########
@@ -566,3 +566,31 @@ test('should pass filterState from dataMask to
ChartContainer', () => {
mockFilterState,
);
});
+
+test('should pass chartStackTrace to ChartContainer so dashboard chart errors
stay expandable', () => {
+ // Regression guard for #31858: the dashboard chart wrapper stopped
forwarding
+ // the stack trace, so failed charts rendered a flat error with no "See more"
+ // affordance while the same error in Explore stayed expandable.
+ const stackTrace = 'Traceback (most recent call last): ValueError: boom';
+
+ setup(
+ {},
+ {
+ ...defaultState,
+ charts: {
+ ...defaultState.charts,
+ [queryId]: {
+ ...defaultState.charts[queryId],
+ chartStatus: 'failed',
+ chartAlert: 'Something went wrong',
+ chartStackTrace: stackTrace,
+ },
+ },
+ },
+ );
+
+ expect(capturedChartContainerProps).toHaveProperty(
+ 'chartStackTrace',
+ stackTrace,
+ );
Review Comment:
This test is scoped to the actual regression, `Chart.tsx` dropped forwarding
`chartStackTrace` to `ChartContainer`, so mocking it out mirrors the
`filterState` test right above it. The "See more" rendering itself is already
covered in `ErrorMessageWithStackTrace.test.tsx`, so I would rather not
duplicate that here.
--
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]