Review fixes for Starblink, Island Wi-Fi and late joiners
Some checks failed
CI / plan (push) Has been cancelled
CI / build (push) Has been cancelled
CI / translations (push) Has been cancelled
Container image / gate (push) Has been cancelled
CI / part (push) Has been cancelled
CI / test (push) Has been cancelled
CI / timings (push) Has been cancelled
Container image / test (push) Has been cancelled
Container image / publish (push) Has been cancelled

- Until a zone's first circuit or spur is up, its row and panel say when the islands come online instead of homes out of 0 and a red 0% served (wisp-commissioning-homes-of-zero).
- Once your own constellation flies, a zone's Starblink row points to GEO, MEO or a spur (wisp.leo_no_rivals), never to a pie dish (zone-leo-pie-dish-advice).
- The late joiner's welcome and bank note say the match is on home broadband, not island Wi-Fi, in all six languages (late-match-island-homes).
- A gateway's section shows its city's transit ports (Transit out of the city) and warns when they fill; the fiber row only where there is fiber (leo-backhaul-transit-only).
- Spurs are subsea cable, no longer unrepeatered, in every language and the catalog comment (spur-unrepeatered-1400km).
- French calls a spur a câble de dérivation, not a câble d'antenne (fr-spur-cable-antenna).
This commit is contained in:
jvanvik 2026-11-12 03:31:08 +01:00
parent 5ca8270db9
commit 41e6fd78ef
14 changed files with 178 additions and 50 deletions

View file

@ -119,6 +119,83 @@ test('moving to MEO: tracking antennas first, then the old circuit carries until
assert.deepEqual(errors, []);
});
// Before anything reaches the islands, nobody is online yet: the zone says when they will be, not "0.0 Gbps of homes"
// in red. The upkeep is paid from the order on, so it stays.
test('while its first circuit or spur is commissioned, a zone says when the islands come online, with no red 0% served', (t) => {
const { ev, errors } = game(t, SUV + VL);
const text = () => ev("document.getElementById('panel').textContent");
const sec = () => ev("[...document.querySelectorAll('#panel section')].filter(s=>/Island Wi-Fi/.test(s.querySelector('h3').textContent)).map(s=>s.innerHTML).join('')");
const show = "UI.sel={type:'city',id:'suv'};UI.tab='cust';UI.wz='vanualevu';renderAll()";
const pending = (n) => {
const p = text();
assert.doesNotMatch(p, /Homes online|Served on the islands|% served|of 0\.0 Gbps|\$0\/mo/, 'nobody online yet');
assert.match(p, new RegExp(`Coming up[^]*ready in ${n}d[^]*The islands come online in ${n} days?`));
assert.match(p, /Towers, solar and crews/, 'the upkeep is paid from the order on');
assert.doesNotMatch(sec(), /--tx-red|--bad/);
};
ev(show);
const n = ev(`${Z}.sat.ready-S.day`);
assert.ok(n >= 1, 'GEO takes days to point: ' + n);
pending(n);
ev(ready + ';' + show);
assert.match(text(), /Homes online[^]*Served on the islands[^]*Revenue/);
assert.match(text(), /\d+% served/);
assert.doesNotMatch(text(), /come online in/);
// A spur alone takes weeks (months outside Change Freeze): the same, day after day, until it is lit.
ev("ACT.wispRm({z:'vanualevu'});ACT.wispRm({z:'vanualevu'});ACT.wispSpur({z:'vanualevu'});" + show);
const m = ev(`${Z}.sp.ready-S.day`);
assert.ok(m > 2, 'a spur takes weeks: ' + m);
pending(m);
days(ev, 1);
ev(show);
pending(m - 1);
// A circuit ordered beside it comes up first: the sooner of the two.
ev(VL + show);
pending(ev(`${Z}.sat.ready-S.day`));
// A zone whose circuit was cancelled before it came up: no link, no homes rows and no date.
ev("ACT.wispRm({z:'vanualevu'});ACT.wispRm({z:'vanualevu'});" + VL + "ACT.wispSatRm({z:'vanualevu'});ACT.wispSatRm({z:'vanualevu'});" + show);
assert.equal(ev(`!!${Z}&&!${Z}.sat`), true);
assert.match(text(), /No link yet/);
assert.doesNotMatch(text(), /Homes online|% served|come online in/);
assert.deepEqual(errors, []);
});
// The islands have no pie dish of their own (a zone is no city): once your crust flies, a zone's Starblink row says what
// is left for them, with or without a gateway in its city; a city's own gateway row keeps its pie dish advice.
test('once your own constellation flies, a zone\'s Starblink row points to GEO, MEO or a spur, never to a pie dish', (t) => {
const { ev, errors } = game(t, 'S.lvl=5;' + SUV + "ACT.teleLeo({city:'suv'});S.pieV=1;pieInit();S.pie.crusts.short.cohorts=[{n:CRUSTS.short.full,day:S.day,las:false}];compute();");
assert.equal(ev('leoRival()'), true);
const row = () => { ev("UI.sel={type:'city',id:'suv'};UI.tab='cust';UI.wz='vanualevu';renderAll()"); return ev("[...document.querySelectorAll('#panel .wisp .row')].map(r=>r.textContent).find(t=>/Starblink/.test(t))||''"); };
for (const gw of [true, false]) {
if (!gw) ev("delete S.pops.suv.leo;compute()");
assert.equal(ev("leoGw('suv')"), gw);
const why = ev("wispSatWhy('vanualevu','sb53',5)");
assert.match(why, /rival constellation/, 'gateway ' + gw);
assert.doesNotMatch(why, /pie dish/, 'gateway ' + gw);
const r = row();
assert.match(r, /rival constellation[^]*GEO or MEO capacity, or a spur cable/, 'gateway ' + gw);
assert.doesNotMatch(r, /pie dish/, 'gateway ' + gw);
}
assert.ok(!J(ev, "[...document.querySelectorAll('#panel .wisp [data-act]')].filter(b=>!b.disabled).map(b=>b.dataset.act)").includes('teleLeo'), 'no gateway to host');
assert.match(ev("leoGwWhy('suv')"), /pie dish/, 'a city\'s own gateway keeps its advice');
assert.deepEqual(errors, []);
});
// Real unrepeatered cables stop at a few hundred km; a spur here runs up to 1,400 km. And in French a "câble d'antenne"
// next to towers and radios is the towers' coax, not a branch cable under the sea.
test('the spur in words: no "unrepeatered" for cables up to 1,400 km in any language, and a branch cable in French', (t) => {
const { ev } = game(t);
assert.ok(ev('Math.max(...Object.values(WISP).map(W=>W.km))') > 650, 'spurs longer than any unrepeatered cable');
const dict = (f) => fs.readFileSync(path.join(__dirname, '..', f), 'utf8').split('\n');
for (const f of ['src/i18n/en.js', ...['de', 'es', 'fr', 'it', 'pt'].map((l) => `site/i18n/${l}.js`)]) {
const s = dict(f).find((l) => l.startsWith('"wisp.spur_lead":'));
assert.ok(s, f);
assert.doesNotMatch(s, /repeat|répét|repetid|ripetit/i, f);
}
assert.deepEqual(dict('site/i18n/fr.js').filter((l) => /^"wisp\./.test(l) && /câbles? d.antenne/.test(l)), []);
assert.match(dict('site/i18n/fr.js').find((l) => l.startsWith('"wisp.spur":')), /dérivation/);
});
test('the spur: level 3, never where one cannot be laid, the price of the day; lit, everyone signs up and the satellite stands by', (t) => {
const { ev, errors } = game(t, SUV + VL + "ACT.buildPop({city:'yfb'});");
ev('S.lvl=2');