Skip to content

Commit 31f45dd

Browse files
committed
test: standardize l10n mock in views/UploadCertificate
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> (cherry picked from commit b685ea4) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent d8cec51 commit 31f45dd

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/tests/views/UploadCertificate.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

@@ -20,15 +21,7 @@ const signMethodsStoreMock = {
2021
const showSuccessMock = vi.fn()
2122
const showErrorMock = vi.fn()
2223

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

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

0 commit comments

Comments
 (0)