fix: align audit and dispatch workflows and release failed requests
This commit is contained in:
@@ -49,15 +49,15 @@ it('does not publish if capacity validation is incomplete', async () => {
|
||||
wrapper.findComponent({ name: 'AppDialog' }).vm.$emit('confirm'); await flushPromises()
|
||||
expect(offers.saveCapacityOffer).not.toHaveBeenCalled(); expect(offers.commandCapacityOffer).not.toHaveBeenCalled()
|
||||
})
|
||||
it('retries only the uncertain publish command with the original key', async () => {
|
||||
it('releases a failed publish and submits current settings with a new key', async () => {
|
||||
vi.mocked(offers.commandCapacityOffer).mockRejectedValueOnce(new Error('network'))
|
||||
const wrapper = mount(); await flushPromises()
|
||||
wrapper.findComponent({ name: 'AppDialog' }).vm.$emit('confirm'); await flushPromises()
|
||||
const first = vi.mocked(offers.commandCapacityOffer).mock.calls[0]!
|
||||
expect(wrapper.findComponent({ name: 'AppDialog' }).props('confirmText')).toBe('重试原请求')
|
||||
expect(wrapper.findComponent({ name: 'AppDialog' }).props('confirmText')).toBe('确认发布')
|
||||
wrapper.findComponent({ name: 'AppDialog' }).vm.$emit('confirm'); await flushPromises()
|
||||
expect(offers.commandCapacityOffer).toHaveBeenNthCalledWith(2, ...first)
|
||||
expect(state.plan).toHaveBeenCalledOnce(); expect(offers.saveCapacityOffer).toHaveBeenCalledOnce()
|
||||
expect(offers.commandCapacityOffer).toHaveBeenNthCalledWith(2, first[0], first[1], { ...first[2], idempotencyKey: expect.any(String) }); expect(vi.mocked(offers.commandCapacityOffer).mock.calls[1]![2].idempotencyKey).not.toBe(first[2].idempotencyKey)
|
||||
expect(state.plan).toHaveBeenCalledTimes(2); expect(offers.saveCapacityOffer).toHaveBeenCalledTimes(2)
|
||||
})
|
||||
|
||||
it('submits measurements from the embedded panel before saving and publishing', async () => {
|
||||
|
||||
Reference in New Issue
Block a user