This commit is contained in:
2026-08-31 16:44:38 +08:00
parent 83374ba6cc
commit 11f8b7856e
2 changed files with 10 additions and 10 deletions
@@ -61,11 +61,11 @@ describe('UnifiedOrdersView co-load group behavior', () => {
const wrapper = mountView()
await flushPromises()
await wrapper.get('[data-testid="select"]').trigger('click')
await wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!.trigger('click')
await wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.trigger('click')
await wrapper.get('[data-testid="dialog-confirm"]').trigger('click')
await flushPromises()
expect(createPlatformCoLoadGroup).toHaveBeenCalledWith(['5001', '5002'])
expect(wrapper.text()).toContain('设为同柜不可拆组(2)')
expect(wrapper.text()).toContain('合柜报关(2)')
expect(wrapper.text()).toContain('成员路线不一致')
expect(wrapper.text()).toContain('A0409 request-coload trace-coload')
expect(wrapper.text()).not.toContain('5001')
@@ -82,7 +82,7 @@ describe('UnifiedOrdersView co-load group behavior', () => {
const wrapper = mountView()
await flushPromises()
await wrapper.get('[data-testid="select"]').trigger('click')
const createButton = wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!
const createButton = wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!
expect(createButton.attributes('disabled')).toBeDefined()
expect(wrapper.text()).not.toContain(reason)
await createButton.trigger('click')
@@ -93,12 +93,12 @@ describe('UnifiedOrdersView co-load group behavior', () => {
const wrapper = mountView()
await flushPromises()
expect(wrapper.text()).not.toContain('请至少勾选 2 票订单后再设为同柜组')
expect(wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!.attributes('disabled')).toBeDefined()
expect(wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.attributes('disabled')).toBeDefined()
;(wrapper.vm as unknown as { handleOrderSelectionChange: (selected: typeof rows) => void }).handleOrderSelectionChange([rows[0]])
await wrapper.vm.$nextTick()
expect(wrapper.text()).not.toContain('当前仅选择 1 票')
expect(wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!.attributes('disabled')).toBeDefined()
expect(wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.attributes('disabled')).toBeDefined()
expect(wrapper.text()).not.toContain('5001')
expect(wrapper.text()).not.toContain('7000')
})
@@ -121,7 +121,7 @@ describe('UnifiedOrdersView co-load group behavior', () => {
const wrapper = mountView()
await flushPromises()
await wrapper.get('[data-testid="select"]').trigger('click')
await wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!.trigger('click')
await wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.trigger('click')
await wrapper.get('[data-testid="dialog-confirm"]').trigger('click')
await flushPromises()
expect(createPlatformCoLoadGroup).toHaveBeenCalledWith(['5001', '5002'])
@@ -132,7 +132,7 @@ describe('UnifiedOrdersView co-load group behavior', () => {
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(wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.attributes('disabled')).toBeDefined()
expect(wrapper.text()).not.toContain('所选订单的渠道不同')
expect(createPlatformCoLoadGroup).not.toHaveBeenCalled()
})
@@ -158,7 +158,7 @@ describe('UnifiedOrdersView co-load group behavior', () => {
await flushPromises()
expect(wrapper.findAll('button').find((button) => button.text().includes('批量审核通过'))!.attributes('disabled')).toBeUndefined()
expect(wrapper.findAll('button').find((button) => button.text().includes('批量审核通过'))!.text()).toContain('(3)')
expect(wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!.attributes('disabled')).toBeDefined()
expect(wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.attributes('disabled')).toBeDefined()
expect(wrapper.text()).not.toContain('平台收货仓不同')
expect(wrapper.text()).not.toContain('渠道不同')
})