2024-01-29 10:44:45 +00:00
|
|
|
package utils
|
2023-09-07 16:34:51 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestListLocale(t *testing.T) {
|
|
|
|
locales := ListLocale()
|
|
|
|
assert.True(t, len(locales) > 4)
|
|
|
|
assert.Equal(t, struct{ Value, Label string }{Value: "af", Label: "Afrikaans"}, locales[0])
|
|
|
|
assert.Equal(t, struct{ Value, Label string }{Value: "am", Label: "አማርኛ"}, locales[1])
|
|
|
|
assert.Equal(t, struct{ Value, Label string }{Value: "zh-Hant", Label: "繁體中文"}, locales[len(locales)-2])
|
|
|
|
assert.Equal(t, struct{ Value, Label string }{Value: "zu", Label: "isiZulu"}, locales[len(locales)-1])
|
|
|
|
}
|