`
This commit is contained in:
@@ -14,7 +14,8 @@ test('exposes real list, draft, submit, and detail workflow entries without canc
|
||||
assert.match(source, /async function saveDraft\(\)/)
|
||||
assert.match(source, /function submitOrder\(\)/)
|
||||
assert.match(source, /async function openDetail\(order: FirstLegOrder\)/)
|
||||
assert.match(source, /Promise\.all\(\[store\.load\(\), firstLegPartySource\.load\(\)\]\)/)
|
||||
assert.match(source, /\[store\.load\(\), firstLegPartySource\.load\(\)\]/)
|
||||
assert.match(source, /tenantStore\.loadCompanyContext\(\)/)
|
||||
assert.match(source, /await store\.loadDetail\(order\.id\)/)
|
||||
assert.doesNotMatch(source, /cancelOrder|取消订单/)
|
||||
})
|
||||
@@ -54,6 +55,7 @@ test('requires an enabled platform receiving warehouse in the order form', () =>
|
||||
assert.match(source, /selectedWarehouse\.businessHours/)
|
||||
assert.match(source, /detailOrder\.receivingWarehouseSnapshot\?\.name/)
|
||||
assert.match(source, /detailOrder\.receivingWarehouseSnapshot\.code/)
|
||||
assert.match(source, /loadSelectedWarehouse\(detailedOrder\.receivingWarehouseId\)/)
|
||||
})
|
||||
|
||||
test('collects the backend-required first-leg fields', () => {
|
||||
@@ -71,6 +73,8 @@ test('selects enabled counterparties and stores editable order snapshots', () =>
|
||||
assert.match(source, /form\.shipperPartySnapshot\.contactName/)
|
||||
assert.match(source, /form\.consigneePartySnapshot\.address/)
|
||||
assert.match(source, /只影响本订单快照/)
|
||||
assert.match(source, /form\.shipperPartySnapshot\.name\} · 历史快照/)
|
||||
assert.match(source, /form\.consigneePartySnapshot\.name\} · 历史快照/)
|
||||
})
|
||||
|
||||
test('shows fulfillment courier information as read-only client detail', () => {
|
||||
@@ -81,3 +85,31 @@ test('shows fulfillment courier information as read-only client detail', () => {
|
||||
assert.doesNotMatch(source, /v-model="form\.expressCompanyName"/)
|
||||
assert.doesNotMatch(source, /v-model="form\.trackingNumber"/)
|
||||
})
|
||||
|
||||
test('protects unsaved drafts and exposes recoverable load failures', () => {
|
||||
assert.match(source, /onBeforeRouteLeave/)
|
||||
assert.match(source, /beforeunload/)
|
||||
assert.match(source, /confirmDiscardChanges/)
|
||||
assert.match(source, /:before-close="requestCloseEditor"/)
|
||||
assert.match(source, /store\.loadError/)
|
||||
assert.match(source, /订单数据加载失败/)
|
||||
assert.match(source, /订单详情加载失败/)
|
||||
assert.match(source, /@click="loadPageData"/)
|
||||
assert.match(source, /@click="retryDetail"/)
|
||||
})
|
||||
|
||||
test('copies reactive order drafts into plain request data', () => {
|
||||
assert.match(source, /function cloneDraft\(draft: FirstLegOrderDraft\)/)
|
||||
assert.match(source, /items: draft\.items\.map\(\(item\) => \(\{ \.\.\.item \}\)\)/)
|
||||
assert.match(source, /store\.saveDraft\(cloneDraft\(form\)/)
|
||||
assert.match(source, /store\.submit\(cloneDraft\(form\)/)
|
||||
assert.doesNotMatch(source, /structuredClone\((?:form|order\.)/)
|
||||
})
|
||||
|
||||
test('loads complete order detail before editing and rejects an unavailable historical warehouse', () => {
|
||||
assert.match(source, /async function openEdit\(order: FirstLegOrder\)/)
|
||||
assert.match(source, /const detailedOrder = await store\.loadDetail\(order\.id\)/)
|
||||
assert.match(source, /draftFromOrder\(detailedOrder\)/)
|
||||
assert.match(source, /draft\.receivingWarehouseId = ''/)
|
||||
assert.match(source, /原平台收货仓当前不可用,请重新选择可用收货仓/)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user