This commit is contained in:
2026-10-09 18:03:34 +08:00
parent 88dc4852c6
commit ebaa265993
7 changed files with 56 additions and 86 deletions
@@ -11,7 +11,8 @@ import {
} from '../api/relabelOrders'
import RelabelOrdersView from './RelabelOrdersView.vue'
vi.mock('vue-router', () => ({ useRouter: () => ({ push: vi.fn() }) }))
const routerPush = vi.hoisted(() => vi.fn())
vi.mock('vue-router', () => ({ useRouter: () => ({ push: routerPush }) }))
vi.mock('@/core/access/accessPreview', () => ({ useAccessPreviewStore: () => ({ can: () => true }) }))
vi.mock('@/modules/iam', () => ({ listPlatformTenants: vi.fn() }))
vi.mock('../api/relabelOrders', () => ({
@@ -145,7 +146,7 @@ describe('RelabelOrdersView', () => {
}))
})
it('keeps multi-selection connected to the packing-plan dialog in the integrated list', async () => {
it('opens the inventory source selector instead of treating relabel package counts as SKU quantities', async () => {
vi.mocked(listRelabelOrders).mockResolvedValueOnce({
records: [{ id: '1', relabelNo: 'RL-1', customerOrderNo: 'RETURN-1', skuCodes: 'SKU-TEST', totalPackageCount: 2, status: 'PENDING_PROCESSING' }],
page: 1, size: 10, total: 1, pages: 1,
@@ -158,8 +159,6 @@ describe('RelabelOrdersView', () => {
const createPlan = wrapper.get('.data-table__business-actions').findAll('button').find(button => button.text().includes('创建合箱计划(1)'))!
await createPlan.trigger('click')
await flushPromises()
const dialog = wrapper.findAllComponents(AppDialog).find(candidate => candidate.props('title') === '配置退货合箱计划')!
expect(dialog.props('modelValue')).toBe(true)
expect(dialog.findAllComponents({ name: 'ElInput' }).some(input => input.props('modelValue') === 'SKU-TEST')).toBe(true)
expect(routerPush).toHaveBeenCalledWith({ name: 'overseas-return-inventory', query: { packing: '1' } })
})
})