forked from MapComplete/MapComplete
Fix tests
This commit is contained in:
parent
6023f6e36c
commit
193834c286
16 changed files with 22 additions and 42 deletions
|
@ -546,7 +546,7 @@ class LengthTextField extends TextFieldDef {
|
|||
|
||||
constructor() {
|
||||
super(
|
||||
"length", "A geographical length in meters (rounded at two points). Will give an extra minimap with a measurement tool. Arguments: [ zoomlevel, preferredBackgroundMapType (comma separated) ], e.g. `[\"21\", \"map,photo\"]"
|
||||
"distance", "A geographical distance in meters (rounded at two points). Will give an extra minimap with a measurement tool. Arguments: [ zoomlevel, preferredBackgroundMapType (comma separated) ], e.g. `[\"21\", \"map,photo\"]"
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import CompiledTranslations from "../../assets/generated/CompiledTranslations";
|
|||
|
||||
export default class Translations {
|
||||
|
||||
static t = CompiledTranslations.t;
|
||||
static readonly t : typeof CompiledTranslations.t & Readonly<typeof CompiledTranslations.t> = CompiledTranslations.t;
|
||||
private static knownLanguages = new Set(known_languages.languages)
|
||||
constructor() {
|
||||
throw "Translations is static. If you want to intitialize a new translation, use the singular form"
|
||||
|
|
|
@ -373,7 +373,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "maxwidth:physical",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"20",
|
||||
"map"
|
||||
|
@ -406,7 +406,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "width:separation",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"21",
|
||||
"map"
|
||||
|
@ -440,7 +440,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "width:opening",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"21",
|
||||
"map"
|
||||
|
@ -474,7 +474,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "overlap",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"21",
|
||||
"map"
|
||||
|
|
|
@ -836,7 +836,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "width:carriageway",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"20",
|
||||
"map"
|
||||
|
@ -1260,7 +1260,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "cycleway:buffer",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"20",
|
||||
"map"
|
||||
|
|
|
@ -338,7 +338,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "width",
|
||||
"type": "length"
|
||||
"type": "distance"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
"condition": "sidewalk:left|right=yes",
|
||||
"freeform": {
|
||||
"key": "sidewalk:left|right:width",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"21",
|
||||
"map"
|
||||
|
|
|
@ -548,9 +548,6 @@
|
|||
"date": {
|
||||
"description": "Una data, començant per l'any"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "Un número"
|
||||
},
|
||||
"direction": {
|
||||
"description": "Una orientació"
|
||||
},
|
||||
|
|
|
@ -634,9 +634,6 @@
|
|||
"date": {
|
||||
"description": "En dato, der starter med årstallet"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "Et tal"
|
||||
},
|
||||
"direction": {
|
||||
"description": "En retning"
|
||||
},
|
||||
|
|
|
@ -755,9 +755,6 @@
|
|||
"date": {
|
||||
"description": "Ein Datum, beginnend mit der Jahreszahl"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "Eine Zahl"
|
||||
},
|
||||
"direction": {
|
||||
"description": "Eine Himmelsrichtung"
|
||||
},
|
||||
|
|
|
@ -827,12 +827,12 @@
|
|||
"date": {
|
||||
"description": "A date, starting with the year"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "A number"
|
||||
},
|
||||
"direction": {
|
||||
"description": "An orientation"
|
||||
},
|
||||
"distance": {
|
||||
"description": "A distance in meter"
|
||||
},
|
||||
"email": {
|
||||
"description": "email-adres",
|
||||
"feedback": "This is not a valid email address",
|
||||
|
@ -845,9 +845,6 @@
|
|||
"int": {
|
||||
"description": "a whole number"
|
||||
},
|
||||
"length": {
|
||||
"description": "a length measurement in meter"
|
||||
},
|
||||
"nat": {
|
||||
"description": "a positive, whole number or zero",
|
||||
"mustBePositive": "This number should be positive",
|
||||
|
|
|
@ -516,9 +516,6 @@
|
|||
"deactivate": "Deshabilitar los botones de traducción"
|
||||
},
|
||||
"validation": {
|
||||
"decimal": {
|
||||
"description": "Un número"
|
||||
},
|
||||
"direction": {
|
||||
"description": "Una orientación"
|
||||
},
|
||||
|
|
|
@ -144,9 +144,6 @@
|
|||
"date": {
|
||||
"description": "Tanggal, dimulai dari tahun"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "Nomor"
|
||||
},
|
||||
"direction": {
|
||||
"description": "Orientasi"
|
||||
},
|
||||
|
|
|
@ -480,9 +480,6 @@
|
|||
"date": {
|
||||
"description": "En dato, som starter med året"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "Et tall"
|
||||
},
|
||||
"direction": {
|
||||
"description": "En retning"
|
||||
},
|
||||
|
|
|
@ -753,12 +753,12 @@
|
|||
"date": {
|
||||
"description": "Een datum (beginnend met het jaar)"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "Een getal"
|
||||
},
|
||||
"direction": {
|
||||
"description": "Een orientatie"
|
||||
},
|
||||
"distance": {
|
||||
"description": "Een afstand in meter"
|
||||
},
|
||||
"email": {
|
||||
"description": "email-adres",
|
||||
"feedback": "Dit is geen geldig email-adres",
|
||||
|
|
|
@ -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")]))
|
||||
|
||||
})
|
||||
|
||||
|
|
|
@ -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`)")
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue