mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-15 15:52:21 +00:00
refactor(cyclones): drop defensive shared-context state and checks
This commit is contained in:
1 parent
5e64e599e1
commit
5bab5ec26d
3 files changed
+10
-32
No files matched your search
@@ -488,12 +488,7 @@ test('shared cyclone context distinguishes switches, deliberate clears and feed
|
||||
assert.equal(store.entities.size, 0);
|
||||
|
||||
h.layer.setParams({ stormId: 'ep152026' });
|
||||
const record = store.entities.get('cyclone:ep152026');
|
||||
assert.equal(record.layerId, 'weather-cyclones');
|
||||
assert.equal(record.source, 'NOAA NHC / CPHC');
|
||||
assert.equal(record.label, 'Fifteen-E');
|
||||
assert.equal(record.latitude, 15.5);
|
||||
assert.equal(record.longitude, -125.8);
|
||||
assert.equal(store.entities.get('cyclone:ep152026').label, 'Fifteen-E');
|
||||
let properties = await selectedProperties();
|
||||
assert.equal(properties.classification, 'PTC');
|
||||
assert.equal(properties.classificationName, 'Post-tropical cyclone');
|
||||
@@ -652,24 +647,11 @@ test('cyclone clears leave another layer selection and its records alone', async
|
||||
'no clear is reported for a foreign selection',
|
||||
);
|
||||
|
||||
// A cyclone clear does not report a dangling foreign selection as evicted.
|
||||
store.entities.delete('flight:abc123');
|
||||
h.layer.disable();
|
||||
assert.equal(store.selectedEntityId, 'flight:abc123');
|
||||
assert.equal(events.length, before);
|
||||
|
||||
// A cyclone feed failure does not evict a dangling foreign selection.
|
||||
store.entities.delete('flight:abc123');
|
||||
let fail = false;
|
||||
const other = open({
|
||||
getSnapshot: async () => {
|
||||
if (fail) throw new Error('Network unavailable');
|
||||
return snapshot();
|
||||
},
|
||||
});
|
||||
other.layer.enable();
|
||||
await other.layer.update();
|
||||
fail = true;
|
||||
await other.layer.update();
|
||||
assert.equal(events.length, before);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user