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 rendering of config.mapRendering) {
 | 
				
			||||||
            for (const key in rendering) {
 | 
					            for (const key in rendering) {
 | 
				
			||||||
 | 
					                if (!rendering[key]) {
 | 
				
			||||||
 | 
					                    continue
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
                if (
 | 
					                if (
 | 
				
			||||||
                    typeof rendering[key]["render"] === "string" &&
 | 
					                    typeof rendering[key]["render"] === "string" &&
 | 
				
			||||||
                    Object.keys(rendering[key]).length === 1
 | 
					                    Object.keys(rendering[key]).length === 1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -44,7 +44,7 @@ describe("ReplaceGeometryAction", () => {
 | 
				
			||||||
                    mapRendering: [
 | 
					                    mapRendering: [
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            icon: "square:#cc0",
 | 
					                            icon: "square:#cc0",
 | 
				
			||||||
                            iconSize: "5,5,center",
 | 
					                            iconSize: "5,5",
 | 
				
			||||||
                            location: ["point"],
 | 
					                            location: ["point"],
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
                    ],
 | 
					                    ],
 | 
				
			||||||
| 
						 | 
					@ -292,7 +292,7 @@ describe("ReplaceGeometryAction", () => {
 | 
				
			||||||
                tagRenderings: [],
 | 
					                tagRenderings: [],
 | 
				
			||||||
                mapRendering: [
 | 
					                mapRendering: [
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        iconSize: "50,50,center",
 | 
					                        iconSize: "50,50",
 | 
				
			||||||
                        icon: "./assets/themes/grb/housenumber_blank.svg",
 | 
					                        icon: "./assets/themes/grb/housenumber_blank.svg",
 | 
				
			||||||
                        location: ["point", "centroid"],
 | 
					                        location: ["point", "centroid"],
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,6 +42,7 @@ describe("PrepareTheme", () => {
 | 
				
			||||||
        const prepareStep = new PrepareTheme({
 | 
					        const prepareStep = new PrepareTheme({
 | 
				
			||||||
            tagRenderings: new Map<string, TagRenderingConfigJson>(),
 | 
					            tagRenderings: new Map<string, TagRenderingConfigJson>(),
 | 
				
			||||||
            sharedLayers: sharedLayers,
 | 
					            sharedLayers: sharedLayers,
 | 
				
			||||||
 | 
					            publicLayers: new Set<string>(),
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        let themeConfigJsonPrepared = prepareStep.convert(theme, "test").result
 | 
					        let themeConfigJsonPrepared = prepareStep.convert(theme, "test").result
 | 
				
			||||||
        const themeConfig = new LayoutConfig(themeConfigJsonPrepared)
 | 
					        const themeConfig = new LayoutConfig(themeConfigJsonPrepared)
 | 
				
			||||||
| 
						 | 
					@ -59,6 +60,7 @@ describe("PrepareTheme", () => {
 | 
				
			||||||
        let themeConfigJsonPrepared = new PrepareTheme({
 | 
					        let themeConfigJsonPrepared = new PrepareTheme({
 | 
				
			||||||
            tagRenderings: new Map<string, TagRenderingConfigJson>(),
 | 
					            tagRenderings: new Map<string, TagRenderingConfigJson>(),
 | 
				
			||||||
            sharedLayers: sharedLayers,
 | 
					            sharedLayers: sharedLayers,
 | 
				
			||||||
 | 
					            publicLayers: new Set<string>(),
 | 
				
			||||||
        }).convert(themeConfigJson, "test").result
 | 
					        }).convert(themeConfigJson, "test").result
 | 
				
			||||||
        const themeConfig = new LayoutConfig(themeConfigJsonPrepared)
 | 
					        const themeConfig = new LayoutConfig(themeConfigJsonPrepared)
 | 
				
			||||||
        const layerUnderTest = <LayerConfig>(
 | 
					        const layerUnderTest = <LayerConfig>(
 | 
				
			||||||
| 
						 | 
					@ -73,6 +75,7 @@ describe("PrepareTheme", () => {
 | 
				
			||||||
        let themeConfigJsonPrepared = new PrepareTheme({
 | 
					        let themeConfigJsonPrepared = new PrepareTheme({
 | 
				
			||||||
            tagRenderings: new Map<string, TagRenderingConfigJson>(),
 | 
					            tagRenderings: new Map<string, TagRenderingConfigJson>(),
 | 
				
			||||||
            sharedLayers: sharedLayers,
 | 
					            sharedLayers: sharedLayers,
 | 
				
			||||||
 | 
					            publicLayers: new Set<string>(),
 | 
				
			||||||
        }).convert(
 | 
					        }).convert(
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                ...themeConfigJson,
 | 
					                ...themeConfigJson,
 | 
				
			||||||
| 
						 | 
					@ -102,6 +105,7 @@ describe("PrepareTheme", () => {
 | 
				
			||||||
        const ctx: DesugaringContext = {
 | 
					        const ctx: DesugaringContext = {
 | 
				
			||||||
            sharedLayers: new Map<string, LayerConfigJson>([["layer-example", testLayer]]),
 | 
					            sharedLayers: new Map<string, LayerConfigJson>([["layer-example", testLayer]]),
 | 
				
			||||||
            tagRenderings: new Map<string, TagRenderingConfigJson>(),
 | 
					            tagRenderings: new Map<string, TagRenderingConfigJson>(),
 | 
				
			||||||
 | 
					            publicLayers: new Set<string>(),
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        const layout: LayoutConfigJson = {
 | 
					        const layout: LayoutConfigJson = {
 | 
				
			||||||
            description: "A testing theme",
 | 
					            description: "A testing theme",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue