diff options
Diffstat (limited to 'apps/files/src/actions/viewInFolderAction.spec.ts')
-rw-r--r-- | apps/files/src/actions/viewInFolderAction.spec.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/files/src/actions/viewInFolderAction.spec.ts b/apps/files/src/actions/viewInFolderAction.spec.ts index c75151a4c38..8aa8bc81922 100644 --- a/apps/files/src/actions/viewInFolderAction.spec.ts +++ b/apps/files/src/actions/viewInFolderAction.spec.ts @@ -2,9 +2,9 @@ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { action } from './viewInFolderAction' -import { expect } from '@jest/globals' import { File, Folder, Node, Permission, View, FileAction } from '@nextcloud/files' +import { describe, expect, test, vi } from 'vitest' +import { action } from './viewInFolderAction' const view = { id: 'trashbin', @@ -21,7 +21,7 @@ describe('View in folder action conditions tests', () => { expect(action).toBeInstanceOf(FileAction) expect(action.id).toBe('view-in-folder') expect(action.displayName([], view)).toBe('View in folder') - expect(action.iconSvgInline([], view)).toBe('<svg>SvgMock</svg>') + expect(action.iconSvgInline([], view)).toMatch(/<svg.+<\/svg>/) expect(action.default).toBeUndefined() expect(action.order).toBe(80) expect(action.enabled).toBeDefined() @@ -113,7 +113,7 @@ describe('View in folder action enabled tests', () => { describe('View in folder action execute tests', () => { test('View in folder', 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 } } } @@ -133,7 +133,7 @@ describe('View in folder action execute tests', () => { }) test('View in (sub) folder', 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 } } } @@ -154,7 +154,7 @@ describe('View in folder action execute tests', () => { }) test('View in folder fails without node', 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 } } } @@ -164,7 +164,7 @@ describe('View in folder action execute tests', () => { }) test('View in folder fails without File', 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 } } } |