Skip to content

Commit

Permalink
fix: Update jest setup and handle undefined dir
Browse files Browse the repository at this point in the history
  • Loading branch information
acezard committed Aug 30, 2023
1 parent e6d0bb7 commit 1909cd9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions jestHelpers/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jest.mock('cozy-bar/transpiled', () => ({
setTheme: () => null
}))

jest.mock('cozy-intent', () => ({
useWebviewIntent: jest.fn()
}))

Enzyme.configure({ adapter: new Adapter() })
// see https://github.com/jsdom/jsdom/issues/1695
window.HTMLElement.prototype.scroll = function () {}
4 changes: 2 additions & 2 deletions src/drive/web/modules/views/Drive/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const DriveView = () => {
actions.dispatch(
uploadFilesFromNative(
filesToHandle,
displayedFolder.id,
displayedFolder?.id,
undefined,
{ client },
() => Promise.resolve()
Expand All @@ -209,7 +209,7 @@ const DriveView = () => {
.catch(() => {
return actions.dispatch(purgeUploadQueue())
})
}, [actions, client, displayedFolder.id, webviewIntent])
}, [actions, client, displayedFolder?.id, webviewIntent])

useEffect(() => {
if (canWriteToCurrentFolder) {
Expand Down

0 comments on commit 1909cd9

Please sign in to comment.