Skip to content

Commit f251fc7

Browse files
committed
test: standardize l10n mock in views/Settings/SignatureHashAlgorithm
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> (cherry picked from commit 7782a75) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 7b32cc4 commit f251fc7

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/tests/views/Settings/SignatureHashAlgorithm.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 { flushPromises, mount } from '@vue/test-utils'
89
import axios from '@nextcloud/axios'
910

@@ -21,15 +22,7 @@ vi.mock('@nextcloud/password-confirmation', () => ({
2122
confirmPassword: (...args: unknown[]) => confirmPasswordMock(...args),
2223
}))
2324

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

3427
vi.mock('@nextcloud/router', () => ({
3528
generateOcsUrl: vi.fn((path: string) => path),

0 commit comments

Comments
 (0)