From fce1356cb6f8df4429c94c04e16dd9bc4ae9db87 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Wed, 30 Sep 2026 14:02:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/unifiedHttp.test.mjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/api/unifiedHttp.test.mjs b/src/api/unifiedHttp.test.mjs index 63e5da8..ecc5ba3 100644 --- a/src/api/unifiedHttp.test.mjs +++ b/src/api/unifiedHttp.test.mjs @@ -59,6 +59,13 @@ test('order and lastleg 401s share one refresh and replay the unified access tok assert.equal(calls.filter((call) => call.token === 'Bearer new-access').length, 2) }) +test('successful order submit with explicit null data is accepted', async () => { + const http = harness(async (config) => ({ + config, status: 200, headers: {}, data: { code: '200', message: 'success', data: null }, + })) + assert.equal(await http.apiRequest({ method: 'POST', url: '/merchant/v1/orders/first-leg/order-1/submit' }), null) +}) + test('data-less security failures preserve diagnostics and malformed success is rejected', async () => { for (const data of [{ code: 'A0403', message: 'Denied', traceId: 'trace-1', requestId: 'request-1' }, { code: '200', message: 'OK' }]) { const http = harness(async (config) => ({ config, status: 200, headers: {}, data }))