mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { LoginResponseDto, ManualJobName, QueueName } from '@immich/sdk';
|
|
import { expect, test } from '@playwright/test';
|
|
import { utils } from 'src/utils';
|
|
|
|
test.describe.configure({ mode: 'serial' });
|
|
|
|
test.describe('Integrity', () => {
|
|
let admin: LoginResponseDto;
|
|
|
|
test.beforeAll(async () => {
|
|
utils.initSdk();
|
|
await utils.resetDatabase();
|
|
admin = await utils.adminSetup();
|
|
});
|
|
|
|
test('run integrity jobs to update stats', async ({ context, page }) => {
|
|
await utils.setAuthCookies(context, admin.accessToken);
|
|
|
|
await utils.createJob(admin.accessToken, {
|
|
name: ManualJobName.IntegrityUntrackedFiles,
|
|
});
|
|
|
|
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
|
|
|
|
await page.goto('/admin/maintenance');
|
|
|
|
const count = page.getByText('Untracked Files').locator('..').locator('..').locator('div').nth(1);
|
|
|
|
const previousCount = Number.parseInt((await count.textContent()) ?? '');
|
|
|
|
await utils.mkFolder(`/data/upload/${admin.userId}`);
|
|
await utils.putTextFile('untracked', `/data/upload/${admin.userId}/untracked1.png`);
|
|
|
|
const checkButton = page.getByText('Integrity Report').locator('..').getByRole('button', { name: 'Check All' });
|
|
|
|
await checkButton.click();
|
|
await expect(checkButton).toBeEnabled();
|
|
|
|
await expect(count).toContainText((previousCount + 1).toString());
|
|
});
|
|
});
|