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