feat: 实现 Sense 本地事件只读查看 (#73)

This commit is contained in:
QiuSW
2026-08-28 10:26:13 +08:00
parent 44b60b5b46
commit 028519a710
16 changed files with 891 additions and 0 deletions
@@ -0,0 +1,15 @@
import request from '@/utils/request'
import { getLocalEvent, listLocalEvents } from '@/api/sense/local-event'
jest.mock('@/utils/request', () => jest.fn())
describe('Sense local event API', () => {
beforeEach(() => request.mockReset())
test('uses read-only local endpoints', () => {
listLocalEvents({ pageIndex: 1, pageSize: 10 })
getLocalEvent('event/unsafe')
expect(request).toHaveBeenNthCalledWith(1, { url: '/api/v1/local-events', method: 'get', params: { pageIndex: 1, pageSize: 10 }})
expect(request).toHaveBeenNthCalledWith(2, { url: '/api/v1/local-events/event%2Funsafe', method: 'get' })
})
})