@@ -61,13 +61,26 @@ it('translates key with values with $t mixin', async () => {
61
61
expect ( wrapper . html ( ) ) . toBe ( '<h1>Bem-vindo, Francisco!</h1>' )
62
62
} )
63
63
64
+ it ( 'replaces multiple occurrences with $t mixin' , async ( ) => {
65
+ const wrapper = await global . mountPlugin ( `<h1>{{ $t('hi :name, hi :name', { name: 'Francisco' }) }}</h1>` ) ;
66
+
67
+ expect ( wrapper . html ( ) ) . toBe ( '<h1>olá Francisco, olá Francisco</h1>' )
68
+ } )
69
+
64
70
it ( 'translates key with values with "trans" helper' , async ( ) => {
65
71
await global . mountPlugin ( ) ;
66
72
67
73
expect ( trans ( 'Welcome, :name!' , { name : 'Francisco' } ) )
68
74
. toBe ( 'Bem-vindo, Francisco!' )
69
75
} )
70
76
77
+ it ( 'replaces multiple occurrences with "trans" helper' , async ( ) => {
78
+ await global . mountPlugin ( ) ;
79
+
80
+ expect ( trans ( 'hi :name, hi :name' , { name : 'Francisco' } ) )
81
+ . toBe ( 'olá Francisco, olá Francisco' )
82
+ } )
83
+
71
84
it ( 'loads a lang' , async ( ) => {
72
85
const wrapper = await global . mountPlugin ( `<h1>{{ $t('Welcome, :name!', { name: 'Francisco' }) }}</h1>` , 'en' ) ;
73
86
@@ -204,4 +217,4 @@ it('does not translate existing strings which contain delimiter symbols', async
204
217
205
218
expect ( trans ( 'Start/end' ) ) . toBe ( 'Início/Fim' ) ;
206
219
expect ( trans ( 'Get started.' ) ) . toBe ( 'Comece.' ) ;
207
- } )
220
+ } )
0 commit comments