fix(cockpit): a place pack that will not load ends the loading batch failed; flags keep their neighbours out from under the border and out of a scaled flag's edge; a new ride asks again for a sheet that failed

This commit is contained in:
Sameh Khamis committed 2026-11-08 19:45:01 -08:00
1 parent 5a6cf22be1
commit e954734379
16 files changed
+198 -55

No files matched your search

+18 -4
View File
@@ -8,16 +8,30 @@ test('a place pack load is reported from its start to its end', async () => {
const place = await import('./placeBelow.js?loading-status');
const heard = [];
const stop = place.onPlacePacksLoadingChange(() =>
heard.push(place.placePacksLoading()),
heard.push(place.placePacksStatus().loading),
);
assert.equal(place.placePacksLoading(), false);
assert.equal(place.placePacksStatus().loading, false);
const lookup = place.nearPlace(48.86, 2.35, 50);
assert.equal(place.placePacksLoading(), true, 'on its way');
assert.equal(place.placePacksStatus().loading, true, 'on its way');
assert.equal(await lookup, 'Paris');
assert.equal(place.placePacksLoading(), false, 'loaded');
assert.equal(place.placePacksStatus().loading, false, 'loaded');
assert.deepEqual(heard, [true, false]);
// Loaded once: a later lookup is not reported again.
await place.nearPlace(48.86, 2.35, 50);
assert.deepEqual(heard, [true, false]);
stop();
});
test('a pack that would not load stays failed until it loads', async () => {
const place = await import('./placeBelow.js?failed-status');
let fail = true;
const load = place.reportedPlacePackLoad('test', async () => {
if (fail) throw new Error('offline');
return 1;
});
await assert.rejects(load(), /offline/);
assert.deepEqual(place.placePacksStatus(), { loading: false, failed: true });
fail = false;
assert.equal(await load(), 1);
assert.deepEqual(place.placePacksStatus(), { loading: false, failed: false });
});