Refactoring of conversion
This commit is contained in:
parent
5dffb3c5e7
commit
7eeffc2305
12 changed files with 389 additions and 97 deletions
|
@ -357,10 +357,7 @@ export default class LegacyThemeLoaderSpec extends T {
|
|||
["Walking_node_theme", () => {
|
||||
|
||||
const config = LegacyThemeLoaderSpec.walking_node_theme
|
||||
const fixed = new FixLegacyTheme().convert({
|
||||
tagRenderings: new Map<string, TagRenderingConfigJson>(),
|
||||
sharedLayers: new Map<string, LayerConfigJson>()
|
||||
},
|
||||
const fixed = new FixLegacyTheme().convert(
|
||||
// @ts-ignore
|
||||
config,
|
||||
"While testing")
|
||||
|
@ -414,7 +411,7 @@ export default class LegacyThemeLoaderSpec extends T {
|
|||
}],
|
||||
["Shadowed mappings are detected",
|
||||
() => {
|
||||
const r = new DetectShadowedMappings().convert(undefined, {
|
||||
const r = new DetectShadowedMappings().convert({
|
||||
mappings: [
|
||||
{
|
||||
if: {or: ["key=value", "x=y"]},
|
||||
|
@ -428,7 +425,7 @@ export default class LegacyThemeLoaderSpec extends T {
|
|||
}, "test");
|
||||
T.isTrue(r.errors.length > 0, "Failing case is not detected")
|
||||
|
||||
const r0 = new DetectShadowedMappings().convert(undefined, {
|
||||
const r0 = new DetectShadowedMappings().convert( {
|
||||
mappings: [
|
||||
{
|
||||
if: {or: ["key=value", "x=y"]},
|
||||
|
|
|
@ -40,10 +40,10 @@ export default class ThemeSpec extends T {
|
|||
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({
|
||||
themeConfigJson = new PrepareTheme({
|
||||
tagRenderings: new Map<string, TagRenderingConfigJson>(),
|
||||
sharedLayers: sharedLayers
|
||||
}, themeConfigJson, "test")
|
||||
}).convertStrict( themeConfigJson, "test")
|
||||
const themeConfig = new LayoutConfig(themeConfigJson);
|
||||
assert.equal("xyz", themeConfig.layers[0].source.geojsonSource)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue