From 56c36cdae07cac939b533047585916ae3ae0d590 Mon Sep 17 00:00:00 2001 From: "gru-agent[bot]" <185149714+gru-agent[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 16:26:08 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test:=20Add=20test=20for=20404=20st?= =?UTF-8?q?atus=20response=20for=20ModelNotFound=20error=20type=20in=20err?= =?UTF-8?q?orResponse=20function.=20(#6361)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: gru-agent[bot] <185149714+gru-agent[bot]@users.noreply.github.com> --- src/utils/errorResponse.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/errorResponse.test.ts b/src/utils/errorResponse.test.ts index 77627da8243e6..d4d71f8bcc14b 100644 --- a/src/utils/errorResponse.test.ts +++ b/src/utils/errorResponse.test.ts @@ -32,6 +32,12 @@ describe('createErrorResponse', () => { expect(response.status).toBe(403); }); + it('returns a 404 status for ModelNotFound error type', () => { + const errorType = AgentRuntimeErrorType.ModelNotFound; + const response = createErrorResponse(errorType); + expect(response.status).toBe(404); + }); + it('returns a 429 status for InsufficientQuota error type', () => { const errorType = AgentRuntimeErrorType.InsufficientQuota; const response = createErrorResponse(errorType);