16 lines
629 B
JavaScript
16 lines
629 B
JavaScript
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' })
|
|
})
|
|
})
|