1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00

chore: library unit tests (#13357)

This commit is contained in:
Daniel Dietzler
2024-10-11 20:40:29 +02:00
committed by GitHub
parent 930df46f74
commit 3b7bf76db9
4 changed files with 152 additions and 13 deletions

View File

@ -500,13 +500,13 @@ describe('/libraries', () => {
});
it('should set an asset offline its file is not in any import path', async () => {
utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`);
const library = await utils.createLibrary(admin.accessToken, {
ownerId: admin.userId,
importPaths: [`${testAssetDirInternal}/temp/offline`],
});
utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`);
await scan(admin.accessToken, library.id);
await utils.waitForQueueFinish(admin.accessToken, 'library');

View File

@ -374,8 +374,8 @@ export const utils = {
},
createDirectory: (path: string) => {
if (!existsSync(dirname(path))) {
mkdirSync(dirname(path), { recursive: true });
if (!existsSync(path)) {
mkdirSync(path, { recursive: true });
}
},
@ -392,7 +392,7 @@ export const utils = {
return;
}
rmSync(path);
rmSync(path, { recursive: true });
},
getAssetInfo: (accessToken: string, id: string) => getAssetInfo({ id }, { headers: asBearerAuth(accessToken) }),