Copilot commented on code in PR #666:
URL: https://github.com/apache/shenyu-dashboard/pull/666#discussion_r4122366202


##########
src/utils/download.js:
##########
@@ -16,6 +16,35 @@
  */
 
 import fetch from "dva/fetch";
+import { notification } from "antd";
+import { handleUnauthorized } from "./request";

Review Comment:
   This new import path breaks the existing `src/models/common.test.js` 
export-error tests: that suite mocks `antd` with only `message` and mocks 
`../utils/request` as a bare `jest.fn()`, so `notification.error` and 
`handleUnauthorized` are both undefined when the 401 export case reaches this 
code. The test then rejects with the mock `TypeError` instead of the API 
message. Please update those mocks (and any equivalent consumers) to provide 
the newly required named exports, or move the shared unauthorized 
handler/notification dependency behind a separately mockable module.



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

Reply via email to