2024-02-19 17:25:57 -05:00
|
|
|
import { apiUtils, cliUtils, dbUtils, immichCli } 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-02-19 17:25:57 -05:00
|
|
|
apiUtils.setup();
|
|
|
|
|
await dbUtils.reset();
|
|
|
|
|
await cliUtils.login();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should return the server info', async () => {
|
|
|
|
|
const { stderr, stdout, exitCode } = await immichCli(['server-info']);
|
|
|
|
|
expect(stdout.split('\n')).toEqual([
|
|
|
|
|
expect.stringContaining('Server Version:'),
|
|
|
|
|
expect.stringContaining('Image Types:'),
|
|
|
|
|
expect.stringContaining('Video Types:'),
|
|
|
|
|
'Statistics:',
|
|
|
|
|
' Images: 0',
|
|
|
|
|
' Videos: 0',
|
|
|
|
|
' Total: 0',
|
|
|
|
|
]);
|
|
|
|
|
expect(stderr).toBe('');
|
|
|
|
|
expect(exitCode).toBe(0);
|
|
|
|
|
});
|
|
|
|
|
});
|