0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

test: integration tests for logs (#1671)

This commit is contained in:
Xiao Yijun 2022-07-26 14:29:38 +08:00 committed by GitHub
parent 8394f7bb2e
commit 9096c50907
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,22 @@
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);
});
});