优化
This commit is contained in:
@@ -66,4 +66,23 @@ describe('OutboundDetailView', () => {
|
||||
expect(wrapper.text()).toContain('取消出库单')
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
it.each([
|
||||
['warehouse-internal-id', '洛杉矶仓', '洛杉矶仓'],
|
||||
['warehouse-internal-id', null, '—'],
|
||||
['another-warehouse-id', '其他仓库', '—'],
|
||||
])('uses a matching warehouse name and never displays internal IDs (%s, %s)', async (deliveryWarehouseId, name, expected) => {
|
||||
vi.mocked(getOutbound).mockResolvedValueOnce({
|
||||
outbound: { id: '1', outboundNo: 'OUT/1', overseasWarehouseId: 'warehouse-internal-id' },
|
||||
delivery: { id: '2', customerId: 'customer-1', deliveryNo: 'DEL-1', outboundNo: 'OUT/1', dispatchNo: 'PC-1', status: 'WAIT_DELIVERY', palletCount: 2, packageCount: 20, createdAt: '2026-09-01T10:00:00', version: 1, allowedActions: [], overseasWarehouseId: deliveryWarehouseId, overseasWarehouseName: name },
|
||||
})
|
||||
const wrapper = mount(OutboundDetailView, { global: { plugins: [ElementPlus] } })
|
||||
await flushPromises()
|
||||
const labels = wrapper.findAll('.el-descriptions__label')
|
||||
const label = labels.find(item => item.text() === '海外仓')!
|
||||
expect(label.element.nextElementSibling?.textContent?.trim()).toBe(expected)
|
||||
expect(wrapper.text()).not.toContain('warehouse-internal-id')
|
||||
expect(wrapper.text()).not.toContain('another-warehouse-id')
|
||||
wrapper.unmount()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user