From 09e2a07c5ed7e2bb5700fcc3789b9aee198d5ebf Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Sat, 27 Mar 2021 22:28:01 +0100 Subject: [PATCH] Minor IndexingManager test improvements --- test/backend/unit/model/sql/IndexingManager.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/backend/unit/model/sql/IndexingManager.ts b/test/backend/unit/model/sql/IndexingManager.ts index e67785f8..bd73543a 100644 --- a/test/backend/unit/model/sql/IndexingManager.ts +++ b/test/backend/unit/model/sql/IndexingManager.ts @@ -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))); }