Skip to content

Commit

Permalink
Fix unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Oct 11, 2022
1 parent f2516d3 commit 94e256a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/web-app-files/tests/unit/mixins/actions/restore.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Vuex from 'vuex'
import { createStore } from 'vuex-extensions'
import { mount, createLocalVue } from '@vue/test-utils'
import { DavProperties } from 'web-pkg/src/constants'
import Restore from '@files/src/mixins/actions/restore.ts'
import { createLocationTrash, createLocationSpaces } from '../../../../src/router'
// eslint-disable-next-line jest/no-mocks-import
Expand Down Expand Up @@ -67,10 +66,9 @@ describe('restore', () => {
const wrapper = getWrapper()
await wrapper.vm.collectRestoreConflicts([{ id: '1', path: '1', name: '1' }])

expect(wrapper.vm.$client.files.list).toHaveBeenCalledWith(
'/files/alice',
1,
DavProperties.Default
expect(wrapper.vm.$clientService.webdav.listFiles).toHaveBeenCalledWith(
undefined,
'/files/alice'
)
})
it('should find conflict within resources', async () => {
Expand Down Expand Up @@ -106,6 +104,13 @@ function getWrapper({ invalidLocation = false, resolveClearTrashBin: resolveRest
$gettext: jest.fn(),
$gettextInterpolate: jest.fn(),
createModal: jest.fn(),
$clientService: {
webdav: {
listFiles: jest.fn().mockImplementation(() => {
return []
})
}
},
$client: {
...sdkMock,
files: {
Expand Down

0 comments on commit 94e256a

Please sign in to comment.