test(订单实收): 对齐规格落库 SQL 列位
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s

This commit is contained in:
Ubuntu
2026-11-03 13:01:37 +08:00
parent c4fa89a92a
commit b7f5cc3ce9
@@ -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)');
});