feat: 实现 Sense 运维中心 (#74)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import request from '@/utils/request'
|
||||
import { getOperationProblem, listOperationProblems, retryOperationProblem } from '@/api/sense/operations'
|
||||
|
||||
jest.mock('@/utils/request', () => jest.fn())
|
||||
|
||||
describe('Sense operations API', () => {
|
||||
beforeEach(() => request.mockReset())
|
||||
|
||||
test('encodes identifiers and sends only the expected version for controlled retry', () => {
|
||||
listOperationProblems({ pageIndex: 1, pageSize: 10 })
|
||||
getOperationProblem('media:camera/unsafe')
|
||||
retryOperationProblem('media:camera/unsafe', 7)
|
||||
expect(request).toHaveBeenNthCalledWith(1, { url: '/api/v1/operations', method: 'get', params: { pageIndex: 1, pageSize: 10 }})
|
||||
expect(request).toHaveBeenNthCalledWith(2, { url: '/api/v1/operations/media%3Acamera%2Funsafe', method: 'get' })
|
||||
expect(request).toHaveBeenNthCalledWith(3, { url: '/api/v1/operations/media%3Acamera%2Funsafe/retry', method: 'post', data: { expectedVersion: 7 }})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user