This commit is contained in:
2026-09-20 14:43:31 +08:00
parent 810b4e11f5
commit 158ea8c8ea
2 changed files with 26 additions and 0 deletions
@@ -104,6 +104,29 @@ describe('UnifiedOrdersView co-load group behavior', () => {
expect(wrapper.text()).not.toContain('7000')
})
it.each(['PENDING_REVIEW', 'WAIT_MEASURE', 'WAIT_SPLIT', 'LOADING'] as const)(
'allows creating a co-load group when both orders are %s', async (mainStatus) => {
const selectedRows = rows.map(row => ({ ...row, mainStatus }))
vi.mocked(listPlatformUnifiedOrders).mockResolvedValue({ records: selectedRows, page: 1, size: 20, total: 2, pages: 1 })
const wrapper = mountView()
await flushPromises()
await wrapper.get('[data-testid="select"]').trigger('click')
expect(wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.attributes('disabled')).toBeUndefined()
},
)
it.each(['LOADED', 'DELIVERED', 'COMPLETED'] as const)(
'blocks creating a co-load group when selected orders are %s', async (mainStatus) => {
const selectedRows = rows.map(row => ({ ...row, mainStatus }))
vi.mocked(listPlatformUnifiedOrders).mockResolvedValue({ records: selectedRows, page: 1, size: 20, total: 2, pages: 1 })
const wrapper = mountView()
await flushPromises()
await wrapper.get('[data-testid="select"]').trigger('click')
expect(wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.attributes('disabled')).toBeDefined()
expect(createPlatformCoLoadGroup).not.toHaveBeenCalled()
},
)
it.each([
['平台收货仓', [{ ...rows[0], receivingWarehouseId: null, receivingWarehouseName: null }, rows[1]], '以下入仓码缺少平台收货仓:IN-1(仓库:未配置仓库;渠道:纽约渠道),请刷新后重试'],
['渠道', [{ ...rows[0], channelCode: null, channelName: null }, rows[1]], '以下入仓码缺少渠道:IN-1(仓库:义乌仓;渠道:未配置渠道),请刷新后重试'],