优化
This commit is contained in:
@@ -137,10 +137,12 @@ test('downloads selected carton labels with one array request', () => {
|
||||
test('exports every visible order field with normalized dates', () => {
|
||||
assert.match(source, /function formatExportDateTime\(value: string \| null \| undefined\)/)
|
||||
assert.match(source, /return `\$\{date\.getFullYear\(\)\}-\$\{pad\(date\.getMonth\(\) \+ 1\)\}-\$\{pad\(date\.getDate\(\)\)\} \$\{pad\(date\.getHours\(\)\)\}:\$\{pad\(date\.getMinutes\(\)\)\}:\$\{pad\(date\.getSeconds\(\)\)\}`/)
|
||||
for (const label of ['订单号', '入仓码', '渠道', '目的仓', '当前订单状态', '箱数', '快递公司', '快递单号', 'SKUS', '总毛重', '总净重', '总体积', '总数量', '计费单价', '计费体积', '计费重量', '备注', '货件编号', '跟踪编号', '国内仓入库时间', '创建时间']) {
|
||||
for (const label of ['订单号', '入仓码', '渠道', '运输方式', '交货方式', '预约提货时间', '目的仓', '目的仓类型', '当前订单状态', '箱数', '快递公司', '快递单号', 'SKUS', '总毛重', '总净重', '总体积', '总数量', '计费单价', '计费体积', '计费重量', '备注', '货件编号', '跟踪编号', '国内仓入库时间', '创建时间']) {
|
||||
assert.match(source, new RegExp(`'${label}'`))
|
||||
}
|
||||
assert.match(source, /formatExportDateTime\(order\.inboundedAt\)/)
|
||||
assert.match(source, /order\.pickupMethod === 'PICKUP' \? formatExportDateTime\(order\.requestedPickupAt\) : '-'/)
|
||||
assert.match(source, /formatListMetric\(order\.chargeableVolumeCbm, 'm³'\)/)
|
||||
assert.doesNotMatch(source, /formatExportDateTime\(order\.businessDate\)/)
|
||||
assert.match(source, /formatExportDateTime\(order\.createdAt\)/)
|
||||
})
|
||||
@@ -156,7 +158,7 @@ test('matches the prototype with selectable dense order-list columns', () => {
|
||||
assert.match(source, />恢复默认<\/el-button>/)
|
||||
assert.match(source, /const visibleOrderColumns = computed/)
|
||||
assert.match(source, /:columns="visibleOrderColumns"/)
|
||||
for (const label of ['入仓码', '渠道', '目的仓', '当前订单状态', '箱数', '快递公司', '快递单号', 'SKUS', '总毛重', '总净重', '总体积', '总数量', '计费单价', '计费体积', '计费重量', '备注', '货件编号', '跟踪编号', '国内仓入库时间']) {
|
||||
for (const label of ['入仓码', '渠道', '运输方式', '交货方式', '预约提货时间', '目的仓', '目的仓类型', '当前订单状态', '箱数', '快递公司', '快递单号', 'SKUS', '总毛重', '总净重', '总体积', '总数量', '计费单价', '计费体积', '计费重量', '备注', '货件编号', '跟踪编号', '国内仓入库时间']) {
|
||||
assert.match(source, new RegExp(`label: '${label}'`))
|
||||
}
|
||||
assert.match(source, /order\.businessSummary\.totalPackageCount/)
|
||||
@@ -164,7 +166,8 @@ test('matches the prototype with selectable dense order-list columns', () => {
|
||||
assert.match(source, /order\.items\.reduce/)
|
||||
assert.match(source, /<template #chargeableWeight>-<\/template>/)
|
||||
assert.match(source, /<template #billingUnitPrice>-<\/template>/)
|
||||
assert.match(source, /<template #chargeableVolume>-<\/template>/)
|
||||
assert.match(source, /<template #chargeableVolume="\{ row \}">\{\{ formatListMetric\(\(row as FirstLegOrder\)\.chargeableVolumeCbm, 'm³'\) \}\}<\/template>/)
|
||||
assert.match(source, /pickupMethod === 'PICKUP'[\s\S]{0,160}requestedPickupAt[\s\S]{0,160}: '-'/)
|
||||
assert.match(source, /inboundedAt/)
|
||||
assert.doesNotMatch(source, /label: '业务日期'/)
|
||||
assert.doesNotMatch(source, /<template #businessDate>/)
|
||||
|
||||
Reference in New Issue
Block a user