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
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:
parent
5ca8270db9
commit
41e6fd78ef
14 changed files with 178 additions and 50 deletions
|
|
@ -198,6 +198,9 @@ test('a late network sees its head start on the Goals tab, in the bank and in a
|
|||
const bank = doc.getElementById('bankCard').textContent;
|
||||
assert.match(bank, /Late joiner's head start/);
|
||||
assert.match(bank, /Starting cash top-up\$37\.0k/);
|
||||
// The match is home broadband's: island homes on Wi-Fi pay island prices, never matched (lateMoney), and it says so.
|
||||
assert.match(bank, /The match is on what home broadband pays you after any wholesale cut, not on island Wi-Fi/);
|
||||
for (const k of ['late.hello', 'late.hello_flat']) assert.match(ev(`tr('${k}',{n:400,p:'5%',cash:'$1k'})`), /home broadband pays double: every dollar it pays you is matched \(island Wi-Fi is not\)/, k);
|
||||
assert.ok(bank.includes('until ' + ev('dateStr(S.day0+365)')));
|
||||
// The "since you started" lines measure from the network's own first day.
|
||||
assert.equal(ev('mktTxt()'), ev("tr('lifecycle.market_as_start')"));
|
||||
|
|
|
|||
|
|
@ -214,6 +214,28 @@ test('the gateway POP is the islands’ bottleneck: its fiber full, every island
|
|||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
// An island gateway whose only way out is a transit port (someone else's cable) is on your fiber all the same
|
||||
// (satWired): its section shows that port's load, not "0.0 Gbps / 0.0 Gbps" of fiber, and warns when it fills.
|
||||
test('a gateway out over transit only: the teleport section shows the transit port, and says when it is the bottleneck', (t) => {
|
||||
const { ev, errors } = game(t, "ACT.buildPop({city:'suv'});ACT.buyTransit({city:'suv',net:NETS.find(n=>sellsAt(n,'suv')).id,tier:0});ACT.teleBuild({city:'suv'});ACT.teleLeo({city:'suv'});ACT.wispSat({z:'vanualevu',bird:'sb53',g:10});");
|
||||
assert.equal(ev("S.links.some(l=>l.a==='suv'||l.b==='suv')"), false, 'no fiber, no cable of yours');
|
||||
assert.equal(ev("satWired('suv')"), true, 'a transit port is a way out');
|
||||
ev("S.day=wispZ('vanualevu').sat.ready;wispZ('vanualevu').d=6;compute()");
|
||||
const panel = () => { ev("UI.sel={type:'city',id:'suv'};UI.tab='links';renderAll()"); return ev("document.querySelector('#panel').textContent"); };
|
||||
let p = panel();
|
||||
assert.match(p, /Landing here from orbit6\.0 Gbps/);
|
||||
assert.doesNotMatch(p, /Fiber and cables out of Suva/, 'no fiber row without fiber');
|
||||
const tl = ev("S.transit.filter(t=>t.city==='suv').reduce((a,t)=>a+(R.useT[t.id]||0),0)");
|
||||
assert.ok(tl >= 6 - 1e-6, 'the islands leave over transit: ' + tl);
|
||||
assert.ok(p.includes(`Transit out of Suva${ev(`fmtG(${tl})`)} / ${ev('fmtG(10)')}`), 'the port\'s load and size');
|
||||
assert.doesNotMatch(p, /every island behind this gateway slows down/);
|
||||
// The port fills: the islands slow down with it, and the section says so.
|
||||
ev("ACT.launchBB({city:'suv'});closeModal();S.pops.suv.bb.d=8;compute()");
|
||||
assert.ok(ev("S.transit.filter(t=>t.city==='suv').reduce((a,t)=>a+(R.useT[t.id]||0),0)") >= 9.5);
|
||||
assert.match(panel(), /Suva is full: every island behind this gateway slows down/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('Pie in the Sky: once your crust carries, Starblink sells you nothing new; what you rent keeps running, on its own bill', (t) => {
|
||||
const { ev, errors } = game(t, GW + "ACT.buySat({a:'ccs',b:'cur',bird:'sb53',g:10});closeModal();ACT.launchBB({city:'cur'});closeModal();ACT.buildPop({city:'bog'});ACT.teleBuild({city:'bog'});");
|
||||
ev(ready);
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue