fix(consignment): 售价与差价分两行展示,避免差价被折断
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import test from 'node:test'
|
||||
|
||||
test('售价与差价分两行展示,差价完整不折行', async () => {
|
||||
const source = await readFile(
|
||||
new URL('../src/components/admin/ConsignmentPriceWithDiff.tsx', import.meta.url),
|
||||
'utf8',
|
||||
)
|
||||
|
||||
// PercentTable 会把列宽归一化成百分比,单行放不下时会把「(+¥」拆开,必须显式分行。
|
||||
assert.ok(source.includes("flexDirection: 'column'"), '售价与差价必须垂直排列')
|
||||
assert.ok(source.includes("whiteSpace: 'nowrap'"), '售价与差价都必须禁止折行')
|
||||
assert.ok(source.includes('fontSize: 12'), '差价字号应小于售价')
|
||||
assert.ok(!source.includes('({diff.text})'), '差价不再使用全角括号包裹')
|
||||
})
|
||||
Reference in New Issue
Block a user