2019-10-08 18:45:38 +00:00
|
|
|
import { STRING_ERROR_MSG, STRING_DOES_NOT_EXIST_MSG } from '../helpers/content.helper';
|
2016-09-16 15:18:07 +00:00
|
|
|
import translator from '../../website/common/script/content/translation';
|
2015-09-29 12:55:13 +00:00
|
|
|
|
|
|
|
|
describe('Translator', () => {
|
|
|
|
|
it('returns error message if string is not properly formatted', () => {
|
2019-10-08 18:45:38 +00:00
|
|
|
const improperlyFormattedString = translator('petName', { attr: 0 })();
|
2017-03-10 13:14:42 +00:00
|
|
|
expect(improperlyFormattedString).to.match(STRING_ERROR_MSG);
|
2015-09-29 12:55:13 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('returns an error message if string does not exist', () => {
|
2019-10-08 18:45:38 +00:00
|
|
|
const stringDoesNotExist = translator('stringDoesNotExist')();
|
2015-09-29 12:55:13 +00:00
|
|
|
expect(stringDoesNotExist).to.match(STRING_DOES_NOT_EXIST_MSG);
|
|
|
|
|
});
|
|
|
|
|
});
|