mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
refactor: separate map feature queries and source records
This commit is contained in:
1 parent
a8125ad917
commit
bf1d50f29b
28 files changed
+1128
-675
No files matched your search
@@ -57,3 +57,30 @@ test('installation response parsing respects cancellation before any follow-on s
|
||||
{ name: 'AbortError' },
|
||||
);
|
||||
});
|
||||
|
||||
test('mapped-site sources normalize records and derive saturation from legacy cache metadata', async () => {
|
||||
const source = createInstallationSource({
|
||||
fetchImpl: async () =>
|
||||
Response.json({
|
||||
elements: [
|
||||
{
|
||||
type: 'node',
|
||||
id: 1,
|
||||
lat: 30.2,
|
||||
lon: -97.7,
|
||||
tags: { military: 'airfield', name: 'Fixture Field' },
|
||||
},
|
||||
],
|
||||
elementCap: 1,
|
||||
status: 'stale',
|
||||
retrievedAt: '2026-01-01T00:00:00Z',
|
||||
}),
|
||||
});
|
||||
const payload = await source.getMappedSites(box);
|
||||
assert.equal(payload.records[0].name, 'Fixture Field');
|
||||
assert.equal(payload.records[0].latitude, 30.2);
|
||||
assert.equal(payload.records[0].retrievedAt, '2026-01-01T00:00:00Z');
|
||||
assert.equal(payload.saturated, true);
|
||||
assert.equal(payload.status, 'stale');
|
||||
assert.equal('elements' in payload, false);
|
||||
});
|
||||
Reference in new issue
Block a user