fix(client): align customs completion notice and warehouse labels

This commit is contained in:
2026-09-28 17:01:36 +01:00
parent 32c5241a01
commit ffbe3480a8
5 changed files with 25 additions and 5 deletions
@@ -705,7 +705,9 @@ test('supports the frozen customs document workflow and customer-safe downloads'
assert.match(customsApiSource, /MAX_CUSTOMS_FILE_SIZE = 50 \* 1024 \* 1024/)
assert.match(customsApiSource, /data: \{ inboundIds, expectedVersion: document\.source\.version \}/)
assert.match(customsApiSource, /requestId: error\.requestId/)
assert.match(customsDialogSource, /报关开始后仅可查看和下载,不提供退回或解锁/)
assert.match(customsDialogSource, /客户原始资料已冻结,仍可确认或打回待确认的报关行回执/)
assert.match(customsDialogSource, /v-if="detail.status === 'COMPLETED'"[^>]*><strong>报关已完成/)
assert.match(customsDialogSource, /真实报关完税文件已齐全/)
assert.match(customsDialogSource, /item\.finalDocument/)
assert.match(customsDialogSource, /资料版本历史/)
assert.match(customsDialogSource, /尚未上传退税报关资料/)
@@ -1,6 +1,8 @@
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import test from 'node:test'
import { runInNewContext } from 'node:vm'
import ts from 'typescript'
const firstLeg = readFileSync(new URL('./FirstLegOrdersView.vue', import.meta.url), 'utf8')
const quickOrder = readFileSync(new URL('./QuickOrderView.vue', import.meta.url), 'utf8')
@@ -18,7 +20,22 @@ test('uses business identifiers and names without visible internal-ID fallbacks'
assert.doesNotMatch(quickOrder, />\{\{ result\.orderNo/)
assert.doesNotMatch(customs, /detail\.planNo \|\| detail\.loadingPlanId/)
assert.doesNotMatch(overseas, /overseasWarehouseName \|\| (?:item|candidate)\.overseasWarehouseId/)
assert.doesNotMatch(overseas, /row\(\[[^\]]*(?:item\.overseasWarehouseId|item\.operatingWarehouseId)/)
// Warehouse IDs may be inputs to a resolver, but must never be raw cells.
assert.doesNotMatch(overseas, /row\(\[[^\]]*[,[]\s*item\.(?:overseasWarehouseId|operatingWarehouseId)\s*[,\]]/)
})
test('warehouse labels never fall back to unknown internal IDs', () => {
const source = overseas.slice(overseas.indexOf('function warehouseDisplay('), overseas.indexOf('function statusLabel('))
const javascript = ts.transpileModule(source, { compilerOptions: { target: ts.ScriptTarget.ES2022 } }).outputText
const display = runInNewContext(`${javascript}; warehouseDisplay`, {
operationWarehouses: { value: [{ id: '1234567890123456789', warehouseCode: 'LAX', warehouseName: '洛杉矶仓' }] },
fbaWarehouses: { value: [] }, warehouseLabel: (warehouse) => warehouse.warehouseName,
})
assert.equal(display('1234567890123456789'), '洛杉矶仓')
assert.equal(display('LAX'), '洛杉矶仓')
assert.equal(display('9999999999999999999'), '—')
assert.equal(display('1234567890123456789,9999999999999999999'), '洛杉矶仓、—')
assert.equal(display(undefined), '—')
})
test('keeps internal IDs only as non-rendered routing, selection, and request values', () => {