aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/src
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/src')
-rw-r--r--apps/files_external/src/actions/enterCredentialsAction.spec.ts9
-rw-r--r--apps/files_external/src/actions/openInFilesAction.spec.ts9
-rw-r--r--apps/files_external/src/utils/externalStorageUtils.spec.ts2
3 files changed, 11 insertions, 9 deletions
diff --git a/apps/files_external/src/actions/enterCredentialsAction.spec.ts b/apps/files_external/src/actions/enterCredentialsAction.spec.ts
index 518b48c264d..5d1ff05e229 100644
--- a/apps/files_external/src/actions/enterCredentialsAction.spec.ts
+++ b/apps/files_external/src/actions/enterCredentialsAction.spec.ts
@@ -2,10 +2,11 @@
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import { action } from './enterCredentialsAction'
-import { expect } from '@jest/globals'
-import { File, Folder, Permission, View, DefaultType, FileAction } from '@nextcloud/files'
import type { StorageConfig } from '../services/externalStorage'
+
+import { File, Folder, Permission, View, DefaultType, FileAction } from '@nextcloud/files'
+import { describe, expect, test } from 'vitest'
+import { action } from './enterCredentialsAction'
import { STORAGE_STATUS } from '../utils/credentialsUtils'
const view = {
@@ -36,7 +37,7 @@ describe('Enter credentials action conditions tests', () => {
expect(action).toBeInstanceOf(FileAction)
expect(action.id).toBe('credentials-external-storage')
expect(action.displayName([storage], externalStorageView)).toBe('Enter missing credentials')
- expect(action.iconSvgInline([storage], externalStorageView)).toBe('<svg>SvgMock</svg>')
+ expect(action.iconSvgInline([storage], externalStorageView)).toMatch(/<svg.+<\/svg>/)
expect(action.default).toBe(DefaultType.DEFAULT)
expect(action.order).toBe(-1000)
expect(action.inline!(storage, externalStorageView)).toBe(true)
diff --git a/apps/files_external/src/actions/openInFilesAction.spec.ts b/apps/files_external/src/actions/openInFilesAction.spec.ts
index 83aa38f1753..aa9573eca77 100644
--- a/apps/files_external/src/actions/openInFilesAction.spec.ts
+++ b/apps/files_external/src/actions/openInFilesAction.spec.ts
@@ -2,10 +2,11 @@
* 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 = {
@@ -73,7 +74,7 @@ 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 } } }
@@ -98,7 +99,7 @@ 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 } }
diff --git a/apps/files_external/src/utils/externalStorageUtils.spec.ts b/apps/files_external/src/utils/externalStorageUtils.spec.ts
index 55d3773a917..a6a29e27a7c 100644
--- a/apps/files_external/src/utils/externalStorageUtils.spec.ts
+++ b/apps/files_external/src/utils/externalStorageUtils.spec.ts
@@ -2,8 +2,8 @@
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import { expect } from '@jest/globals'
import { File, Folder, Permission } from '@nextcloud/files'
+import { describe, expect, test } from 'vitest'
import { isNodeExternalStorage } from './externalStorageUtils'
describe('Is node an external storage', () => {