Add filters
This commit is contained in:
parent
965faca0e5
commit
42a6b37ca6
13 changed files with 287 additions and 219 deletions
|
@ -1,12 +1,8 @@
|
|||
import T from "./TestHelper";
|
||||
import {Utils} from "../Utils";
|
||||
import ReplaceGeometryAction from "../Logic/Osm/Actions/ReplaceGeometryAction";
|
||||
import FeaturePipeline from "../Logic/FeatureSource/FeaturePipeline";
|
||||
import {Tag} from "../Logic/Tags/Tag";
|
||||
import MapState from "../Logic/State/MapState";
|
||||
import * as grb from "../assets/themes/grb_import/grb.json"
|
||||
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig";
|
||||
import {AllKnownLayouts} from "../Customizations/AllKnownLayouts";
|
||||
import State from "../State";
|
||||
import {BBox} from "../Logic/BBox";
|
||||
import Minimap from "../UI/Base/Minimap";
|
||||
|
@ -33,7 +29,11 @@ export default class ReplaceGeometrySpec extends T {
|
|||
},
|
||||
"layers": [
|
||||
{
|
||||
"builtin": "type_node",
|
||||
"id": "type_node",
|
||||
source:{
|
||||
osmTags:"type=node"
|
||||
},
|
||||
mapRendering: null,
|
||||
"override": {
|
||||
"calculatedTags": [
|
||||
"_is_part_of_building=feat.get('parent_ways')?.some(p => p.building !== undefined && p.building !== '') ?? false",
|
||||
|
@ -266,7 +266,6 @@ export default class ReplaceGeometrySpec extends T {
|
|||
}
|
||||
]
|
||||
},
|
||||
"address",
|
||||
{
|
||||
"id": "grb",
|
||||
"description": "Geometry which comes from GRB with tools to import them",
|
||||
|
|
|
@ -516,7 +516,14 @@ export default class TagSpec extends T {
|
|||
const filter = TagUtils.Tag("_key~*")
|
||||
T.isTrue(filter.matchesProperties(properties), "Lazy value not matched")
|
||||
}
|
||||
]]);
|
||||
],
|
||||
["test date comparison",() => {
|
||||
|
||||
const filter = TagUtils.Tag("date_created<2022-01-07")
|
||||
T.isFalse(filter.matchesProperties({"date_created":"2022-01-08"}), "Date comparison: expected a match")
|
||||
T.isTrue(filter.matchesProperties({"date_created":"2022-01-01"}), "Date comparison: didn't expect a match")
|
||||
|
||||
}]]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue