Skip to content

Commit fc1e0ea

Browse files
committed
test: standardize l10n mock in views/Settings/DocMDP
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> (cherry picked from commit f6c4f2e) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 11dac1d commit fc1e0ea

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/tests/views/Settings/DocMDP.spec.ts

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

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

910
type DocMDPLevel = {
@@ -36,15 +37,7 @@ vi.mock('@nextcloud/axios', () => ({
3637
},
3738
}))
3839

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

4942
let DocMDP: unknown
5043

0 commit comments

Comments
 (0)