bito-code-review[bot] commented on PR #42618:
URL: https://github.com/apache/superset/pull/42618#issuecomment-5134146625

   <!-- Bito Reply -->
   The issue occurs because `renderAlertList` likely wraps the component in a 
Higher-Order Component (HOC) that overrides the `addSuccessToast` and 
`addDangerToast` props, causing the mock functions passed in the test to be 
ignored. To resolve this, you can either:
   
   1. **Render the unwrapped component:** Export the raw `AlertList` component 
separately from the HOC-wrapped version and test that directly.
   2. **Mock the HOC:** Use `jest.mock` to mock the HOC module, ensuring it 
returns the component as-is or allows passing through the props.
   3. **Assert dispatched actions:** If the component uses Redux or a similar 
state management system, you can mock the store and assert that the expected 
toast actions are dispatched to the store instead of relying on prop-passed 
callbacks.


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