test(osm): cover the place-search client and the follow-up handoff

From review:
- The browser client for /api/osm/features gets its own tests (request
  shape, abort, network failure, coded refusals), and a 200 whose body is
  not JSON is now a failure instead of zero places.
- An end-to-end test runs resolve_area, osm_query and an analyst follow-up
  through the real runner and checks the follow-up keeps the area; it fails
  with the wiring reverted.
- The Realtime token test pins Overpass off and compares the full tool
  schemas again instead of names taken from the environment.
This commit is contained in:
Manjunath committed 2026-11-03 19:36:40 +05:30
1 parent 8366803c32
commit 34647758fc
5 files changed
+177 -4

No files matched your search

+8
View File
@@ -49,6 +49,14 @@ export function createOsmFeatureSource({
error:
body?.error || `OpenStreetMap search failed (${response.status}).`,
};
// A garbled success (a proxy's error page) is a failure, not zero places.
if (!body || typeof body !== 'object')
return {
ok: false,
status: response.status,
code: null,
error: 'OpenStreetMap search returned an unreadable answer.',
};
return { ok: true, ...body };
};
}