This commit is contained in:
Andras Schmelczer 2026-05-12 08:05:29 +01:00
parent a9e5a8ad96
commit 8708bf000d
45 changed files with 434 additions and 436 deletions

View file

@ -138,7 +138,7 @@ describe('api utilities', () => {
).toBe('% White:20:80');
});
it('serializes POI distance filters using their selected backend feature', () => {
it('serializes amenity distance filters using their selected backend feature', () => {
const features: FeatureMeta[] = [
{ name: 'Distance to nearest park (km)', type: 'numeric', min: 0, max: 2 },
{ name: 'Distance to nearest Tesco (km)', type: 'numeric', min: 0, max: 5 },
@ -155,20 +155,22 @@ describe('api utilities', () => {
).toBe('Distance to nearest park (km):0:0.5;;Distance to nearest Tesco (km):0:1');
});
it('serializes POI count filters using their selected backend feature', () => {
it('serializes amenity count filters using their selected backend feature', () => {
const features: FeatureMeta[] = [
{ name: 'Number of Cafe POIs within 2km', type: 'numeric', min: 0, max: 20 },
{ name: 'Number of amenities (Cafe) within 2km', type: 'numeric', min: 0, max: 20 },
];
expect(
buildFilterString(
{
[createPoiFilterKey(POI_COUNT_2KM_FILTER_NAME, 'Number of Cafe POIs within 2km', 1)]: [
2, 10,
],
[createPoiFilterKey(
POI_COUNT_2KM_FILTER_NAME,
'Number of amenities (Cafe) within 2km',
1
)]: [2, 10],
},
features
)
).toBe('Number of Cafe POIs within 2km:2:10');
).toBe('Number of amenities (Cafe) within 2km:2:10');
});
});