fix: align audit and dispatch workflows and release failed requests

This commit is contained in:
2026-10-22 23:10:09 +08:00
parent 9cdcb9c077
commit 4a3456756f
124 changed files with 1296 additions and 2120 deletions
@@ -112,7 +112,7 @@ it('keeps read-only trip detail free of write actions and reads history only whe
expect(api.listTripHistory).toHaveBeenCalledExactlyOnceWith('TR-TEST', 1, 20)
})
it('keeps the exact create command for an uncertain retry and accepts optional notes', async () => {
it('releases a failed create and sends a fresh command with optional notes', async () => {
vi.mocked(api.createTrip).mockRejectedValueOnce(new Error('连接中断')).mockResolvedValueOnce(structuredClone(detail))
const wrapper = mount(TripPlanDialog, { modelValue: false, trip: null })
await wrapper.setProps({ modelValue: true }); await flushPromises()
@@ -121,7 +121,7 @@ it('keeps the exact create command for an uncertain retry and accepts optional n
const first = vi.mocked(api.createTrip).mock.calls[0]![0]
expect(first.idempotencyKey).toBeTruthy(); expect(first.remark).toBeNull()
wrapper.findComponent({ name: 'AppDialog' }).vm.$emit('confirm'); await flushPromises()
expect(api.createTrip).toHaveBeenNthCalledWith(2, first)
expect(api.createTrip).toHaveBeenNthCalledWith(2, { ...first, idempotencyKey: expect.any(String) }); expect(vi.mocked(api.createTrip).mock.calls[1]![0].idempotencyKey).not.toBe(first.idempotencyKey)
expect(wrapper.emitted('saved')?.[0]?.[0]).toEqual(detail)
})