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


##########
superset-frontend/src/pages/AlertReportList/AlertReportList.test.tsx:
##########
@@ -593,3 +593,99 @@ test('trigger-now action does not duplicate in-flight 
requests', async () => {
     expect(fetchMock.callHistory.calls('execute-report-slow')).toHaveLength(1);
   });
 });
+
+test('trigger-now action displays correct success toast for Alert', async () 
=> {
+  const addSuccessToast = jest.fn();
+  fetchMock.post(
+    'glob:*/api/v1/report/*/execute',
+    {
+      execution_id: 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
+      message: 'Triggered',
+    },
+    { name: 'execute-alert-success' },
+  );
+
+  renderAlertList({ addSuccessToast });

Review Comment:
   These spies are passed through the default `withToasts(AlertList)` export, 
whose `connect` mapping replaces the same-named props, so all four new 
assertions receive zero calls and the Jest shard is currently failing. Could 
these tests render the unwrapped component, mock the HOC, or assert the 
dispatched toast actions instead?



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