From 8686f9eb9f1177e501d88056d40ddfb118ef0a48 Mon Sep 17 00:00:00 2001 From: Marcel Raddatz Date: Thu, 9 Apr 2026 12:16:29 +0200 Subject: [PATCH] test(planner): clarify server.test.ts error-branch test name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "when backend returns error" → "when data is undefined (error response without data)" — documents that the guard is data?.suggestions ?? [], not error field inspection. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/routes/(app)/planner/server.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/routes/(app)/planner/server.test.ts b/frontend/src/routes/(app)/planner/server.test.ts index 023d0fd..cd5bbd2 100644 --- a/frontend/src/routes/(app)/planner/server.test.ts +++ b/frontend/src/routes/(app)/planner/server.test.ts @@ -59,7 +59,7 @@ describe('GET /planner — suggestions route handler', () => { expect(body.suggestions[1].recipe.name).toBe('Nudeln'); }); - it('returns { suggestions: [] } when backend returns error', async () => { + it('returns { suggestions: [] } when data is undefined (error response without data)', async () => { mockGet.mockResolvedValueOnce({ data: undefined, error: { status: 500 } }); const url = new URL(`http://localhost/planner?planId=${PLAN_UUID}&date=${DATE}`);