Skip to content

Commit 8962314

Browse files
committed
test: standardize l10n mock in views/Settings/SignatureEngine
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> (cherry picked from commit 1b97d47) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 57aa149 commit 8962314

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/tests/views/Settings/SignatureEngine.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

910
import SignatureEngine from '../../../views/Settings/SignatureEngine.vue'
@@ -19,15 +20,7 @@ vi.mock('@nextcloud/event-bus', () => ({
1920
emit: (...args: unknown[]) => emitMock(...args),
2021
}))
2122

22-
vi.mock('@nextcloud/l10n', () => ({
23-
t: vi.fn((_app: string, text: string) => text),
24-
translate: vi.fn((_app: string, text: string) => text),
25-
translatePlural: vi.fn((_app: string, singular: string, plural: string, count: number) => (count === 1 ? singular : plural)),
26-
n: vi.fn((_app: string, singular: string, plural: string, count: number) => (count === 1 ? singular : plural)),
27-
getLanguage: vi.fn(() => 'en'),
28-
getLocale: vi.fn(() => 'en'),
29-
isRTL: vi.fn(() => false),
30-
}))
23+
vi.mock('@nextcloud/l10n', () => createL10nMock())
3124

3225
const OCP = {
3326
AppConfig: {

0 commit comments

Comments
 (0)