fix: block unsafe container plan actions
This commit is contained in:
@@ -285,6 +285,29 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
expect(getContainerPlanProgress).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('keeps an invalid historical cabinet readable while blocking plan generation', async () => {
|
||||
const invalid = {
|
||||
...summary,
|
||||
overseasWarehouseId: null,
|
||||
overseasWarehouseCode: null,
|
||||
overseasWarehouseName: null,
|
||||
blockingReason: '柜内接柜仓业务快照不一致',
|
||||
}
|
||||
vi.mocked(listContainerPlanProgress).mockResolvedValueOnce({ records: [invalid], page: 1, size: 10, total: 1, pages: 1 } as never)
|
||||
vi.mocked(getContainerPlanProgress).mockResolvedValueOnce({ summary: invalid, orders: [] } as never)
|
||||
const wrapper = await mountView()
|
||||
await wrapper.findAll('.el-radio-button').find((item) => item.text().startsWith('柜子'))!.trigger('click')
|
||||
await flushPromises()
|
||||
|
||||
expect(wrapper.text()).toContain('柜内接柜仓业务快照不一致')
|
||||
expect((button(wrapper, '生成入库计划')!.element as HTMLButtonElement).disabled).toBe(true)
|
||||
await wrapper.get('.container-workbench-card__detail').trigger('click')
|
||||
await flushPromises()
|
||||
expect(getContainerPlanProgress).toHaveBeenCalledWith(bookingId)
|
||||
expect(document.body.textContent).toContain('柜子详情 · CONT-15')
|
||||
expect(convertLastMileContainerToInboundPlans).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('shows the receiving warehouse and changes it from ACTIVE OVERSEAS master data with versioning', async () => {
|
||||
vi.mocked(listAllPlatformWarehouses).mockResolvedValueOnce([receivingWarehouse] as never)
|
||||
const wrapper = await mountView()
|
||||
|
||||
Reference in New Issue
Block a user