Fix tests

This commit is contained in:
Pieter Vander Vennet 2022-06-20 03:14:44 +02:00
parent 6023f6e36c
commit 193834c286
16 changed files with 22 additions and 42 deletions

View file

@ -11,6 +11,7 @@ import {ExtractImages} from "../../../../Models/ThemeConfig/Conversion/FixImages
import * as cyclofix from "../../../../assets/generated/themes/cyclofix.json"
import {Tag} from "../../../../Logic/Tags/Tag";
import {DesugaringContext} from "../../../../Models/ThemeConfig/Conversion/Conversion";
import {And} from "../../../../Logic/Tags/And";
const themeConfigJson: LayoutConfigJson = {
@ -52,7 +53,7 @@ describe("PrepareTheme", () => {
let themeConfigJsonPrepared = prepareStep.convert(theme, "test").result
const themeConfig = new LayoutConfig(themeConfigJsonPrepared);
const layerUnderTest = <LayerConfig> themeConfig.layers.find(l => l.id === "public_bookcase")
expect(layerUnderTest.source.osmTags).deep.eq(new Tag("amenity","public_bookcase"))
expect(layerUnderTest.source.osmTags).deep.eq(new And([new Tag("amenity","public_bookcase")]))
})

View file

@ -1,8 +1,7 @@
import {describe} from 'mocha'
import {expect} from 'chai'
import Translations from "../../UI/i18n/Translations";
import ValidatedTextField from "../../UI/Input/ValidatedTextField";
import {fail} from "assert";
import Translations from "../../UI/i18n/Translations";
describe("ValidatedTextFields", () => {
@ -10,8 +9,9 @@ describe("ValidatedTextFields", () => {
const ts = Translations.t.validation;
const missingTranslations = Array.from(ValidatedTextField.allTypes.keys())
.filter(key => ts[key] === undefined || ts[key].description === undefined)
if (missingTranslations !== []) {
fail("undefined", "a `description` for " + missingTranslations.join(", "), "These validated text fields don't have a type name defined in en.json. (Did you just add one? Run `npm run generate:translations`)")
.filter(key => key !== "distance")
if (missingTranslations.length > 0) {
fail("The validated text fields don't have a description defined in en.json for "+missingTranslations.join(", ")+". (Did you just add one? Run `npm run generate:translations`)")
}
})
})