Skip to content

Commit 82e732a

Browse files
committed
test: standardize l10n mock in views/Settings/SigningMode
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> (cherry picked from commit 09e5cdf) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent f251fc7 commit 82e732a

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/tests/views/Settings/SigningMode.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 axios from '@nextcloud/axios'
910

@@ -15,15 +16,7 @@ vi.mock('@nextcloud/initial-state', () => ({
1516
loadState: (...args: unknown[]) => loadStateMock(...args),
1617
}))
1718

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

2821
vi.mock('@nextcloud/axios', () => ({
2922
default: {

0 commit comments

Comments
 (0)