test(订单详情): 钉住"全额抵扣不展示采购成本价、但部分抵扣仍要展示"
开发者 2026-10-15 确认口径:「不需要整列隐藏,相当于就是不展示;但是如果是部分抵扣,他的采购成本还是需要展示的」。 在 `costColumns` 契约测试 ②b 里补两条断言: · 三元分支必须保持 `isFullyStockCovered ? null : (canEditPrice && rowEditable ? …)` —— 即**非全额**(部分抵扣/无抵扣) 照常渲染采购成本(可改价输入仍在),防止后人误改成"整列隐藏"或"部分抵扣也不显示"; · `rowBlock` 仍须含 `<OrderItemPriceInput`。 验证:该契约测试 8 例全绿(前端 tsc 0 error,未改产品代码)。
This commit is contained in:
@@ -49,6 +49,13 @@ describe('订单详情:成本价拆「采购成本价 / 抵扣成本价」两
|
||||
expect(panel).toContain('const isFullyStockCovered =');
|
||||
expect(panel).toMatch(/Number\(item\.cover_qty\) > 0/);
|
||||
expect(panel).toMatch(/Number\(item\.cover_qty\) \+ 1e-9 >= \(Number\(item\.quantity\) \|\| 0\)/);
|
||||
/**
|
||||
* 反之必须**照常展示**:部分抵扣 / 无抵扣的行,缺口那部分是**真要花钱采购**的
|
||||
* ⇒ 采购成本价仍要显示且可改价(开发者 2026-10-15 确认:「如果是部分抵扣,他的采购成本还是需要展示的」)。
|
||||
* 不许演变成"整列隐藏"或"部分抵扣也不显示"。
|
||||
*/
|
||||
expect(rowBlock).toMatch(/isFullyStockCovered \? null : canEditPrice && rowEditable \? \(/);
|
||||
expect(rowBlock).toContain('<OrderItemPriceInput');
|
||||
});
|
||||
|
||||
it('③ 无抵扣的行:抵扣格留空(既不显示 0 也不显示「—」)', () => {
|
||||
|
||||
Reference in New Issue
Block a user