From b7f5cc3ce953ff6400a8594fd8526b0cff56b662 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 3 Nov 2026 13:01:37 +0800 Subject: [PATCH] =?UTF-8?q?test(=E8=AE=A2=E5=8D=95=E5=AE=9E=E6=94=B6):=20?= =?UTF-8?q?=E5=AF=B9=E9=BD=90=E8=A7=84=E6=A0=BC=E8=90=BD=E5=BA=93=20SQL=20?= =?UTF-8?q?=E5=88=97=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/tests/orderItemsSpecPersistence.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/tests/orderItemsSpecPersistence.test.ts b/server/tests/orderItemsSpecPersistence.test.ts index a5a0c16..565ccb8 100644 --- a/server/tests/orderItemsSpecPersistence.test.ts +++ b/server/tests/orderItemsSpecPersistence.test.ts @@ -25,7 +25,7 @@ describe('录单规格 · 落库链路', () => { submitService.indexOf('INSERT INTO order_items ('), submitService.indexOf('RETURNING id::text AS id') ); - expect(insert, '列清单里必须有 spec').toMatch(/process_unit_price,\s*spec\s*\)/); + expect(insert, '列清单里必须有 spec').toMatch(/process_unit_price,\s*spec,/); expect(insert, '参数占位符要跟着加').toContain('$21'); }); @@ -57,8 +57,8 @@ describe('录单规格 · 落库链路', () => { expect(itemsService).toContain("Object.prototype.hasOwnProperty.call(row, 'spec')"); expect(itemsService).toContain('spec = CASE WHEN $20::boolean THEN $19 ELSE spec END'); // 新行直接落 spec(第 21 个参数) - expect(itemsService).toMatch(/ordered_quantity, spec\s*\)/); - expect(itemsService).toContain('$19::uuid[], $5, $21)'); + expect(itemsService).toMatch(/ordered_quantity, spec,/); + expect(itemsService).toMatch(/\$19::uuid\[\], \$5, \$21,/); // 60 字上限与录单一致 expect(itemsService).toContain('trimText(row.spec).slice(0, 60)'); });