sadpandajoe commented on code in PR #42618:
URL: https://github.com/apache/superset/pull/42618#discussion_r3718432224


##########
superset-frontend/src/pages/AlertReportList/AlertReportList.test.tsx:
##########
@@ -44,6 +45,23 @@ jest.mock('src/utils/getBootstrapData', () => ({
   })),
 }));
 
+// Mock withToasts HOC to inject default toast functions while preserving 
explicit test spies passed via props
+jest.mock('src/components/MessageToasts/withToasts', () => ({
+  __esModule: true,
+  default: <P extends object>(Component: React.ComponentType<P>) =>
+    function MockWithToasts(props: P) {
+      return (
+        <Component

Review Comment:
   This generic wrapper cannot prove that an arbitrary `ComponentType<P>` 
accepts the four injected toast props, so the current `lint-frontend` check 
fails here with TS2322. Could the mock use an explicit toast-aware prop type 
(or render an exported unwrapped component) so the test suite type-checks?



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