feat(api-client): add ack controller

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei
2023-10-21 15:01:08 +08:00
parent 4646473317
commit 08dc741c6c
7 changed files with 77 additions and 11 deletions

View File

@@ -0,0 +1,19 @@
import { mockRequestInstance } from '~/__tests__/helpers/instance'
import { mockResponse } from '~/__tests__/helpers/response'
import { AckController } from '~/controllers'
describe('test ack client', () => {
const client = mockRequestInstance(AckController)
test('POST /ack', async () => {
mockResponse('/ack', {}, 'post', {
type: 'read',
payload: {
type: 'note',
id: '11',
},
})
await expect(client.ack.read('note', '11')).resolves.not.toThrowError()
})
})