mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
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:
1 parent
8366803c32
commit
34647758fc
5 files changed
+177
-4
No files matched your search
@@ -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 };
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user