2015-09-29 12:55:13 +00:00
|
|
|
require('./globals.helper');
|
2016-09-16 15:18:07 +00:00
|
|
|
import i18n from '../../website/common/script/i18n';
|
2016-08-01 20:36:10 +00:00
|
|
|
i18n.translations = require('../../website/server/libs/i18n').translations;
|
2015-09-29 12:55:13 +00:00
|
|
|
|
2015-10-03 15:26:10 +00:00
|
|
|
export const STRING_ERROR_MSG = 'Error processing the string. Please see Help > Report a Bug.';
|
|
|
|
|
export const STRING_DOES_NOT_EXIST_MSG = /^String '.*' not found.$/;
|
2015-09-29 12:55:13 +00:00
|
|
|
|
2015-10-03 15:48:42 +00:00
|
|
|
export function expectValidTranslationString (attribute) {
|
2015-09-29 12:55:13 +00:00
|
|
|
expect(attribute).to.be.a('function');
|
|
|
|
|
|
|
|
|
|
let translatedString = attribute();
|
|
|
|
|
|
2016-09-11 03:05:25 +00:00
|
|
|
expect(translatedString.trim()).to.not.be.empty;
|
|
|
|
|
expect(translatedString).to.not.contain('function func(lang)');
|
2015-09-29 12:55:13 +00:00
|
|
|
expect(translatedString).to.not.eql(STRING_ERROR_MSG);
|
|
|
|
|
expect(translatedString).to.not.match(STRING_DOES_NOT_EXIST_MSG);
|
2015-11-18 14:54:34 +00:00
|
|
|
}
|