mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-22 06:56:35 +00:00
fix(tours): read e-bike chargers as mapped, keep unnamed ones on the map search
This commit is contained in:
@@ -105,6 +105,13 @@ describe('readBikeChargingInfo (BIK-07)', () => {
|
||||
expect(readBikeChargingInfo({ amenity: 'charging_station', bicycle: 'no' })).toBeNull();
|
||||
expect(readBikeChargingInfo({ bicycle: 'yes', 'socket:ccs': '2', 'socket:chademo': '1' })?.sockets).toEqual([]);
|
||||
});
|
||||
|
||||
it('MAPS-CHARGE-012: a plug mapped as none is left out, so the point reads as plug not stated', () => {
|
||||
expect(readBikeChargingInfo({ bicycle: 'yes', 'socket:schuko': 'no' })?.sockets).toEqual([]);
|
||||
expect(readBikeChargingInfo({ bicycle: 'yes', 'socket:type2': '0', 'socket:typee': '1' })?.sockets).toEqual([
|
||||
{ type: 'typee', count: 1, kw: null },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('OSM selectors (BIK-07)', () => {
|
||||
|
||||
@@ -1074,6 +1074,18 @@ describe('searchOverpassPois localized names (#1655)', () => {
|
||||
const { pois } = await osm.searchOverpassPois('sights', bbox(4), 'fr-FR');
|
||||
expect(pois[0].name).toBe('Obelisco della Minerva');
|
||||
});
|
||||
|
||||
it('keeps an unnamed e-bike charging point, as the search along a tour does (BIK-07)', async () => {
|
||||
stubOverpass({ amenity: 'charging_station', bicycle: 'yes', 'socket:schuko': '2' });
|
||||
const { pois } = await osm.searchOverpassPois('ebike_charging', bbox(6), 'en-US');
|
||||
expect(pois.map((p: any) => [p.name, p.category])).toEqual([['', 'ebike_charging']]);
|
||||
});
|
||||
|
||||
it('still drops an unnamed place of any other kind', async () => {
|
||||
stubOverpass({ tourism: 'attraction' });
|
||||
const { pois } = await osm.searchOverpassPois('sights', bbox(7), 'en-US');
|
||||
expect(pois).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
// ── fetchWikimediaPhoto (fetch stubbed) ───────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user