test(places): pin the pack build-date rule and a nearer village beating a namesake inside a wide search

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-18 22:54:53 -08:00
1 parent 75e345aa07
commit 50824c9a65
4 files changed
+66 -19

No files matched your search

+11
View File
@@ -115,6 +115,17 @@ test('a small place in view comes before a far bigger city of its name', async (
const austin = { latitude: 30.27, longitude: -97.74 };
assert.equal((await find('Paris', austin)).wikidata, 'Q-village');
assert.ok((await find('Paris', austin)).distanceKm < 20);
// A bigger namesake inside a wider search: the nearer village still wins.
assert.equal(
(
await module.findPlace(
'Paris',
{ near: austin, radiusKm: 600, includeSmallPlaces: true },
fetchImpl,
)
).wikidata,
'Q-village',
);
// Only when small places are asked for.
assert.equal(
(await module.findPlace('Paris', { near: austin }, fetchImpl)).wikidata,