forked from MapComplete/MapComplete
First part of a huge refactoring
This commit is contained in:
parent
0c22b15c8d
commit
11150a258d
56 changed files with 1425 additions and 1324 deletions
|
@ -1,5 +1,4 @@
|
|||
import T from "./TestHelper";
|
||||
import {AllKnownLayouts} from "../Customizations/AllKnownLayouts";
|
||||
import SelectedElementTagsUpdater from "../Logic/Actors/SelectedElementTagsUpdater";
|
||||
import UserRelatedState from "../Logic/State/UserRelatedState";
|
||||
import {Utils} from "../Utils";
|
||||
|
@ -7,6 +6,8 @@ import SelectedFeatureHandler from "../Logic/Actors/SelectedFeatureHandler";
|
|||
import {UIEventSource} from "../Logic/UIEventSource";
|
||||
import {ElementStorage} from "../Logic/ElementStorage";
|
||||
import Loc from "../Models/Loc";
|
||||
import * as bookcaseJson from "../assets/themes/bookcases/bookcases.json"
|
||||
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig";
|
||||
|
||||
export default class ActorsSpec extends T {
|
||||
|
||||
|
@ -52,7 +53,7 @@ export default class ActorsSpec extends T {
|
|||
[
|
||||
"download latest version",
|
||||
() => {
|
||||
const state = new UserRelatedState(AllKnownLayouts.allKnownLayouts.get("bookcases"))
|
||||
const state = new UserRelatedState(new LayoutConfig(bookcaseJson, true, "tests" ))
|
||||
const feature = {
|
||||
"type": "Feature",
|
||||
"id": "node/5568693115",
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import T from "./TestHelper";
|
||||
import LegacyJsonConvert from "../Models/ThemeConfig/LegacyJsonConvert";
|
||||
import {FixLegacyTheme} from "../Models/ThemeConfig/LegacyJsonConvert";
|
||||
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig";
|
||||
import {LayerConfigJson} from "../Models/ThemeConfig/Json/LayerConfigJson";
|
||||
import {TagRenderingConfigJson} from "../Models/ThemeConfig/Json/TagRenderingConfigJson";
|
||||
|
||||
export default class LegacyThemeLoaderSpec extends T {
|
||||
|
||||
|
@ -145,9 +147,12 @@ export default class LegacyThemeLoaderSpec extends T {
|
|||
["Walking_node_theme", () => {
|
||||
|
||||
const config = LegacyThemeLoaderSpec.walking_node_theme
|
||||
LegacyJsonConvert.fixThemeConfig(config)
|
||||
// @ts-ignore
|
||||
const theme = new LayoutConfig(config)
|
||||
const fixed = new FixLegacyTheme().convert({tagRenderings: new Map<string, TagRenderingConfigJson>(), sharedLayers: new Map<string, LayerConfigJson>()},
|
||||
// @ts-ignore
|
||||
config,
|
||||
"While testing")
|
||||
T.isTrue(fixed.errors.length === 0, "Could not fix the legacy theme")
|
||||
const theme = new LayoutConfig(fixed.result)
|
||||
|
||||
}]
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue