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)'); });