优化
This commit is contained in:
@@ -57,4 +57,23 @@ describe('OceanBookingLinkDialog', () => {
|
|||||||
expect(wrapper.emitted('linked')).toHaveLength(1)
|
expect(wrapper.emitted('linked')).toHaveLength(1)
|
||||||
wrapper.unmount()
|
wrapper.unmount()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('prefills and preserves a real container number recorded before booking linkage', async () => {
|
||||||
|
const existingContainer = { ...container, containerNo: 'MSCU6639870' }
|
||||||
|
const wrapper = mount(OceanBookingLinkDialog, {
|
||||||
|
props: { modelValue: true, container: existingContainer },
|
||||||
|
global: { plugins: [ElementPlus] },
|
||||||
|
})
|
||||||
|
await flushPromises()
|
||||||
|
const vm = wrapper.vm as unknown as { candidateKey: string; containerNo: string; save: () => Promise<void> }
|
||||||
|
expect(vm.containerNo).toBe('MSCU6639870')
|
||||||
|
|
||||||
|
vm.candidateKey = '101:202'
|
||||||
|
await vm.save()
|
||||||
|
|
||||||
|
expect(linkContainerOceanBooking).toHaveBeenCalledExactlyOnceWith('9001', {
|
||||||
|
oceanBookingId: '101', requirementId: '202', containerNo: 'MSCU6639870', expectedVersion: 7,
|
||||||
|
})
|
||||||
|
wrapper.unmount()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ function close() { emit('update:modelValue', false) }
|
|||||||
async function loadCandidates() {
|
async function loadCandidates() {
|
||||||
const target = props.container
|
const target = props.container
|
||||||
candidateKey.value = ''
|
candidateKey.value = ''
|
||||||
containerNo.value = ''
|
containerNo.value = normalizeContainerNo(target?.containerNo)
|
||||||
candidates.value = []
|
candidates.value = []
|
||||||
error.value = null
|
error.value = null
|
||||||
if (!target) return
|
if (!target) return
|
||||||
|
|||||||
Reference in New Issue
Block a user