fix: align audit and dispatch workflows and release failed requests
This commit is contained in:
@@ -33,12 +33,12 @@ it('HTTP 200/A0409 unlocks the form so corrected content receives a new key', as
|
||||
const corrected = vi.mocked(api.createFleetQuote).mock.calls[1]!
|
||||
expect(corrected[0]).not.toBe(original[0]); expect(corrected[1].originCity).toBe('QA-Another-Origin'); expect(corrected[1].fullDeliveryPrice).toBe(0)
|
||||
})
|
||||
it('unknown creation retains its exact key after viewing another quote', async () => {
|
||||
it('unknown creation unlocks the current form and sends edited values with a fresh key', async () => {
|
||||
const wrapper = await mount(); vi.mocked(api.createFleetQuote).mockRejectedValueOnce(new Error('Network unavailable'))
|
||||
await clickSave(wrapper); const original = vi.mocked(api.createFleetQuote).mock.calls[0]!
|
||||
const other: api.FleetQuote = { quoteNo: 'FQ-OTHER', details: { ...original[1], originCity: 'OTHER' }, recordVersion: '2', partyName: '测试客户', status: 'ACTIVE', updatedAt: '' }
|
||||
await wrapper.setProps({ modelValue: false }); await wrapper.setProps({ quote: other, readonly: true, modelValue: true }); await flushPromises()
|
||||
await wrapper.setProps({ modelValue: false }); await wrapper.setProps({ quote: null, readonly: false, modelValue: true }); await flushPromises()
|
||||
expect(wrapper.text()).toContain('按原请求重试'); vi.mocked(api.createFleetQuote).mockResolvedValue({ ...other, quoteNo: 'FQ-NEW', details: original[1] })
|
||||
await clickSave(wrapper); expect(vi.mocked(api.createFleetQuote).mock.calls[1]).toEqual(original)
|
||||
expect(wrapper.findComponent({ name: 'ElForm' }).props('disabled')).toBe(false)
|
||||
wrapper.findAllComponents({ name: 'ElInput' }).find(input => input.attributes('placeholder') === '请输入发货城市')!.vm.$emit('update:modelValue', 'CHANGED')
|
||||
await clickSave(wrapper)
|
||||
const next = vi.mocked(api.createFleetQuote).mock.calls[1]!
|
||||
expect(next[0]).not.toBe(original[0]); expect(next[1].originCity).toBe('CHANGED')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user