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


##########
src/utils/download.test.js:
##########
@@ -91,6 +94,41 @@ describe("download", () => {
     expect(clickSpy).not.toHaveBeenCalled();
   });
 
+  it("dispatches login/logout and resetPermission on an HTTP 401", async () => 
{
+    const response = createResponse({
+      ok: false,
+      status: 401,
+      statusText: "Unauthorized",
+      json: { code: 401, message: "Authentication failed", data: null },

Review Comment:
   This HTTP-status test also supplies `code: 401`, so it passes through the 
body-code branch even if the new `response.status === 401` check is removed or 
broken. Use a body without code 401 (or make `response.json()` reject) so the 
test independently covers the HTTP-level condition.



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