This commit is contained in:
2026-08-06 20:14:54 +08:00
parent 20f8a436e0
commit ac762ed302
6 changed files with 136 additions and 23 deletions
@@ -118,7 +118,7 @@ test('does not expose the contradictory backend rejected state in the client mod
})
test('maps the final backend timeline and keeps missing custom nodes empty', () => {
assert.match(storeSource, /detail\.timeline\.flatMap/)
assert.match(storeSource, /\(detail\.timeline \?\? \[\]\)\.flatMap/)
assert.match(storeSource, /item\.mainStatus/)
assert.match(storeSource, /\(detail\.customNodes \?\? \[\]\)/)
assert.match(storeSource, /\.filter\(\(item\) => item\.customerVisible\)/)
@@ -127,6 +127,21 @@ test('maps the final backend timeline and keeps missing custom nodes empty', ()
assert.match(storeSource, /\.sort\(\(left, right\)/)
})
test('keeps unified detail mapping recoverable for historical partial responses', () => {
assert.match(storeSource, /\(detail\.parties \?\? \[\]\)\.find/)
assert.match(storeSource, /\(detail\.statusHistory \?\? \[\]\)\.map/)
assert.match(storeSource, /item\.attachmentIds\?\.length \?\? 0/)
assert.match(storeSource, /if \(!detail\?\.summary \|\| !detail\.order\?\.order\) throw new Error\('订单详情数据不完整,请刷新列表后重试'\)/)
})
test('maps customer-visible carrier and order lifecycle snapshots into detail', () => {
assert.match(apiSource, /export interface MerchantFirstLegOrder[\s\S]*carrierId\?: number \| string \| null/)
assert.match(storeSource, /carrierName: order\.carrierName \?\? ''/)
assert.match(storeSource, /receivingTime: order\.receivingTime \?\? ''/)
assert.match(storeSource, /submittedAt: order\.submittedAt \?\? ''/)
assert.match(storeSource, /completedAt: order\.completedAt \?\? ''/)
})
test('maps backend warehouse snapshots and fulfillment courier fields', () => {
assert.match(storeSource, /order\.receivingWarehouseAddress/)
assert.match(storeSource, /order\.expressCompany \?\? ''/)