This commit is contained in:
2026-11-06 10:42:39 +08:00
parent 8d80074266
commit f5f62af4a7
16 changed files with 184 additions and 30 deletions
@@ -30,6 +30,19 @@ beforeEach(() => {
})
describe('outsourced business views', () => {
it('shows the complete destination set on a grouped looseboard order', async () => {
const detail = outsourcedBusinessFixture()
detail.row.destinations.push({ ...detail.row.destinations[0]!, destinationKey: 'destination-2', warehouseCode: 'FBA-2' })
detail.cargo = [{ ...detail.cargo[0]!, orderNo: 'LB-1', palletNo: 'PAL-1、PAL-2', destinationKeys: ['destination-1', 'destination-2'], packages: '9' }]
calls.detail.mockResolvedValue(detail)
const wrapper = mount(OutsourcedBusinessDetailView, { global }); await flushPromises()
wrapper.findComponent(Tabs).vm.$emit('update:modelValue', 'route'); await flushPromises()
const table = wrapper.findAllComponents(Table).find(component => component.props('columns').some((column: { prop?: string }) => column.prop === 'orderNo'))!
expect(table.props('data')).toHaveLength(1)
expect(table.props('data')[0]).toMatchObject({ orderNo: 'LB-1', palletNo: 'PAL-1、PAL-2', packages: '9' })
expect(table.text()).toContain('FBA-1、FBA-2')
wrapper.unmount()
})
it('keeps an owned vehicle with pooled cargo in the outsourced task list', async () => {
const detail = outsourcedBusinessFixture()
detail.row.vehicle.ownership = 'OWNED'