import assert from 'node:assert/strict'
import { describe, it } from 'node:test'
import {
CONTRACT_PRODUCT_COL_WIDTHS_PX,
normalizeContractProductTableWidths
} from './contract-product-table-widths'
const sample = `
| 产品名称 | 规格 | 品牌 | 单位 | 用量 | 税率 | 含税单价(元) | 未含税金额(元) | 税费(元) | 含税金额(元) | 包装规格 | 备注 |
`
describe('normalizeContractProductTableWidths', () => {
it('rewrites saved pixel columns so the product name is 100px', () => {
const out = normalizeContractProductTableWidths(sample)
assert.match(out, //)
assert.equal(out.includes('width: 73px'), false)
assert.match(out, /产品名称<\/th>/)
assert.match(out, /'
assert.equal(normalizeContractProductTableWidths(other), other)
})
})
|