mirror of
https://github.com/grafana/grafana.git
synced 2026-09-05 04:40:13 -05:00
i18n: Add test to check languages match a canonical locale (#93105)
add test to check languages match a canonical locale
This commit is contained in:
@@ -25,6 +25,13 @@ describe('internationalization constants', () => {
|
|||||||
expect(DEFAULT_LANGUAGE).toBe(ENGLISH_US);
|
expect(DEFAULT_LANGUAGE).toBe(ENGLISH_US);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should match a canonical locale definition', () => {
|
||||||
|
for (const lang of LANGUAGES) {
|
||||||
|
const resolved = Intl.getCanonicalLocales(lang.code);
|
||||||
|
expect(lang.code).toEqual(resolved[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
it('should not have duplicate languages codes', () => {
|
it('should not have duplicate languages codes', () => {
|
||||||
const uniqLocales = uniqBy(LANGUAGES, (v) => v.code);
|
const uniqLocales = uniqBy(LANGUAGES, (v) => v.code);
|
||||||
expect(LANGUAGES).toHaveLength(uniqLocales.length);
|
expect(LANGUAGES).toHaveLength(uniqLocales.length);
|
||||||
|
|||||||
Reference in New Issue
Block a user