mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 02:10:45 -06:00
I18n: Add constants value tests to avoid typos (#93070)
This commit is contained in:
parent
3aeb8d390e
commit
3fde6bd730
@ -1,8 +1,30 @@
|
||||
import { uniqBy } from 'lodash';
|
||||
|
||||
import { LANGUAGES, VALID_LANGUAGES } from './constants';
|
||||
import {
|
||||
BRAZILIAN_PORTUGUESE,
|
||||
CHINESE_SIMPLIFIED,
|
||||
DEFAULT_LANGUAGE,
|
||||
ENGLISH_US,
|
||||
FRENCH_FRANCE,
|
||||
GERMAN_GERMANY,
|
||||
LANGUAGES,
|
||||
PSEUDO_LOCALE,
|
||||
SPANISH_SPAIN,
|
||||
VALID_LANGUAGES,
|
||||
} from './constants';
|
||||
|
||||
describe('internationalization constants', () => {
|
||||
it('should have set the constants correctly', () => {
|
||||
expect(ENGLISH_US).toBe('en-US');
|
||||
expect(FRENCH_FRANCE).toBe('fr-FR');
|
||||
expect(SPANISH_SPAIN).toBe('es-ES');
|
||||
expect(GERMAN_GERMANY).toBe('de-DE');
|
||||
expect(BRAZILIAN_PORTUGUESE).toBe('pt-BR');
|
||||
expect(CHINESE_SIMPLIFIED).toBe('zh-Hans');
|
||||
expect(PSEUDO_LOCALE).toBe('pseudo-LOCALE');
|
||||
expect(DEFAULT_LANGUAGE).toBe(ENGLISH_US);
|
||||
});
|
||||
|
||||
it('should not have duplicate languages codes', () => {
|
||||
const uniqLocales = uniqBy(LANGUAGES, (v) => v.code);
|
||||
expect(LANGUAGES).toHaveLength(uniqLocales.length);
|
||||
|
Loading…
Reference in New Issue
Block a user