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:
parent
8394f7bb2e
commit
9096c50907
1 changed files with 22 additions and 0 deletions
22
packages/integration-tests/tests/logs.test.ts
Normal file
22
packages/integration-tests/tests/logs.test.ts
Normal 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);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue