This commit is contained in:
2026-08-07 14:47:00 +08:00
parent 54fe05d864
commit 0bd872fdbf
12 changed files with 461 additions and 36 deletions
@@ -201,13 +201,13 @@ test('auto-fills trusted warehouse and company data instead of asking customers
})
test('collects the backend-required first-leg fields', () => {
for (const model of ['destinationCountryCode', 'destinationWarehouseName', 'channelCode', 'pickupMethod', 'taxMode', 'destinationType', 'packageType', 'upc']) {
for (const model of ['destinationCountryCode', 'destinationWarehouseName', 'channelCode', 'pricingTaxMode', 'pickupMethod', 'taxMode', 'destinationType', 'packageType', 'upc']) {
assert.match(source, new RegExp(`v-model="(?:form|item)\\.${model}"`))
}
assert.match(source, /form\.channelName = channel\?\.name/)
assert.match(source, /form\.channelName = channel\?\.channelName/)
})
test('distills order creation into the confirmed prototype sections without fake pricing', () => {
test('distills order creation into the confirmed prototype sections with server pricing', () => {
assert.match(source, /<h3>目的地信息<\/h3>/)
assert.match(source, /<h3>发货信息<\/h3>/)
assert.match(source, /<h3>货物明细<\/h3>/)
@@ -217,10 +217,51 @@ test('distills order creation into the confirmed prototype sections without fake
assert.match(source, /class="prototype-form-row prototype-form-row--tabs"/)
assert.match(source, /class="cargo-primary-grid"/)
assert.match(source, /title="更多申报信息"/)
assert.doesNotMatch(source, /费用预估|查看最新报价|cost-estimate/)
assert.match(source, /参考运费/)
assert.match(source, /仅供参考,最终以实际结算为准/)
assert.doesNotMatch(source, /v-model="form\.(?:businessType|origin|destination|priority|tradeTerm)"/)
})
test('loads only active server channels for the selected domestic warehouse', () => {
assert.match(source, /getMerchantPricingChannels\(warehouseId\)/)
assert.match(source, /const channelOptions = ref<MerchantPricingChannel\[\]>\(\[\]\)/)
assert.match(source, /channelOptions\.value = \[\]/)
assert.match(source, /form\.channelCode = ''/)
assert.match(source, /sequence !== channelRequestSequence \|\| form\.receivingWarehouseId !== warehouseId/)
assert.match(source, /channel\.pricingTaxModes\.includes\(form\.pricingTaxMode\)/)
assert.match(source, /availablePricingTaxModes/)
assert.match(source, /:loading="channelLoading"/)
assert.match(source, /:disabled="!form\.receivingWarehouseId \|\| channelLoading"/)
assert.match(source, /当前收货仓暂无可用渠道/)
assert.match(source, /渠道加载失败/)
assert.match(source, /@click="retryPricingChannels"/)
assert.doesNotMatch(source, /SEA-US-GENERAL|SEA-US-SENSITIVE|SEA-US-EXPRESS|美线 FBA 直送/)
assert.doesNotMatch(source, /channelOptions\.some\(\(channel\) => channel\.code/)
})
test('estimates by warehouse, destination, tax mode, weight and volume without blocking saves', () => {
assert.match(source, /estimateMerchantFirstLegPrice\(request\)/)
assert.match(source, /originWarehouseId: form\.receivingWarehouseId/)
assert.match(source, /destinationCode: form\.destinationType === 'FBA' \? form\.amazonWarehouseCode : undefined/)
assert.match(source, /destinationWarehouseId: form\.destinationType === 'OVERSEAS'/)
assert.match(source, /pricingTaxMode: form\.pricingTaxMode/)
assert.match(source, /actualWeightKg: summary\.grossWeightKg/)
assert.match(source, /actualVolumeCbm: summary\.volumeCbm/)
assert.match(source, /setTimeout\(\(\) => void loadPriceEstimate\(\), 300\)/)
assert.match(source, /sequence === estimateRequestSequence/)
assert.match(source, /您仍可正常保存订单草稿/)
assert.match(source, /v-for="mode in availablePricingTaxModes"/)
assert.match(source, /pricingTaxModeLabel\(mode\)/)
assert.doesNotMatch(source, /当前价格表不提供不包税报价|历史草稿的不包税设置/)
const saveSource = source.slice(source.indexOf('async function saveDraft()'), source.indexOf('async function submitOrder()'))
assert.doesNotMatch(saveSource, /loadPriceEstimate|priceEstimateError|estimateMerchantFirstLegPrice/)
})
test('keeps the reference estimate readable on narrow screens', () => {
assert.match(source, /\.price-estimate__result \{ grid-template-columns: 1fr; \}/)
assert.match(source, /\.price-estimate__result > small \{ grid-column: auto; \}/)
})
test('shows field-level validation and concise guidance for required order inputs', () => {
assert.match(source, /ref="orderFormRef"[^>]*:model="form" :rules="orderFormRules"/)
assert.match(source, /prop="shipperPartySnapshot\.contactName" required/)
@@ -256,10 +297,10 @@ test('shows the full customer-safe order detail without platform-only controls',
for (const heading of ['订单与运输', '收发货信息', '关键业务摘要', '履约快递信息', '货物明细']) {
assert.match(source, new RegExp(`<h3>${heading}<\\/h3>`))
}
for (const field of ['贸易条款', '发货方式', '报关方式', '运输渠道', '承运商', '收货要求', '目的仓类型', '海关查验', '提交时间', '完成时间', 'SKU / UPC', 'HS 编码', '申报价值', '危险品']) {
for (const field of ['贸易条款', '发货方式', '报关方式', '运输渠道', '收货要求', '目的仓类型', '海关查验', '提交时间', '完成时间', 'SKU / UPC', 'HS 编码', '申报价值', '危险品']) {
assert.match(source, new RegExp(field))
}
assert.match(source, /detailOrder\.carrierName \|\| '待平台指派'/)
assert.doesNotMatch(detailSource, /承运商|待平台指派/)
assert.match(source, /detailOrder\.customerRemark/)
assert.doesNotMatch(detailSource, /内部备注|审核通过|添加备注/)
})
@@ -317,6 +358,7 @@ test('loads complete order detail before editing and rejects an unavailable hist
assert.match(source, /const detailedOrder = await store\.loadDetail\(order\.id\)/)
assert.match(source, /draftFromOrder\(detailedOrder\)/)
assert.match(source, /draft\.receivingWarehouseId = ''/)
assert.match(source, /draft\.channelCode = ''/)
assert.match(source, /原平台收货仓当前不可用,请重新选择可用收货仓/)
assert.match(source, /原目的仓当前不可用,请重新选择平台维护的目的仓/)
})