grafana/public/app/core/internationalization/constants.test.ts
Josh Hunt 460be70261
Internationalization: Change locale preference to language (#58359)
* backend locale -> language

* frontend locale -> language

* sample.ini and tests

* fix few last locale -> language

* fix few last locale -> language
2022-11-22 12:18:34 +00:00

15 lines
465 B
TypeScript

import { uniqBy } from 'lodash';
import { LANGUAGES, VALID_LANGUAGES } from './constants';
describe('internationalization constants', () => {
it('should not have duplicate languages codes', () => {
const uniqLocales = uniqBy(LANGUAGES, (v) => v.code);
expect(LANGUAGES).toHaveLength(uniqLocales.length);
});
it('should have a correct list of valid locale codes', () => {
expect(VALID_LANGUAGES).toEqual(LANGUAGES.map((v) => v.code));
});
});