From d502490dbd5345f6cf45b04e1ea3b29ceb975064 Mon Sep 17 00:00:00 2001 From: playmaker410 Date: Mon, 1 Jun 2026 10:38:22 +0100 Subject: [PATCH] test(api): add unit tests for error mapping and auth header - Assert ApiError with statusCode + details on 400 validation error - Assert ApiError with 404 status on not-found response - Assert generic ApiError on 500 plain-text response - Assert Authorization: Bearer header is sent when token is set Closes #259 --- frontend/src/services/api.test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/services/api.test.ts b/frontend/src/services/api.test.ts index b3488df..c4c3fff 100644 --- a/frontend/src/services/api.test.ts +++ b/frontend/src/services/api.test.ts @@ -71,10 +71,11 @@ describe("api authentication", () => { ); await createStream({ - recipient: "G...", - amount: 100, - asset: "XLM", - duration: 3600, + sender: "GSENDER123456789012345678901234567890123456789012345678", + recipient: "GRECIPIENT12345678901234567890123456789012345678901234", + assetCode: "XLM", + totalAmount: 100, + durationSeconds: 3600, }); expect(fetchSpy).toHaveBeenCalledWith(