Fix tests
This commit is contained in:
parent
1c99173f32
commit
1276c62e69
2 changed files with 9 additions and 13 deletions
|
@ -253,7 +253,6 @@ class ClosestNObjectFunc implements ExtraFunction {
|
||||||
const maxFeatures = options?.maxFeatures ?? 1
|
const maxFeatures = options?.maxFeatures ?? 1
|
||||||
const maxDistance = options?.maxDistance ?? 500
|
const maxDistance = options?.maxDistance ?? 500
|
||||||
const uniqueTag: string | undefined = options?.uniqueTag
|
const uniqueTag: string | undefined = options?.uniqueTag
|
||||||
console.log("Calculating 'closestn' features")
|
|
||||||
let allFeatures: Feature[][]
|
let allFeatures: Feature[][]
|
||||||
if (typeof features === "string") {
|
if (typeof features === "string") {
|
||||||
const name = features
|
const name = features
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
import { LayerConfigJson } from "../../../../Models/ThemeConfig/Json/LayerConfigJson"
|
import {LayerConfigJson} from "../../../../Models/ThemeConfig/Json/LayerConfigJson"
|
||||||
import { TagRenderingConfigJson } from "../../../../Models/ThemeConfig/Json/TagRenderingConfigJson"
|
import {TagRenderingConfigJson} from "../../../../Models/ThemeConfig/Json/TagRenderingConfigJson"
|
||||||
import LineRenderingConfigJson from "../../../../Models/ThemeConfig/Json/LineRenderingConfigJson"
|
import LineRenderingConfigJson from "../../../../Models/ThemeConfig/Json/LineRenderingConfigJson"
|
||||||
|
import {ExpandRewrite, PrepareLayer, RewriteSpecial,} from "../../../../Models/ThemeConfig/Conversion/PrepareLayer"
|
||||||
import {
|
import {
|
||||||
ExpandRewrite,
|
QuestionableTagRenderingConfigJson
|
||||||
PrepareLayer,
|
} from "../../../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson"
|
||||||
RewriteSpecial,
|
|
||||||
} from "../../../../Models/ThemeConfig/Conversion/PrepareLayer"
|
|
||||||
import { QuestionableTagRenderingConfigJson } from "../../../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson"
|
|
||||||
import RewritableConfigJson from "../../../../Models/ThemeConfig/Json/RewritableConfigJson"
|
import RewritableConfigJson from "../../../../Models/ThemeConfig/Json/RewritableConfigJson"
|
||||||
import { describe, expect, it } from "vitest"
|
import {describe, expect, it} from "vitest"
|
||||||
|
|
||||||
describe("ExpandRewrite", () => {
|
describe("ExpandRewrite", () => {
|
||||||
it("should not allow overlapping keys", () => {
|
it("should not allow overlapping keys", () => {
|
||||||
|
@ -67,7 +65,7 @@ describe("PrepareLayer", () => {
|
||||||
|
|
||||||
const expected = {
|
const expected = {
|
||||||
id: "testlayer",
|
id: "testlayer",
|
||||||
source: { osmTags: "key=value" },
|
source: {osmTags: "key=value"},
|
||||||
mapRendering: [
|
mapRendering: [
|
||||||
{
|
{
|
||||||
color: {
|
color: {
|
||||||
|
@ -102,7 +100,7 @@ describe("PrepareLayer", () => {
|
||||||
offset: 6,
|
offset: 6,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
titleIcons: [{ render: "icons.defaults", id: "iconsdefaults" }],
|
titleIcons: [{render: "icons.defaults", id: "iconsdefaults"}],
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(result).toEqual(expected)
|
expect(result).toEqual(expected)
|
||||||
|
@ -120,7 +118,6 @@ describe("RewriteSpecial", function () {
|
||||||
tags: "urpn_count=$urpn_count;ref:GB:uprn=$ref:GB:uprn$",
|
tags: "urpn_count=$urpn_count;ref:GB:uprn=$ref:GB:uprn$",
|
||||||
text: "Add this address",
|
text: "Add this address",
|
||||||
icon: "./assets/themes/uk_addresses/housenumber_add.svg",
|
icon: "./assets/themes/uk_addresses/housenumber_add.svg",
|
||||||
location_picker: "none",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -128,7 +125,7 @@ describe("RewriteSpecial", function () {
|
||||||
expect(r).toEqual({
|
expect(r).toEqual({
|
||||||
id: "uk_addresses_import_button",
|
id: "uk_addresses_import_button",
|
||||||
render: {
|
render: {
|
||||||
"*": "{import_button(address,urpn_count=$urpn_count;ref:GB:uprn=$ref:GB:uprn$,Add this address,./assets/themes/uk_addresses/housenumber_add.svg,,,,none,)}",
|
"*": "{import_button(address,urpn_count=$urpn_count;ref:GB:uprn=$ref:GB:uprn$,Add this address,./assets/themes/uk_addresses/housenumber_add.svg,,,,)}",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue