Skip to content
Snippets Groups Projects
Commit 2d60b131 authored by Anton Sattarov's avatar Anton Sattarov :cucumber: Committed by Pavel Antonov
Browse files

Добавлены тесты Localizer-a для обьектов без переводов

parent d33ba61e
Branches
Tags
No related merge requests found
...@@ -352,6 +352,24 @@ func TestLocalizer_localize(t *testing.T) { ...@@ -352,6 +352,24 @@ func TestLocalizer_localize(t *testing.T) {
}, },
}, },
}, },
{
name: "Success singlelocale obj",
fallback: map[string]interface{}{
"obj3": map[string]interface{}{
"a": "obj3_en",
},
},
target: map[string]interface{}{
"obj3": map[string]interface{}{
"a": "obj3",
},
},
want: map[string]interface{}{
"obj3": map[string]interface{}{
"a": "obj3_en",
},
},
},
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
...@@ -595,6 +613,20 @@ func TestLocalizer_extractTranslation(t *testing.T) { ...@@ -595,6 +613,20 @@ func TestLocalizer_extractTranslation(t *testing.T) {
}, },
}, },
}, },
{
name: "Success singlelocale obj",
fallback: map[string]interface{}{
"obj3": map[string]interface{}{
"a": "obj3_en",
},
},
target: map[string]interface{}{
"obj3": map[string]interface{}{
"a": "obj3_ru",
},
},
want: map[string]interface{}{},
},
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment