Skip to content

Commit

Permalink
Fix last unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Sep 27, 2022
1 parent 67edb8a commit b2795ae
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,11 +10,13 @@ describe('resourcesTransfer', () => {
{
id: 'a',
name: 'a',
path: '/a',
webDavPath: '/a'
},
{
id: 'b',
name: 'b',
path: '/b',
webDavPath: '/b'
}
]
Expand Down Expand Up @@ -59,7 +61,7 @@ describe('resourcesTransfer', () => {
}
const resourcesTransfer = new ResourcesTransfer(
resourcesToMove,
resourcesToMove[0],
targetFolder,
client,
dataSet.publicFiles,
'',
Expand Down Expand Up @@ -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()
})
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit b2795ae

Please sign in to comment.