From e434b2d26ef1e03f028013d7944fe7d0a0b12b95 Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Mon, 15 Jun 2020 16:13:05 +0200 Subject: [PATCH] test: add tests for translatedThingType function --- test/translator.spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/translator.spec.ts b/test/translator.spec.ts index faba752d..42750539 100644 --- a/test/translator.spec.ts +++ b/test/translator.spec.ts @@ -263,6 +263,16 @@ export class MetaTranslationSpec { expect(dishMetaTranslationsEN).to.deep.equal(SCDishMeta.getInstance().fieldTranslations.en); } + @test + public retrieveTranslatedThingType() { + const dishTypeDE = translator.translatedThingType(dish.type); + const dishTypeEN = translator.translatedThingType(dish.type, 'en'); + const dishTypeBASE = translatorWithFallback.translatedThingType(dish.type); + expect(dishTypeDE).to.deep.equal(SCDishMeta.getInstance().fieldValueTranslations.de.type); + expect(dishTypeEN).to.deep.equal(SCDishMeta.getInstance().fieldValueTranslations.en.type); + expect(dishTypeBASE).to.deep.equal(SCDishMeta.getInstance().fieldValueTranslations.en.type); + } + @test public thingWithoutMetaClass() { const dishCopy = clone(dish);