1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

Minor IndexingManager test improvements

This commit is contained in:
Patrik J. Braun 2021-03-27 22:28:01 +01:00
parent e6e5e43877
commit 09e2a07c5e

View File

@ -132,7 +132,7 @@ describe('IndexingManager', (sqlHelper: SQLTestHelper) => {
const subDir1 = TestHelper.getRandomizedDirectoryEntry(parent, 'subDir');
const p1 = TestHelper.getRandomizedPhotoEntry(subDir1, 'subPhoto1', 0);
const subDir2 = TestHelper.getRandomizedDirectoryEntry(parent, 'SUBDIR');
const p2 = TestHelper.getRandomizedPhotoEntry(subDir2, 'subPhoto1', 0);
const p2 = TestHelper.getRandomizedPhotoEntry(subDir2, 'subPhoto2', 0);
DirectoryDTO.removeReferences(parent);
@ -158,8 +158,8 @@ describe('IndexingManager', (sqlHelper: SQLTestHelper) => {
const parent2 = TestHelper.getRandomizedDirectoryEntry(null, 'PARENT');
const subDir1 = TestHelper.getRandomizedDirectoryEntry(parent1, 'subDir');
const p1 = TestHelper.getRandomizedPhotoEntry(subDir1, 'subPhoto1', 0);
const subDir2 = TestHelper.getRandomizedDirectoryEntry(parent2, 'subDir');
const p2 = TestHelper.getRandomizedPhotoEntry(subDir2, 'subPhoto1', 0);
const subDir2 = TestHelper.getRandomizedDirectoryEntry(parent2, 'subDir2');
const p2 = TestHelper.getRandomizedPhotoEntry(subDir2, 'subPhoto2', 0);
DirectoryDTO.removeReferences(parent1);
@ -184,11 +184,7 @@ describe('IndexingManager', (sqlHelper: SQLTestHelper) => {
DirectoryDTO.removeReferences(selected);
removeIds(selected);
subDir2.isPartial = true;
subDir2.preview = subDir2.media[0];
delete subDir2.directories;
delete subDir2.metaFile;
delete subDir2.media;
setPartial(subDir2);
expect(Utils.clone(Utils.removeNullOrEmptyObj(selected)))
.to.deep.equalInAnyOrder(Utils.clone(Utils.removeNullOrEmptyObj(parent2)));
}