Skip to content

Commit 0daf28d

Browse files
committed
test: standardize l10n mock in views/Settings/ConfigureCheck
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> (cherry picked from commit 035bfbf) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 20a2023 commit 0daf28d

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,14 @@
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 ConfigureCheck from '../../../views/Settings/ConfigureCheck.vue'
1011

1112
const useConfigureCheckStoreMock = vi.fn()
1213

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

2316
vi.mock('../../../store/configureCheck.js', () => ({
2417
useConfigureCheckStore: (...args: unknown[]) => useConfigureCheckStoreMock(...args),

0 commit comments

Comments
 (0)