mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
fix: tighten tool answers found in local testing
Unknown aircraft tracks read as empty instead of a server error, aircraft info names the aircraft and flight, the HUD caption sends the app's caption context, and satellite pass, satellites overhead and nearby places take a place name or point like the other tools.
This commit is contained in:
1 parent
1a03e7483d
commit
ec1adbdc19
9 files changed
+119
-64
No files matched your search
@@ -215,6 +215,30 @@ test('tracks are ordered and thinned to 200 points', async () => {
|
||||
(await empty.call('get_aircraft_track', { icao24: 'aaa111' })).summary,
|
||||
'No recent track is available for aaa111.',
|
||||
);
|
||||
const failing = (status) => ({
|
||||
getSnapshot: async () => snapshot([]),
|
||||
getTrack: async () => {
|
||||
throw new LiveSourceError('unavailable', `OpenSky HTTP ${status}`, {
|
||||
status,
|
||||
});
|
||||
},
|
||||
});
|
||||
const unknown = composeCatalog({
|
||||
tools: coreTools,
|
||||
services: { aircraft: failing(404) },
|
||||
});
|
||||
assert.equal(
|
||||
(await unknown.call('get_aircraft_track', { icao24: 'abcdef' })).summary,
|
||||
'No recent track is available for abcdef.',
|
||||
);
|
||||
const down = composeCatalog({
|
||||
tools: coreTools,
|
||||
services: { aircraft: failing(502) },
|
||||
});
|
||||
await assert.rejects(
|
||||
down.call('get_aircraft_track', { icao24: 'abcdef' }),
|
||||
(error) => error.code === 'unavailable',
|
||||
);
|
||||
});
|
||||
|
||||
test('aircraft info combines type and route lookups', async () => {
|
||||
@@ -241,7 +265,7 @@ test('aircraft info combines type and route lookups', async () => {
|
||||
});
|
||||
assert.equal(
|
||||
both.summary,
|
||||
'Aaa111 is Boeing 737-800 (N12345); UAL123 flies SFO to EWR (United Airlines).',
|
||||
'Aircraft aaa111 is Boeing 737-800 (N12345); flight UAL123 flies SFO to EWR (United Airlines).',
|
||||
);
|
||||
assert.equal(both.data.route.destination.name, 'Newark');
|
||||
const unknown = await catalog.call('get_aircraft_info', { callsign: 'XYZ9' });
|
||||
|
||||
Reference in new issue
Block a user