优化
This commit is contained in:
@@ -57,4 +57,23 @@ describe('OceanBookingLinkDialog', () => {
|
||||
expect(wrapper.emitted('linked')).toHaveLength(1)
|
||||
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()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user