feat: 重建 Bell 预警处置生命周期 (#133)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import request from '@/utils/request'
|
||||
import { acknowledgeAlert, closeAlert, getAlertLifecycle } from '@/api/bell/alert-lifecycle'
|
||||
jest.mock('@/utils/request', () => jest.fn(config => Promise.resolve(config)))
|
||||
describe('Bell alert lifecycle API', () => {
|
||||
beforeEach(() => request.mockClear())
|
||||
it('maps timeline, ack and close to protected Alert routes', async() => {
|
||||
await getAlertLifecycle('a1'); await acknowledgeAlert('a1'); await closeAlert('a1', { outcome: 'site_normal' })
|
||||
expect(request.mock.calls.map(call => call[0])).toEqual([
|
||||
{ url: '/api/v1/bell/alerts/a1/lifecycle', method: 'get' },
|
||||
{ url: '/api/v1/bell/alerts/a1/ack', method: 'post' },
|
||||
{ url: '/api/v1/bell/alerts/a1/close', method: 'post', data: { outcome: 'site_normal' }}
|
||||
])
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user