diff options
Diffstat (limited to 'apps/comments/src')
-rw-r--r-- | apps/comments/src/actions/inlineUnreadCommentsAction.spec.ts | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/apps/comments/src/actions/inlineUnreadCommentsAction.spec.ts b/apps/comments/src/actions/inlineUnreadCommentsAction.spec.ts index dc8892769e3..e8020f1f029 100644 --- a/apps/comments/src/actions/inlineUnreadCommentsAction.spec.ts +++ b/apps/comments/src/actions/inlineUnreadCommentsAction.spec.ts @@ -2,9 +2,10 @@ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { action } from './inlineUnreadCommentsAction' -import { expect } from '@jest/globals' import { File, Permission, View, FileAction } from '@nextcloud/files' +import { describe, expect, test, vi } from 'vitest' + +import { action } from './inlineUnreadCommentsAction' import logger from '../logger' const view = { @@ -29,7 +30,7 @@ describe('Inline unread comments action display name tests', () => { expect(action.id).toBe('comments-unread') expect(action.displayName([file], view)).toBe('') expect(action.title!([file], view)).toBe('1 new comment') - expect(action.iconSvgInline([], view)).toBe('<svg>SvgMock</svg>') + expect(action.iconSvgInline([], view)).toMatch(/<svg.+<\/svg>/) expect(action.enabled!([file], view)).toBe(true) expect(action.inline!(file, view)).toBe(true) expect(action.default).toBeUndefined() @@ -115,8 +116,8 @@ describe('Inline unread comments action enabled tests', () => { describe('Inline unread comments action execute tests', () => { test('Action opens sidebar', async () => { - const openMock = jest.fn() - const setActiveTabMock = jest.fn() + const openMock = vi.fn() + const setActiveTabMock = vi.fn() window.OCA = { Files: { Sidebar: { @@ -145,8 +146,8 @@ describe('Inline unread comments action execute tests', () => { }) test('Action handles sidebar open failure', async () => { - const openMock = jest.fn(() => { throw new Error('Mock error') }) - const setActiveTabMock = jest.fn() + const openMock = vi.fn(() => { throw new Error('Mock error') }) + const setActiveTabMock = vi.fn() window.OCA = { Files: { Sidebar: { @@ -155,7 +156,7 @@ describe('Inline unread comments action execute tests', () => { }, }, } - jest.spyOn(logger, 'error').mockImplementation(() => jest.fn()) + vi.spyOn(logger, 'error').mockImplementation(() => vi.fn()) const file = new File({ id: 1, |