diff options
Diffstat (limited to 'apps/files_external/src/actions/openInFilesAction.spec.ts')
-rw-r--r-- | apps/files_external/src/actions/openInFilesAction.spec.ts | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/apps/files_external/src/actions/openInFilesAction.spec.ts b/apps/files_external/src/actions/openInFilesAction.spec.ts index ef04436024b..aa9573eca77 100644 --- a/apps/files_external/src/actions/openInFilesAction.spec.ts +++ b/apps/files_external/src/actions/openInFilesAction.spec.ts @@ -1,28 +1,12 @@ /** - * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com> - * - * @author John Molakvoæ <skjnldsv@protonmail.com> - * - * @license AGPL-3.0-or-later - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { action } from './openInFilesAction' -import { expect } from '@jest/globals' import { Folder, Permission, View, DefaultType, FileAction } from '@nextcloud/files' +import { describe, expect, test, vi } from 'vitest' + import type { StorageConfig } from '../services/externalStorage' +import { action } from './openInFilesAction' import { STORAGE_STATUS } from '../utils/credentialsUtils' const view = { @@ -90,7 +74,8 @@ describe('Open in files action enabled tests', () => { describe('Open in files action execute tests', () => { test('Open in files', async () => { - const goToRouteMock = jest.fn() + const goToRouteMock = vi.fn() + // @ts-expect-error We only mock what needed, we do not need Files.Router.goTo or Files.Navigation window.OCP = { Files: { Router: { goToRoute: goToRouteMock } } } const storage = new Folder({ @@ -114,7 +99,8 @@ describe('Open in files action execute tests', () => { }) test('Open in files broken storage', async () => { - const confirmMock = jest.fn() + const confirmMock = vi.fn() + // @ts-expect-error We only mock what is needed window.OC = { dialogs: { confirm: confirmMock } } const storage = new Folder({ |