装柜优化
This commit is contained in:
@@ -99,6 +99,28 @@ describe('GlobalSmartLoadingView', () => {
|
||||
expect(wrapper.text()).toContain('CB-1 装柜方案')
|
||||
})
|
||||
|
||||
it('does not overwrite the container status when selecting it', async () => {
|
||||
const waiting = { ...container, id: '9007199254740995', planId: '9007199254740996', cabinetNo: 'CB-WAIT', planStatus: 'WAIT_LOADING' as const }
|
||||
vi.mocked(listContainers).mockResolvedValue({ records: [container, waiting], page: 1, size: 100, total: 2, pages: 1 })
|
||||
vi.mocked(getSmartLoadingPlanByBooking).mockImplementation(async (bookingId) => (
|
||||
bookingId === waiting.id
|
||||
? { ...plan, bookingId: waiting.id, status: 'LOADING' as const }
|
||||
: plan
|
||||
))
|
||||
const wrapper = mount(GlobalSmartLoadingView, { global: { plugins: [ElementPlus] } })
|
||||
await flushPromises()
|
||||
|
||||
const waitingOption = wrapper.findAll('.container-option').find((item) => item.text().includes('CB-WAIT'))!
|
||||
expect(waitingOption.text()).toContain('待装柜')
|
||||
|
||||
await waitingOption.trigger('click')
|
||||
await flushPromises()
|
||||
|
||||
expect(getSmartLoadingPlanByBooking).toHaveBeenCalledWith(waiting.id)
|
||||
expect(waitingOption.text()).toContain('待装柜')
|
||||
expect(waitingOption.text()).not.toContain('拣货中')
|
||||
})
|
||||
|
||||
it('keeps picking containers editable while hiding the push action', async () => {
|
||||
const pushed = { ...container, id: '9007199254740995', planId: '9007199254740996', cabinetNo: 'CB-2', planStatus: 'LOADING' as const }
|
||||
const pickingPlan = { ...plan, bookingId: pushed.id, status: 'LOADING' as const }
|
||||
|
||||
Reference in New Issue
Block a user