0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-24 22:41:28 -05:00
logto/packages/experience/src/apis/index.test.ts
Gao Sun 2319101056
refactor: ui -> experience (part 3)
Rename `ui` to `experience`.
2023-09-15 13:46:27 +08:00

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');
});
});