forked from MapComplete/MapComplete
Merge master
This commit is contained in:
commit
f0c90b4d1c
50 changed files with 815 additions and 282 deletions
|
@ -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,14 +1,17 @@
|
|||
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", () => {
|
||||
|
||||
it("should all have description in the translations", () => {
|
||||
const ts = Translations.t.validation;
|
||||
const missingTranslations = Array.from(ValidatedTextField.allTypes.keys())
|
||||
.filter(key => ts[key] === undefined || ts[key].description === undefined)
|
||||
expect(missingTranslations, "These validated text fields don't have a type name defined in en.json. (Did you just add one? Run `npm run generate:translations`)").to.be.empty
|
||||
})
|
||||
|
||||
it("should all have description in the translations", () => {
|
||||
const ts = Translations.t.validation;
|
||||
const missingTranslations = Array.from(ValidatedTextField.allTypes.keys())
|
||||
.filter(key => ts[key] === undefined || ts[key].description === undefined)
|
||||
.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…
Add table
Add a link
Reference in a new issue