From b2795aeecb07c1af2523c40d25ac7b295bc2f106 Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Tue, 27 Sep 2022 11:31:36 +0200 Subject: [PATCH] Fix last unittest --- .../unit/helpers/resource/resourcesTransfer.spec.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/web-app-files/tests/unit/helpers/resource/resourcesTransfer.spec.ts b/packages/web-app-files/tests/unit/helpers/resource/resourcesTransfer.spec.ts index 4239c6e5641..a63bb28cfbc 100644 --- a/packages/web-app-files/tests/unit/helpers/resource/resourcesTransfer.spec.ts +++ b/packages/web-app-files/tests/unit/helpers/resource/resourcesTransfer.spec.ts @@ -1,5 +1,5 @@ import * as Resource from '../../../../src/helpers/resource' -import { ResourcesTransfer, TransferType } from '../../../../src/helpers/resource' +import { ResolveConflict, ResourcesTransfer, TransferType } from '../../../../src/helpers/resource' let resourcesToMove let targetFolder @@ -10,11 +10,13 @@ describe('resourcesTransfer', () => { { id: 'a', name: 'a', + path: '/a', webDavPath: '/a' }, { id: 'b', name: 'b', + path: '/b', webDavPath: '/b' } ] @@ -59,7 +61,7 @@ describe('resourcesTransfer', () => { } const resourcesTransfer = new ResourcesTransfer( resourcesToMove, - resourcesToMove[0], + targetFolder, client, dataSet.publicFiles, '', @@ -134,7 +136,7 @@ describe('resourcesTransfer', () => { ) resourcesTransfer.resolveFileExists = jest .fn() - .mockImplementation(() => Promise.resolve({ strategy: 0 } as Resource.ResolveConflict)) + .mockImplementation(() => Promise.resolve({ strategy: 0 } as ResolveConflict)) await resourcesTransfer.resolveAllConflicts(resourcesToMove, targetFolder, targetFolderItems) expect(resourcesTransfer.resolveFileExists).not.toHaveBeenCalled() }) @@ -162,7 +164,7 @@ describe('resourcesTransfer', () => { ) resourcesTransfer.resolveFileExists = jest .fn() - .mockImplementation(() => Promise.resolve({ strategy: 0 } as Resource.ResolveConflict)) + .mockImplementation(() => Promise.resolve({ strategy: 0 } as ResolveConflict)) await resourcesTransfer.resolveAllConflicts(resourcesToMove, targetFolder, targetFolderItems) expect(resourcesTransfer.resolveFileExists).toHaveBeenCalled()