mirror of
https://github.com/logto-io/logto.git
synced 2025-03-24 22:41:28 -05:00
23 lines
412 B
TypeScript
23 lines
412 B
TypeScript
import ky from 'ky';
|
|
|
|
import { consent } from './consent';
|
|
|
|
jest.mock('ky', () => ({
|
|
extend: () => ky,
|
|
post: jest.fn(() => ({
|
|
json: jest.fn(),
|
|
})),
|
|
}));
|
|
|
|
describe('api', () => {
|
|
const mockKyPost = ky.post as jest.Mock;
|
|
|
|
afterEach(() => {
|
|
mockKyPost.mockClear();
|
|
});
|
|
|
|
it('consent', async () => {
|
|
await consent();
|
|
expect(ky.post).toBeCalledWith('/api/interaction/consent');
|
|
});
|
|
});
|