Skip to content

Commit 3ab332d

Browse files
committed
test: standardize l10n mock in views/Settings/CrlValidation
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> (cherry picked from commit 85dd40a) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 0daf28d commit 3ab332d

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/tests/views/Settings/CrlValidation.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 CrlValidation from '../../../views/Settings/CrlValidation.vue'
@@ -14,15 +15,7 @@ vi.mock('@nextcloud/initial-state', () => ({
1415
loadState: (...args: unknown[]) => loadStateMock(...args),
1516
}))
1617

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

2720
const OCP = {
2821
AppConfig: {

0 commit comments

Comments
 (0)