2024-03-07 10:14:36 -05:00
|
|
|
import { immichCli, utils } from 'src/utils';
|
2024-02-27 14:04:38 -05:00
|
|
|
import { beforeAll, describe, expect, it } from 'vitest';
|
2024-02-19 17:25:57 -05:00
|
|
|
|
|
|
|
|
describe(`immich server-info`, () => {
|
2024-02-27 14:04:38 -05:00
|
|
|
beforeAll(async () => {
|
2024-03-07 10:14:36 -05:00
|
|
|
await utils.resetDatabase();
|
2024-03-22 14:38:00 -04:00
|
|
|
const admin = await utils.adminSetup();
|
|
|
|
|
await utils.cliLogin(admin.accessToken);
|
2024-02-19 17:25:57 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should return the server info', async () => {
|
|
|
|
|
const { stderr, stdout, exitCode } = await immichCli(['server-info']);
|
|
|
|
|
expect(stdout.split('\n')).toEqual([
|
2024-03-27 15:01:36 -04:00
|
|
|
expect.stringContaining('Server Info (via admin@immich.cloud'),
|
2024-08-30 14:04:02 +02:00
|
|
|
' Url: http://127.0.0.1:2285/api',
|
2024-03-27 15:01:36 -04:00
|
|
|
expect.stringContaining('Version:'),
|
|
|
|
|
' Formats:',
|
|
|
|
|
expect.stringContaining('Images:'),
|
|
|
|
|
expect.stringContaining('Videos:'),
|
|
|
|
|
' Statistics:',
|
|
|
|
|
' Images: 0',
|
|
|
|
|
' Videos: 0',
|
|
|
|
|
' Total: 0',
|
2024-02-19 17:25:57 -05:00
|
|
|
]);
|
|
|
|
|
expect(stderr).toBe('');
|
|
|
|
|
expect(exitCode).toBe(0);
|
|
|
|
|
});
|
|
|
|
|
});
|