mirror of
https://github.com/logto-io/logto.git
synced 2025-01-13 21:30:30 -05:00
162998f414
* chore(test): integration test update add dotenv * chore(core): update pnpm lock update pnpm lock * refactor(test): refactor integration test step 1 extract api, and orgnize test case following core/route structure * chore(test): update path update path * fix(test): update path update path * fix(test): cr update cr update
22 lines
652 B
TypeScript
22 lines
652 B
TypeScript
import { LogDto } from '@logto/schemas';
|
|
import { assert } from '@silverhand/essentials';
|
|
|
|
import { authedAdminApi } from '@/api';
|
|
import { registerUserAndSignIn } from '@/helpers';
|
|
|
|
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);
|
|
});
|
|
});
|