Fetch place details from OSM API, support relations

* Much faster
* Has more place details, which allows us to locate relations, in
  addition to nodes and ways
This commit is contained in:
2026-02-20 12:34:48 +04:00
parent bcf8ca4255
commit 2aa59f9384
5 changed files with 242 additions and 5 deletions

View File

@@ -25,6 +25,16 @@ class MockOsmService extends Service {
osmType: 'node',
};
}
async fetchOsmObject(id, type) {
return {
osmId: id,
osmType: type,
lat: 1,
lon: 1,
osmTags: { name: 'Test Place', amenity: 'cafe' },
title: 'Test Place',
};
}
}
class MockStorageService extends Service {
@@ -82,7 +92,6 @@ module('Acceptance | navigation', function (hooks) {
// Click the Close (X) button
await click('.close-btn');
assert.strictEqual(currentURL(), '/', 'Returned to index');
assert.false(mapUi.returnToSearch, 'Flag is reset after closing sidebar');
@@ -95,7 +104,6 @@ module('Acceptance | navigation', function (hooks) {
assert.ok(currentURL().includes('/place/'), 'Visited place directly');
await click('.back-btn');
assert.strictEqual(currentURL(), '/', 'Returned to index/map');
assert.true(backStub.notCalled, 'window.history.back() was NOT called');