Fix tests

This commit is contained in:
Pieter Vander Vennet 2023-01-22 01:09:16 +01:00
parent 888d4e95a3
commit 321568abe6
4 changed files with 12 additions and 18 deletions

View file

@ -136,7 +136,7 @@ export default class FeaturePipeline {
// Passthrough to passed function, except that it registers as well
handleFeatureSource(src)
src.features.addCallbackAndRunD((fs) => {
fs.forEach((ff) => state.allElements.addOrGetElement(ff.feature))
fs.forEach((ff) => state.allElements.addOrGetElement(<any>ff.feature))
})
}

14
package-lock.json generated
View file

@ -34,7 +34,7 @@
"leaflet-simple-map-screenshoter": "^0.4.5",
"libphonenumber-js": "^1.10.8",
"lz-string": "^1.4.4",
"mangrove-reviews-typescript": "^0.0.6",
"mangrove-reviews-typescript": "^1.1.0",
"opening_hours": "^3.6.0",
"osm-auth": "^1.0.2",
"osmtogeojson": "^3.0.0-beta.5",
@ -6880,9 +6880,9 @@
"devOptional": true
},
"node_modules/mangrove-reviews-typescript": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/mangrove-reviews-typescript/-/mangrove-reviews-typescript-0.0.6.tgz",
"integrity": "sha512-31wF20PdaKUhxP5lek7YouF50QbNk4U571I86e0lG5U/khP96wbVToZB2P4Anb0OPoQ2alHfpqJPuc491ptw2Q==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/mangrove-reviews-typescript/-/mangrove-reviews-typescript-1.1.0.tgz",
"integrity": "sha512-gkN/vKW5uwnEOOyg8W9mxL7e4oCaSbtl/O4zs758t+S6SiIe6hO+l+SnauuXrtaH26agfL48KW4uLxwd2zcxfA==",
"dependencies": {
"axios": "^1.2.3",
"jose": "^4.11.2",
@ -15713,9 +15713,9 @@
"devOptional": true
},
"mangrove-reviews-typescript": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/mangrove-reviews-typescript/-/mangrove-reviews-typescript-0.0.6.tgz",
"integrity": "sha512-31wF20PdaKUhxP5lek7YouF50QbNk4U571I86e0lG5U/khP96wbVToZB2P4Anb0OPoQ2alHfpqJPuc491ptw2Q==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/mangrove-reviews-typescript/-/mangrove-reviews-typescript-1.1.0.tgz",
"integrity": "sha512-gkN/vKW5uwnEOOyg8W9mxL7e4oCaSbtl/O4zs758t+S6SiIe6hO+l+SnauuXrtaH26agfL48KW4uLxwd2zcxfA==",
"requires": {
"axios": "^1.2.3",
"jose": "^4.11.2",

View file

@ -89,7 +89,7 @@
"leaflet-simple-map-screenshoter": "^0.4.5",
"libphonenumber-js": "^1.10.8",
"lz-string": "^1.4.4",
"mangrove-reviews-typescript": "^0.0.6",
"mangrove-reviews-typescript": "^1.1.0",
"opening_hours": "^3.6.0",
"osm-auth": "^1.0.2",
"osmtogeojson": "^3.0.0-beta.5",

View file

@ -9,6 +9,8 @@ import { UIEventSource } from "../../../Logic/UIEventSource"
import Loc from "../../../Models/Loc"
import SelectedFeatureHandler from "../../../Logic/Actors/SelectedFeatureHandler"
import { ElementStorage } from "../../../Logic/ElementStorage"
import { OsmTags } from "../../../Models/OsmFeature"
import { Feature, Geometry } from "geojson"
const latestTags = {
amenity: "public_bookcase",
@ -47,7 +49,7 @@ Utils.injectJsonDownloadForTests("https://www.openstreetmap.org/api/0.6/node/556
it("should download the latest version", () => {
const state = new UserRelatedState(new LayoutConfig(<any>bookcaseJson, true))
const feature = {
const feature: Feature<Geometry, OsmTags> = {
type: "Feature",
id: "node/5568693115",
properties: {
@ -70,14 +72,6 @@ it("should download the latest version", () => {
type: "Point",
coordinates: [3.2154662, 51.2179199],
},
bbox: {
maxLat: 51.2179199,
maxLon: 3.2154662,
minLat: 51.2179199,
minLon: 3.2154662,
},
_lon: 3.2154662,
_lat: 51.2179199,
}
state.allElements.addOrGetElement(feature)
SelectedElementTagsUpdater.installCallback(state)