bito-code-review[bot] commented on code in PR #44154: URL: https://github.com/apache/superset/pull/44154#discussion_r4165118313
########## superset-frontend/src/utils/downloadAsImage.test.ts: ########## @@ -69,13 +52,10 @@ const mockToJpeg = domToImage.toJpeg as jest.Mock; const mockToPng = domToImage.toPng as jest.Mock; const mockHtml2Canvas = html2canvas as jest.Mock; const mockIsSafari = isSafari as jest.Mock; -const mockAddWarningToast = addWarningToast as jest.Mock; +// Passed explicitly to downloadAsImageOptimized below, mirroring how a real +// caller supplies an already-bound `useToasts()` callback. +const mockAddWarningToast = jest.fn(); Review Comment: <!-- Bito Reply --> The suggestion to pass `mockAddWarningToast` as the 7th argument in the Safari rejection test is correct. By explicitly defining `mockAddWarningToast` as a `jest.fn()` and passing it to `downloadAsImageOptimized`, the test now correctly provides the expected callback, allowing the assertion to pass as intended. **superset-frontend/src/utils/downloadAsImage.test.ts** ``` // Passed explicitly to downloadAsImageOptimized below, mirroring how a real // caller supplies an already-bound `useToasts()` callback. const mockAddWarningToast = jest.fn(); ``` -- 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]
