Skip to content

Commit d7d9313

Browse files
[fix] update vue-i18n mock to handle translation params in AssetBrowserModal test
The vue-i18n mock's t function was not accepting params, causing the displayTitle test to fail. Updated mock to match the @/i18n mock pattern which correctly handles params and formats them for assertions.
1 parent 64813fa commit d7d9313

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests-ui/platform/assets/components/AssetBrowserModal.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,13 @@ vi.mock('@/platform/assets/components/AssetGrid.vue', () => ({
137137

138138
vi.mock('vue-i18n', () => ({
139139
useI18n: () => ({
140-
t: (key: string) => key
140+
t: (key: string, params?: Record<string, string>) =>
141+
params ? `${key}:${JSON.stringify(params)}` : key
141142
}),
142143
createI18n: () => ({
143144
global: {
144-
t: (key: string) => key
145+
t: (key: string, params?: Record<string, string>) =>
146+
params ? `${key}:${JSON.stringify(params)}` : key
145147
}
146148
})
147149
}))

0 commit comments

Comments
 (0)