Skip to content

Commit fd5542f

Browse files
committed
test: standardize l10n mock in views/FilesList/VirtualList
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> (cherry picked from commit 046893c) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 35319ee commit fd5542f

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/tests/views/FilesList/VirtualList.spec.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
import { beforeEach, describe, expect, it, vi } from 'vitest'
7+
import { createL10nMock } from '../../testHelpers/l10n.js'
78
import { mount } from '@vue/test-utils'
89
import { markRaw } from '@vue/reactivity'
910

@@ -35,15 +36,7 @@ class IntersectionObserverMock {
3536
constructor(public callback: IntersectionObserverCallback) {}
3637
}
3738

38-
vi.mock('@nextcloud/l10n', () => ({
39-
t: vi.fn((_app: string, text: string) => text),
40-
translate: vi.fn((_app: string, text: string) => text),
41-
translatePlural: vi.fn((_app: string, singular: string, plural: string, count: number) => (count === 1 ? singular : plural)),
42-
n: vi.fn((_app: string, singular: string, plural: string, count: number) => (count === 1 ? singular : plural)),
43-
getLanguage: vi.fn(() => 'en'),
44-
getLocale: vi.fn(() => 'en'),
45-
isRTL: vi.fn(() => false),
46-
}))
39+
vi.mock('@nextcloud/l10n', () => createL10nMock())
4740

4841
vi.mock('debounce', () => ({
4942
default: vi.fn((fn: (...args: unknown[]) => unknown) => fn),

0 commit comments

Comments
 (0)