sadpandajoe commented on code in PR #42618:
URL: https://github.com/apache/superset/pull/42618#discussion_r3685925129
##########
superset-frontend/src/pages/AlertReportList/AlertReportList.test.tsx:
##########
@@ -44,6 +44,12 @@ jest.mock('src/utils/getBootstrapData', () => ({
})),
}));
+// Mock withToasts HOC to be a passthrough so toast spies passed via props are
preserved
+jest.mock('src/components/MessageToasts/withToasts', () => ({
+ __esModule: true,
+ default: <P extends object>(Component: React.ComponentType<P>) => Component,
Review Comment:
This passthrough also removes the toast callbacks that the HOC normally
injects, so the existing toggle/delete tests now throw when they reach
`handleErrorMsg`, `addSuccessToast`, or `addDangerToast`, and the current Jest
shard is failing. Could the mock inject default toast functions while still
allowing each test's explicit spies to override them?
--
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]