mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
start adding apiMessages add apiMessages lib with tests use apiMessage and fix tests fix content tests guilds pagination: add api docs guilds pagination: improve api docs
18 lines
716 B
JavaScript
18 lines
716 B
JavaScript
require('./globals.helper');
|
|
import i18n from '../../website/common/script/i18n';
|
|
i18n.translations = require('../../website/server/libs/i18n').translations;
|
|
|
|
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.$/;
|
|
|
|
export function expectValidTranslationString (attribute) {
|
|
expect(attribute).to.be.a('function');
|
|
|
|
let translatedString = attribute();
|
|
|
|
expect(translatedString.trim()).to.not.be.empty;
|
|
expect(translatedString).to.not.contain('function func(lang)');
|
|
expect(translatedString).to.not.eql(STRING_ERROR_MSG);
|
|
expect(translatedString).to.not.match(STRING_DOES_NOT_EXIST_MSG);
|
|
}
|