Files
habitica/test/helpers/content.helper.js
Blade Barringer 3d53781bd3 Fix content name error (#7995)
* fix: correct translation strings for pet/mount names

* chore: expose potion and egg key, not object in pet content api

* fix: Update feed route to use potion and egg objects

* refactor: Update feed route to use petInfo

* Use pet/mount text method for name

* correct feed route
2016-09-10 22:05:25 -05:00

18 lines
701 B
JavaScript

require('./globals.helper');
import i18n from '../../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);
}