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
@@ -46,14 +46,14 @@ it('ignores late responses after switching trips and resets later pagination onc
expect(api.listTripCosts).toHaveBeenNthCalledWith(4, 'TR-THREE', 1, 10)
expect(w.findComponent({ name: 'DataTable' }).props('data')[0].costNo).toBe('TC-THREE')
})
it('retains the exact key and contents when a creation response is uncertain', async () => {
it('releases a failed cost create and submits current contents with a new key', async () => {
vi.mocked(api.createTripCost).mockRejectedValueOnce(new Error('unknown outcome')).mockResolvedValueOnce(cost)
const w = mount(); await flushPromises(); await button(w, '登记成本').trigger('click'); await flushPromises()
w.findComponent({ name: 'ElInputNumber' }).vm.$emit('update:modelValue', 12.5); await button(w, '保存').trigger('click'); await flushPromises()
const first = vi.mocked(api.createTripCost).mock.calls[0]!
expect(w.text()).toContain('正在核对上次登记结果')
expect(w.text()).not.toContain('正在核对上次登记结果')
await button(w, '保存').trigger('click'); await flushPromises()
expect(vi.mocked(api.createTripCost).mock.calls[1]).toEqual(first)
expect(vi.mocked(api.createTripCost).mock.calls[1]).toEqual([first[0], expect.any(String), first[2]]); expect(vi.mocked(api.createTripCost).mock.calls[1]![1]).not.toBe(first[1])
})
it('keeps the successful save authoritative when pagination changes while it is pending', async () => {
let finish!: (value: api.TripCost) => void