0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-23 20:33:16 -05:00
logto/packages/integration-tests/tests/logs.test.ts

23 lines
651 B
TypeScript
Raw Normal View History

import { LogDto } from '@logto/schemas';
import { assert } from '@silverhand/essentials';
import { authedAdminApi } from '@/api';
import { registerUserAndSignIn } from '@/helper';
describe('admin console logs', () => {
it('should get logs and visit log details successfully', async () => {
await registerUserAndSignIn();
const logs = await authedAdminApi.get('logs').json<LogDto[]>();
expect(logs.length).toBeGreaterThan(0);
const log = logs[0];
assert(log, new Error('Log is not valid'));
const logDetails = await authedAdminApi.get(`logs/${log.id}`).json<LogDto>();
expect(logDetails.id).toBe(log.id);
});
});