diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-08-16 12:30:01 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-08-17 18:56:38 +0200 |
commit | 5098a2d7db2fb1ee0352fb214330e45455153ac4 (patch) | |
tree | 60af79da7549bf7bbfa29c37a59929040c4c4003 /apps/files_sharing | |
parent | f6a6e0b991a7b047566fa30d978227e561f1aae6 (diff) | |
download | nextcloud-server-5098a2d7db2fb1ee0352fb214330e45455153ac4.tar.gz nextcloud-server-5098a2d7db2fb1ee0352fb214330e45455153ac4.zip |
fix(tests): actions adjust and jest fetch mock
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/src/actions/openInFilesAction.spec.ts | 12 | ||||
-rw-r--r-- | apps/files_sharing/src/actions/openInFilesAction.ts | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/apps/files_sharing/src/actions/openInFilesAction.spec.ts b/apps/files_sharing/src/actions/openInFilesAction.spec.ts index 8920204ae3f..49d4e192d39 100644 --- a/apps/files_sharing/src/actions/openInFilesAction.spec.ts +++ b/apps/files_sharing/src/actions/openInFilesAction.spec.ts @@ -19,14 +19,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ -import { action } from './openInFilesAction' +import type { Navigation } from '../../../files/src/services/Navigation' + import { expect } from '@jest/globals' import { File, Permission } from '@nextcloud/files' -import { DefaultType, FileAction } from '../../../files/src/services/FileAction' -import * as eventBus from '@nextcloud/event-bus' -import axios from '@nextcloud/axios' -import type { Navigation } from '../../../files/src/services/Navigation' + import '../main' +import { action } from './openInFilesAction' +import { DefaultType, FileAction } from '../../../files/src/services/FileAction' import { deletedSharesViewId, pendingSharesViewId, sharedWithOthersViewId, sharedWithYouViewId, sharesViewId, sharingByLinksViewId } from '../views/shares' const view = { @@ -92,6 +92,6 @@ describe('Open in files action execute tests', () => { // Silent action expect(exec).toBe(null) expect(goToRouteMock).toBeCalledTimes(1) - expect(goToRouteMock).toBeCalledWith(null, { fileid: 1, view: 'files' }, { fileid: 1, dir: '/Foo' }) + expect(goToRouteMock).toBeCalledWith(null, { fileid: 1, view: 'files' }, { dir: '/Foo' }) }) }) diff --git a/apps/files_sharing/src/actions/openInFilesAction.ts b/apps/files_sharing/src/actions/openInFilesAction.ts index bd9791e85a5..ff7ccde2f36 100644 --- a/apps/files_sharing/src/actions/openInFilesAction.ts +++ b/apps/files_sharing/src/actions/openInFilesAction.ts @@ -43,7 +43,7 @@ export const action = new FileAction({ window.OCP.Files.Router.goToRoute( null, // use default route { view: 'files', fileid: node.fileid }, - { dir: node.dirname, fileid: node.fileid }, + { dir: node.dirname }, ) return null }, |