forked from MapComplete/MapComplete
Fix: tests
This commit is contained in:
parent
39024eb5f3
commit
238de89ad5
3 changed files with 9 additions and 2 deletions
|
@ -156,6 +156,9 @@ export class UpdateLegacyLayer extends DesugaringStep<
|
|||
|
||||
for (const rendering of config.mapRendering) {
|
||||
for (const key in rendering) {
|
||||
if (!rendering[key]) {
|
||||
continue
|
||||
}
|
||||
if (
|
||||
typeof rendering[key]["render"] === "string" &&
|
||||
Object.keys(rendering[key]).length === 1
|
||||
|
|
|
@ -44,7 +44,7 @@ describe("ReplaceGeometryAction", () => {
|
|||
mapRendering: [
|
||||
{
|
||||
icon: "square:#cc0",
|
||||
iconSize: "5,5,center",
|
||||
iconSize: "5,5",
|
||||
location: ["point"],
|
||||
},
|
||||
],
|
||||
|
@ -292,7 +292,7 @@ describe("ReplaceGeometryAction", () => {
|
|||
tagRenderings: [],
|
||||
mapRendering: [
|
||||
{
|
||||
iconSize: "50,50,center",
|
||||
iconSize: "50,50",
|
||||
icon: "./assets/themes/grb/housenumber_blank.svg",
|
||||
location: ["point", "centroid"],
|
||||
},
|
||||
|
|
|
@ -42,6 +42,7 @@ describe("PrepareTheme", () => {
|
|||
const prepareStep = new PrepareTheme({
|
||||
tagRenderings: new Map<string, TagRenderingConfigJson>(),
|
||||
sharedLayers: sharedLayers,
|
||||
publicLayers: new Set<string>(),
|
||||
})
|
||||
let themeConfigJsonPrepared = prepareStep.convert(theme, "test").result
|
||||
const themeConfig = new LayoutConfig(themeConfigJsonPrepared)
|
||||
|
@ -59,6 +60,7 @@ describe("PrepareTheme", () => {
|
|||
let themeConfigJsonPrepared = new PrepareTheme({
|
||||
tagRenderings: new Map<string, TagRenderingConfigJson>(),
|
||||
sharedLayers: sharedLayers,
|
||||
publicLayers: new Set<string>(),
|
||||
}).convert(themeConfigJson, "test").result
|
||||
const themeConfig = new LayoutConfig(themeConfigJsonPrepared)
|
||||
const layerUnderTest = <LayerConfig>(
|
||||
|
@ -73,6 +75,7 @@ describe("PrepareTheme", () => {
|
|||
let themeConfigJsonPrepared = new PrepareTheme({
|
||||
tagRenderings: new Map<string, TagRenderingConfigJson>(),
|
||||
sharedLayers: sharedLayers,
|
||||
publicLayers: new Set<string>(),
|
||||
}).convert(
|
||||
{
|
||||
...themeConfigJson,
|
||||
|
@ -102,6 +105,7 @@ describe("PrepareTheme", () => {
|
|||
const ctx: DesugaringContext = {
|
||||
sharedLayers: new Map<string, LayerConfigJson>([["layer-example", testLayer]]),
|
||||
tagRenderings: new Map<string, TagRenderingConfigJson>(),
|
||||
publicLayers: new Set<string>(),
|
||||
}
|
||||
const layout: LayoutConfigJson = {
|
||||
description: "A testing theme",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue