mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-10-18 22:23:23 +00:00
9ac462c655
* 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
20 lines
583 B
JavaScript
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')
|
|
});
|
|
});
|