iris-messenger/tests/Translation.test.js
Fernando López Guevara aaa421c92b
added prettier, eslint, spanish translations (#161)
* fix: handle missing user on metion properly

* prettier eslint

* use dep from npm registry

* fix: send from to sub callback
2022-11-11 08:00:32 +02:00

22 lines
631 B
JavaScript

import { AVAILABLE_LANGUAGE_KEYS, translate } from '../src/js/translations/Translation';
console.log('hello from test');
describe('Translation', () => {
describe('AVAILABLE_LANGUAGES', () => {
it('should include English', () => {
expect(AVAILABLE_LANGUAGE_KEYS).toContain('en');
});
});
describe('translate', () => {
it('should translate language_name', () => {
localStorage.setItem('language', 'en');
expect(translate('new_user_go')).toBe('Go');
});
// TODO: update the API of Translation.js so that we can test with other
// languages (it is currently fixed to 'en')
});
});