iris-messenger/tests/Translation.test.js
Trevin Hofmann 9ac462c655
test: add a couple initial tests for Translation.js (#107)
* test: add a couple initial tests for Translation.js

* ci: add build and test jobs to GitHub actions, along with lint

* test: remove old broken example test for the Header component
2022-06-14 10:50:57 +03:00

20 lines
583 B
JavaScript

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