forked from MapComplete/MapComplete
Fix tests
This commit is contained in:
parent
7fe79600fb
commit
9b1bf96790
2 changed files with 16 additions and 4 deletions
|
@ -6,7 +6,7 @@ import SelectedFeatureHandler from "../Logic/Actors/SelectedFeatureHandler";
|
||||||
import {UIEventSource} from "../Logic/UIEventSource";
|
import {UIEventSource} from "../Logic/UIEventSource";
|
||||||
import {ElementStorage} from "../Logic/ElementStorage";
|
import {ElementStorage} from "../Logic/ElementStorage";
|
||||||
import Loc from "../Models/Loc";
|
import Loc from "../Models/Loc";
|
||||||
import * as bookcaseJson from "../assets/themes/bookcases/bookcases.json"
|
import * as bookcaseJson from "../assets/generated/themes/bookcases.json"
|
||||||
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig";
|
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig";
|
||||||
|
|
||||||
export default class ActorsSpec extends T {
|
export default class ActorsSpec extends T {
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
import T from "./TestHelper";
|
import T from "./TestHelper";
|
||||||
import {Utils} from "../Utils";
|
|
||||||
import * as assert from "assert";
|
import * as assert from "assert";
|
||||||
import {LayoutConfigJson} from "../Models/ThemeConfig/Json/LayoutConfigJson";
|
import {LayoutConfigJson} from "../Models/ThemeConfig/Json/LayoutConfigJson";
|
||||||
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig";
|
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig";
|
||||||
|
import * as bookcaseLayer from "../assets/generated/layers/public_bookcase.json"
|
||||||
|
import {PrepareLayer, PrepareTheme} from "../Models/ThemeConfig/LegacyJsonConvert";
|
||||||
|
import {TagRenderingConfigJson} from "../Models/ThemeConfig/Json/TagRenderingConfigJson";
|
||||||
|
import {LayerConfigJson} from "../Models/ThemeConfig/Json/LayerConfigJson";
|
||||||
|
import LayerConfig from "../Models/ThemeConfig/LayerConfig";
|
||||||
|
import Constants from "../Models/Constants";
|
||||||
|
|
||||||
export default class ThemeSpec extends T {
|
export default class ThemeSpec extends T {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -10,7 +15,7 @@ export default class ThemeSpec extends T {
|
||||||
[
|
[
|
||||||
["Nested overrides work", () => {
|
["Nested overrides work", () => {
|
||||||
|
|
||||||
const themeConfigJson: LayoutConfigJson = {
|
let themeConfigJson: LayoutConfigJson = {
|
||||||
description: "Descr",
|
description: "Descr",
|
||||||
icon: "",
|
icon: "",
|
||||||
language: ["en"],
|
language: ["en"],
|
||||||
|
@ -34,7 +39,14 @@ export default class ThemeSpec extends T {
|
||||||
version: "",
|
version: "",
|
||||||
id: "test"
|
id: "test"
|
||||||
}
|
}
|
||||||
|
// TOtal cheat: disable the default layers:
|
||||||
|
Constants.added_by_default.splice(0, Constants.added_by_default.length)
|
||||||
|
const sharedLayers = new Map<string, LayerConfigJson>()
|
||||||
|
sharedLayers.set("public_bookcase", bookcaseLayer["default"])
|
||||||
|
themeConfigJson = new PrepareTheme().convertStrict({
|
||||||
|
tagRenderings: new Map<string, TagRenderingConfigJson>(),
|
||||||
|
sharedLayers: sharedLayers
|
||||||
|
}, themeConfigJson, "test")
|
||||||
const themeConfig = new LayoutConfig(themeConfigJson);
|
const themeConfig = new LayoutConfig(themeConfigJson);
|
||||||
assert.equal("xyz", themeConfig.layers[0].source.geojsonSource)
|
assert.equal("xyz", themeConfig.layers[0].source.geojsonSource)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue