mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 17:12:43 +00:00
test: adapt tests for translatedPropertyNames
This commit is contained in:
@@ -256,8 +256,8 @@ export class MetaTranslationSpec {
|
|||||||
|
|
||||||
@test
|
@test
|
||||||
public consistencyWithMetaClass() {
|
public consistencyWithMetaClass() {
|
||||||
const dishMetaTranslationsDE = translator.translatedPropertyNames(dish);
|
const dishMetaTranslationsDE = translator.translatedPropertyNames(dish.type);
|
||||||
const dishMetaTranslationsEN = translator.translatedPropertyNames(dish, 'en');
|
const dishMetaTranslationsEN = translator.translatedPropertyNames(dish.type, 'en');
|
||||||
expect(dishMetaTranslationsEN).to.not.deep.equal(dishMetaTranslationsDE);
|
expect(dishMetaTranslationsEN).to.not.deep.equal(dishMetaTranslationsDE);
|
||||||
expect(dishMetaTranslationsDE).to.deep.equal(SCDishMeta.getInstance().fieldTranslations.de);
|
expect(dishMetaTranslationsDE).to.deep.equal(SCDishMeta.getInstance().fieldTranslations.de);
|
||||||
expect(dishMetaTranslationsEN).to.deep.equal(SCDishMeta.getInstance().fieldTranslations.en);
|
expect(dishMetaTranslationsEN).to.deep.equal(SCDishMeta.getInstance().fieldTranslations.en);
|
||||||
@@ -269,7 +269,7 @@ export class MetaTranslationSpec {
|
|||||||
const typeNonExistant = eval("(x) => x + 'typeNonExistant';");
|
const typeNonExistant = eval("(x) => x + 'typeNonExistant';");
|
||||||
// this will assign a non existant SCThingType to dishCopy
|
// this will assign a non existant SCThingType to dishCopy
|
||||||
dishCopy.type = typeNonExistant();
|
dishCopy.type = typeNonExistant();
|
||||||
const dishMetaTranslationsDE = translator.translatedPropertyNames(dishCopy);
|
const dishMetaTranslationsDE = translator.translatedPropertyNames(dishCopy.type);
|
||||||
expect(dishMetaTranslationsDE).to.be.undefined;
|
expect(dishMetaTranslationsDE).to.be.undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user