Skip to content

Commit 8536785

Browse files
committed
test: Add test to make sure it translates a non nested level.
1 parent eddfabb commit 8536785

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/fixtures/lang/pt.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"Welcome!": "Bem-vindo!",
33
"Welcome, :name!": "Bem-vindo, :name!",
4-
"{1} :count minute ago|[2,*] :count minutes ago": "{1} há :count minuto|[2,*] há :count minutos"
4+
"{1} :count minute ago|[2,*] :count minutes ago": "{1} há :count minuto|[2,*] há :count minutos",
5+
"foo.bar": "baz"
56
}

test/translate.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,7 @@ it('translates arrays with "trans" helper', async () => {
187187
expect(trans('auth.arr')).toStrictEqual(['foo', 'bar']);
188188
})
189189

190+
it('translates a possible nested item, and if not exists check on the root level', async () => {
191+
await global.mountPlugin(undefined, 'pt');
192+
expect(trans('foo.bar')).toBe('baz');
193+
});

0 commit comments

Comments
 (0)