mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
test fixes
This commit is contained in:
@@ -7,13 +7,13 @@ i18n.translations = 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');
|
||||
export function expectValidTranslationString (attribute, contextKey) {
|
||||
expect(attribute, contextKey).to.be.a('function');
|
||||
|
||||
const 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);
|
||||
expect(translatedString.trim(), contextKey).to.not.be.empty;
|
||||
expect(translatedString, contextKey).to.not.contain('function func(lang)');
|
||||
expect(translatedString, contextKey).to.not.eql(STRING_ERROR_MSG);
|
||||
expect(translatedString, contextKey).to.not.match(STRING_DOES_NOT_EXIST_MSG);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user