Standing orders: the intern's NOC notice is one shift report a week; the daily lines stay in the Ops sheet
This commit is contained in:
parent
e56659f949
commit
0788b98729
9 changed files with 78 additions and 16 deletions
|
|
@ -2616,7 +2616,7 @@
|
|||
"ops.per_pop_note":"Grüne Aufträge laufen in diesem POP. Schalte einen aus, um hier selbst zu entscheiden.",
|
||||
"ops.really_fire":"Wirklich entlassen?",
|
||||
"ops.salary":"Gehalt {price}/Monat · seit {d}",
|
||||
"ops.shift":"Schicht von {name}",
|
||||
"ops.shift_report":"{name}s Woche",
|
||||
"ops.spent_and_mo":"Diesen Monat: {price} einmalig, {mo}/Monat auf der Rechnung",
|
||||
"ops.standing_orders":"Daueraufträge",
|
||||
"ops.template":"Neuer POP aus der Vorlage",
|
||||
|
|
@ -2633,6 +2633,10 @@
|
|||
"ops.tracy":"Tracy",
|
||||
"ops.tracy_d":"Verfolgt jedes Paket Hop für Hop. Kommt am Ende an, mit ein, zwei Sternchen unterwegs.",
|
||||
"ops.tracy_route":"Tracy Route",
|
||||
"ops.w_line":"{name} {list}.",
|
||||
"ops.w_money":"Woche gesamt: {cost} einmalig, {mo}/Monat.",
|
||||
"ops.w_oops":{"one":"hat sich einmal kurz vertippt","other":"hat sich {n}-mal kurz vertippt"},
|
||||
"ops.w_sales":{"one":"hat einen Kunden gewonnen ({rev}/Monat)","other":"hat {n} Kunden gewonnen ({rev}/Monat)"},
|
||||
"optic_counts.apply_price":"Übernehmen · {price}",
|
||||
"optic_counts.count_for_model":"Anzahl der {model}-Kanäle",
|
||||
"optic_counts.only_n_channels_free":"Auf dieser Glasfaser sind nur {n} Kanäle frei.",
|
||||
|
|
|
|||
|
|
@ -2614,7 +2614,7 @@
|
|||
"ops.per_pop_note":"Las órdenes en verde se ejecutan en este POP. Apaga una para decidir aquí a mano.",
|
||||
"ops.really_fire":"¿Despedir de verdad?",
|
||||
"ops.salary":"Sueldo {price}/mes · desde {d}",
|
||||
"ops.shift":"Turno de {name}",
|
||||
"ops.shift_report":"La semana de {name}",
|
||||
"ops.spent_and_mo":"Este mes: {price} de entrada, {mo}/mes en la factura",
|
||||
"ops.standing_orders":"Órdenes permanentes",
|
||||
"ops.template":"POP nuevo desde plantilla",
|
||||
|
|
@ -2631,6 +2631,10 @@
|
|||
"ops.tracy":"Tracy",
|
||||
"ops.tracy_d":"Sigue cada paquete salto a salto. Al final llega, con alguna estrellita por el camino.",
|
||||
"ops.tracy_route":"Tracy Route",
|
||||
"ops.w_line":"{name} {list}.",
|
||||
"ops.w_money":"Total de la semana: {cost} de entrada, {mo}/mes.",
|
||||
"ops.w_oops":{"one":"tuvo un pequeño despiste","other":"tuvo {n} pequeños despistes"},
|
||||
"ops.w_sales":{"one":"firmó un cliente ({rev}/mes)","other":"firmó {n} clientes ({rev}/mes)"},
|
||||
"optic_counts.apply_price":"Aplicar · {price}",
|
||||
"optic_counts.count_for_model":"Número de canales {model}",
|
||||
"optic_counts.only_n_channels_free":"Solo quedan {n} canales libres en esta fibra.",
|
||||
|
|
|
|||
|
|
@ -2614,7 +2614,7 @@
|
|||
"ops.per_pop_note":"Les ordres en vert s'appliquent à ce POP. Désactive-en un pour décider ici à la main.",
|
||||
"ops.really_fire":"Vraiment remercier ?",
|
||||
"ops.salary":"Salaire {price}/mois · depuis {d}",
|
||||
"ops.shift":"Le service de {name}",
|
||||
"ops.shift_report":"La semaine de {name}",
|
||||
"ops.spent_and_mo":"Ce mois-ci : {price} d'entrée, {mo}/mois sur la facture",
|
||||
"ops.standing_orders":"Ordres permanents",
|
||||
"ops.template":"Nouveau POP depuis le modèle",
|
||||
|
|
@ -2631,6 +2631,10 @@
|
|||
"ops.tracy":"Tracy",
|
||||
"ops.tracy_d":"Suit chaque paquet saut par saut. Arrive au bout, avec une ou deux étoiles en chemin.",
|
||||
"ops.tracy_route":"Tracy Route",
|
||||
"ops.w_line":"{name} {list}.",
|
||||
"ops.w_money":"Total de la semaine : {cost} d'entrée, {mo}/mois.",
|
||||
"ops.w_oops":{"one":"a fait une petite bourde","other":"a fait {n} petites bourdes"},
|
||||
"ops.w_sales":{"one":"a signé un client ({rev}/mois)","other":"a signé {n} clients ({rev}/mois)"},
|
||||
"optic_counts.apply_price":"Appliquer · {price}",
|
||||
"optic_counts.count_for_model":"Nombre de canaux {model}",
|
||||
"optic_counts.only_n_channels_free":"Il ne reste que {n} canaux libres sur cette fibre.",
|
||||
|
|
|
|||
|
|
@ -2614,7 +2614,7 @@
|
|||
"ops.per_pop_note":"Gli ordini in verde valgono per questo POP. Spegnine uno per decidere qui a mano.",
|
||||
"ops.really_fire":"Licenziare davvero?",
|
||||
"ops.salary":"Stipendio {price}/mese · dal {d}",
|
||||
"ops.shift":"Il turno di {name}",
|
||||
"ops.shift_report":"La settimana di {name}",
|
||||
"ops.spent_and_mo":"Questo mese: {price} subito, {mo}/mese in bolletta",
|
||||
"ops.standing_orders":"Ordini permanenti",
|
||||
"ops.template":"Nuovo POP da modello",
|
||||
|
|
@ -2631,6 +2631,10 @@
|
|||
"ops.tracy":"Tracy",
|
||||
"ops.tracy_d":"Segue ogni pacchetto hop per hop. Alla fine arriva, con qualche asterisco per strada.",
|
||||
"ops.tracy_route":"Tracy Route",
|
||||
"ops.w_line":"{name} {list}.",
|
||||
"ops.w_money":"Totale della settimana: {cost} subito, {mo}/mese.",
|
||||
"ops.w_oops":{"one":"ha fatto un piccolo pasticcio","other":"ha fatto {n} piccoli pasticci"},
|
||||
"ops.w_sales":{"one":"ha firmato un cliente ({rev}/mese)","other":"ha firmato {n} clienti ({rev}/mese)"},
|
||||
"optic_counts.apply_price":"Applica · {price}",
|
||||
"optic_counts.count_for_model":"Numero di canali {model}",
|
||||
"optic_counts.only_n_channels_free":"Su questa fibra sono liberi solo {n} canali.",
|
||||
|
|
|
|||
|
|
@ -2614,7 +2614,7 @@
|
|||
"ops.per_pop_note":"As ordens em verde valem neste POP. Desligue uma para decidir aqui na mão.",
|
||||
"ops.really_fire":"Dispensar mesmo?",
|
||||
"ops.salary":"Salário {price}/mês · desde {d}",
|
||||
"ops.shift":"Turno de {name}",
|
||||
"ops.shift_report":"A semana de {name}",
|
||||
"ops.spent_and_mo":"Este mês: {price} de entrada, {mo}/mês na fatura",
|
||||
"ops.standing_orders":"Ordens permanentes",
|
||||
"ops.template":"Novo POP por modelo",
|
||||
|
|
@ -2631,6 +2631,10 @@
|
|||
"ops.tracy":"Tracy",
|
||||
"ops.tracy_d":"Segue cada pacote salto a salto. Chega no fim, com uma ou duas estrelinhas no caminho.",
|
||||
"ops.tracy_route":"Tracy Route",
|
||||
"ops.w_line":"{name} {list}.",
|
||||
"ops.w_money":"Total da semana: {cost} de entrada, {mo}/mês.",
|
||||
"ops.w_oops":{"one":"cometeu um pequeno deslize","other":"cometeu {n} pequenos deslizes"},
|
||||
"ops.w_sales":{"one":"assinou um cliente ({rev}/mês)","other":"assinou {n} clientes ({rev}/mês)"},
|
||||
"optic_counts.apply_price":"Aplicar · {price}",
|
||||
"optic_counts.count_for_model":"Número de canais {model}",
|
||||
"optic_counts.only_n_channels_free":"Só há {n} canais livres nesta fibra.",
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ const OPS_SAY={transit:N_('ops.l_transit'),routers:N_('ops.l_routers'),caches:N_
|
|||
// Fat fingers: rare, visible, harmless. Only the LAG one costs anything, and only a little.
|
||||
const OPS_FF=[N_('ops.ff_desc'),N_('ops.ff_hostname'),N_('ops.ff_typo'),N_('ops.ff_lag'),N_('ops.ff_ping')];
|
||||
const OPS_TRIALS=1,OPS_FF_RATE={oncall:1/150,bgp:1/60};
|
||||
function opsNew(){return {intern:null,hired:0,on:Object.fromEntries(OPS.map(o=>[o.k,false])),p:{},cap:{},spent:Object.fromEntries(OPS.filter(o=>o.cap).map(o=>[o.k,0])),addMo:{},mon:0,skip:{},log:[],floor:50000,tpl:{bb:true,transit:true,ix:true,kit:true}};}
|
||||
function opsNew(){return {intern:null,hired:0,on:Object.fromEntries(OPS.map(o=>[o.k,false])),p:{},cap:{},spent:Object.fromEntries(OPS.filter(o=>o.cap).map(o=>[o.k,0])),addMo:{},mon:0,skip:{},log:[],wk:null,rep:null,floor:50000,tpl:{bb:true,transit:true,ix:true,kit:true}};}
|
||||
const opsO=()=>S.ops||(S.ops=opsNew());
|
||||
const opsHired=()=>!!(S&&S.ops&&S.ops.intern&&own(INTERNS,S.ops.intern));
|
||||
const opsCanHire=()=>lvl()>=2;
|
||||
|
|
@ -52,6 +52,7 @@ function opsSanitize(s){const o=s.ops&&typeof s.ops==='object'&&!Array.isArray(s
|
|||
{const t=ob(o.tpl);for(const k of OPS_TPL)if(typeof t[k]==='boolean')n.tpl[k]=t[k];}
|
||||
{const sk=ob(o.skip);for(const c of Object.keys(sk))if(isCity(c)&&own(s.pops,c)&&Array.isArray(sk[c])){const ks=[...new Set(sk[c].filter(k=>OPS_POP.includes(k)))];if(ks.length)n.skip[c]=ks;}}
|
||||
if(Array.isArray(o.log))n.log=o.log.map(opsLogOk).filter(Boolean).slice(0,OPS_LOG);
|
||||
n.wk=opsWkOk(o.wk);n.rep=opsWkOk(o.rep);
|
||||
if(s.autoSales===true)n.on.sales=true;if(s.autoRepair===true)n.on.repair=true;delete s.autoSales;delete s.autoRepair;
|
||||
s.ops=n;}
|
||||
// A log entry: {d, i: intern, r: [[kind, n, [where…]]], f: fat-finger index, c: its city, up: paid up front, mo: running costs added}.
|
||||
|
|
@ -59,6 +60,17 @@ const opsWhereOk=w=>typeof w==='string'&&w.length<=48&&/^[a-z0-9~|]+( [+\w.×→
|
|||
function opsLogOk(e){if(!e||typeof e!=='object'||!own(INTERNS,e.i))return null;const r=Array.isArray(e.r)?e.r.filter(x=>Array.isArray(x)&&own(OPS_SAY,x[0])&&Array.isArray(x[2])).map(x=>[x[0],int(x[1],1,1e6,1),x[2].filter(opsWhereOk).slice(0,3)]).slice(0,16):[];
|
||||
const f=Number.isInteger(e.f)&&OPS_FF[e.f]?e.f:undefined,up=int(e.up,0,1e12,0),mo=int(e.mo,-1e9,1e9,0);
|
||||
return {d:int(e.d,0,1e7,0),i:e.i,r,...(f!==undefined&&isCity(e.c)?{f,c:e.c}:{}),...(up?{up}:{}),...(mo?{mo}:{})};}
|
||||
// A week's tally, for the shift report and the one NOC notice a week: {w: week, i: intern, n: {kind: count}, wh: {kind: [where…]}, up, mo, rev, ff}.
|
||||
function opsWkOk(x){if(!x||typeof x!=='object'||Array.isArray(x)||!own(INTERNS,x.i))return null;const n={},wh={},xn=x.n&&typeof x.n==='object'?x.n:{},xw=x.wh&&typeof x.wh==='object'?x.wh:{};
|
||||
for(const k of Object.keys(OPS_SAY)){if(own(xn,k)){const v=int(xn[k],0,1e6,0);if(v)n[k]=v;}if(own(xw,k)&&Array.isArray(xw[k])){const w=xw[k].filter(opsWhereOk).slice(0,3);if(w.length)wh[k]=w;}}
|
||||
return {w:int(x.w,0,1e6,0),i:x.i,n,wh,up:int(x.up,0,1e12,0),mo:int(x.mo,-1e9,1e9,0),rev:int(x.rev,0,1e9,0),ff:int(x.ff,0,7,0)};}
|
||||
const opsWkNew=w=>({w,i:S.ops.intern,n:{},wh:{},up:0,mo:0,rev:0,ff:0});
|
||||
const opsWkAny=x=>!!x&&(Object.keys(x.n).length>0||x.ff>0);
|
||||
// "Kevin's week: signed 3 customers (+$41k/mo), topped up transit 2 times (Frankfurt +1×100G), declined 17 tiny offers. Week total: …"
|
||||
function opsWeekLine(x){const I=INTERNS[x.i],name=I?tr(I.s):'',ks=Object.keys(x.n).sort((a,b)=>(a==='sales'?-1:b==='sales'?1:0)||(a==='broke')-(b==='broke'));
|
||||
const parts=ks.map(k=>k==='sales'?trn('ops.w_sales',x.n[k],{rev:opsMo$(x.rev)}):trn(OPS_SAY[k],x.n[k],{where:(x.wh[k]||[]).map(opsWhere).join(', ')}));
|
||||
if(x.ff)parts.push(trn('ops.w_oops',x.ff));
|
||||
return tr('ops.w_line',{name,list:parts.join(', ')})+(x.up||x.mo?' '+tr('ops.w_money',{cost:fmt$(x.up),mo:opsMo$(x.mo)}):'');}
|
||||
// "fra +1×100G", "fra|ams", "ams~3", "transit" (an order, for the budget line) or "ggl" (a network).
|
||||
function opsWhere(w){const [a,x]=w.split(' '),nm=a.split('|').map(p=>own(OPSK,p)?tr(OPSK[p].t):isCity(p)?CITY[p].name:isNet(p)?NET[p].name:ixName(p)).join('–');return x?nm+' '+(isNet(x)?NET[x].name:x):nm;}
|
||||
function opsLine(e){const I=INTERNS[e.i],name=I?tr(I.s):'',parts=e.r.map(([k,n,w])=>trn(OPS_SAY[k],n,{where:w.map(opsWhere).join(', ')}));
|
||||
|
|
@ -171,7 +183,9 @@ function opsDecomSafe(l){const bz=S.biz.filter(b=>(b.reqs||[]).some(k=>k==='dive
|
|||
const OPS_ORDER=['repair','sales','routers','transit','optics','caches','ix','pni','decom'];
|
||||
// The shift: once per game day from dayTick, after outages and events have had their turn.
|
||||
function opsDay(d){if(!opsHired())return;const O=S.ops,m=Math.floor(d/30);if(m!==O.mon){O.mon=m;for(const k in O.spent)O.spent[k]=0;O.addMo={};}
|
||||
const X=opsShift(),cash=S.cash;
|
||||
// A new week: last week's tally becomes the shift report, and the one NOC notice of the week.
|
||||
const w=Math.floor(d/7);if(!O.wk||O.wk.w!==w){if(opsWkAny(O.wk)&&O.wk.w<w){O.rep=O.wk;logNote(`<b>${esc(tr('ops.shift_report',{name:opsName()}))}</b> ${esc(opsWeekLine(O.rep))}`,O.rep.rev>0?'good':'',[],{a:'tab',v:'noc'});}O.wk=opsWkNew(w);}
|
||||
const X=opsShift();
|
||||
// One order that trips over something (an odd save, a bug) is paused and noted; payday, goals and the save still happen.
|
||||
opsQuiet(()=>{for(const k of OPS_ORDER)if(O.on[k])try{OPS_RUN[k](X);}catch(err){O.on[k]=false;X.dirty=true;X.did('snag',k);console.error('[tubes] standing order failed',k,err);}});
|
||||
const e={d,i:O.intern,r:[]};for(const [k,x] of X.r)e.r.push([k,x.n,x.w]);if(X.broke.size)e.r.push(['broke',X.broke.size,[...X.broke]]);
|
||||
|
|
@ -183,7 +197,9 @@ function opsDay(d){if(!opsHired())return;const O=S.ops,m=Math.floor(d/30);if(m!=
|
|||
// Declining an offer or stopping at a budget changes nothing a route depends on: no recompute for those.
|
||||
if(X.dirty)compute();
|
||||
if(e.r.length||e.f!==undefined){O.log.unshift(e);O.log.length=Math.min(O.log.length,OPS_LOG);}
|
||||
if(e.r.length||e.up||e.mo)logNote(`<b>${esc(tr('ops.shift',{name:opsName()}))}</b> ${esc(opsLine(e))}`,cash>S.cash?'':'good',[],{a:'tab',v:'noc'});}
|
||||
// The day's detail stays in the Ops sheet; the NOC gets one notice a week (above).
|
||||
const W=O.wk;for(const [k,n,ws] of e.r){W.n[k]=(W.n[k]||0)+n;const a=W.wh[k]||(W.wh[k]=[]);for(const x of ws)if(a.length<3&&!a.includes(x))a.push(x);}
|
||||
W.up+=e.up||0;W.mo+=e.mo||0;W.rev+=Math.round(X.rev);if(e.f!==undefined)W.ff=Math.min(7,W.ff+1);}
|
||||
// New POP from the template: price the whole bundle first, then click through it in one go.
|
||||
function opsTplQuote(c){if(!S||S.pops[c]||!cityOn(c)||(cnCity(c)&&!cnOk()))return null;const T=S.ops.tpl,parts=[];let cost=popCost(c),net=null,ix=null,kit=null;
|
||||
if(T.bb){cost+=bbCost(c);parts.push(tr('ops.tpl_bb'));}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
const opsCycle=(a,v)=>a[(a.indexOf(v)+1)%a.length];
|
||||
Object.assign(ACT,{
|
||||
opsOpen:()=>{if(S)opsModal();},
|
||||
opsHire:({id})=>{if(!S||opsHired()||!own(INTERNS,id)||!opsCanHire()||!rule('clock'))return;if(!spend(INTERN_MO))return;const O=opsO(),m=Math.floor(S.day/30);O.intern=id;O.hired=S.day;
|
||||
opsHire:({id})=>{if(!S||opsHired()||!own(INTERNS,id)||!opsCanHire()||!rule('clock'))return;if(!spend(INTERN_MO))return;const O=opsO(),m=Math.floor(S.day/30);O.intern=id;O.hired=S.day;O.wk=null;
|
||||
// A new hire starts on a fresh month's budget, whatever the last one spent.
|
||||
if(m!==O.mon){O.mon=m;for(const k in O.spent)O.spent[k]=0;O.addMo={};}
|
||||
O.log.unshift({d:S.day,i:id,r:[]});toast(esc(tr('ops.hired',{name:opsName(true)})),'good',[{l:tr('ops.ops'),act:'opsOpen',args:{}}]);after();opsModal();},
|
||||
|
|
|
|||
|
|
@ -2615,7 +2615,7 @@
|
|||
"ops.per_pop_note":"Green orders run in this POP. Switch one off to decide here by hand.",
|
||||
"ops.really_fire":"Really let go?",
|
||||
"ops.salary":"Salary {price}/mo · since {d}",
|
||||
"ops.shift":"{name}'s shift",
|
||||
"ops.shift_report":"{name}'s week",
|
||||
"ops.spent_and_mo":"This month: {price} up front, {mo}/mo on the bill",
|
||||
"ops.standing_orders":"Standing orders",
|
||||
"ops.template":"New POP from template",
|
||||
|
|
@ -2632,6 +2632,10 @@
|
|||
"ops.tracy":"Tracy",
|
||||
"ops.tracy_d":"Follows every packet hop by hop. Gets there in the end, with a star or two on the way.",
|
||||
"ops.tracy_route":"Tracy Route",
|
||||
"ops.w_line":"{name} {list}.",
|
||||
"ops.w_money":"Week total: {cost} up front, {mo}/mo.",
|
||||
"ops.w_oops":{"one":"made one small oops","other":"made {n} small oopses"},
|
||||
"ops.w_sales":{"one":"signed a customer ({rev}/mo)","other":"signed {n} customers ({rev}/mo)"},
|
||||
"optic_counts.apply_price":"Apply · {price}",
|
||||
"optic_counts.count_for_model":"Number of {model} channels",
|
||||
"optic_counts.only_n_channels_free":"Only {n} channels are free on this fiber.",
|
||||
|
|
|
|||
|
|
@ -231,13 +231,32 @@ test('the shift runs inside dayTick, respects a stopped clock, batches its work
|
|||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the daily log line is folded into one NOC notification', t => {
|
||||
test('the NOC gets one notice a week, the shift report; the daily lines stay in the Ops sheet', t => {
|
||||
const { ev, errors } = game(t, "S.transit[0].hist=[600]");
|
||||
hire(ev); on(ev, 'transit', { x: 1.5 });
|
||||
ev('S.day=14');
|
||||
hire(ev); on(ev, 'transit', { x: 1.5 }); on(ev, 'sales', { acc: true, min: 5000 });
|
||||
ev('S.transit[0].tier=3;S.pops.fra.rgen=3;compute()');
|
||||
const n0 = ev('S.log.length');
|
||||
shift(ev);
|
||||
assert.equal(ev('S.log.length'), n0 + 1);
|
||||
assert.match(ev('S.log[0].t'), /Kevin's shift Kevin topped up transit/);
|
||||
for (let d = 14; d < 21; d++) {
|
||||
if (d === 15) ev("S.offers=[{id:'tiny',city:'fra',name:'Tiny',type:'dia',bw:1,rate:600,reqs:[],exp:60},{id:'big',city:'fra',name:'Big',type:'dia',bw:10,rate:600,reqs:[],exp:60}]");
|
||||
ev(`S.day=${d}`); shift(ev);
|
||||
}
|
||||
assert.equal(ev('S.log.length'), n0, 'a whole week of shifts: no NOC notice yet');
|
||||
assert.ok(ev('S.ops.log.length') >= 2, 'the Ops sheet has the daily detail');
|
||||
ev('S.day=21'); shift(ev);
|
||||
assert.equal(ev('S.log.length'), n0 + 1, 'one notice for the week');
|
||||
assert.match(ev('S.log[0].t'), /^Kevin's week Kevin signed a customer \(\+\$6\.0k\/mo\), topped up transit .*declined a tiny offer.*Week total: \$[\d.]+k up front, \+\$[\d.]+k\/mo\./);
|
||||
assert.equal(ev('S.log[0].k'), 'good');
|
||||
ev('S.day=22'); shift(ev);
|
||||
assert.equal(ev('S.log.length'), n0 + 1, 'and nothing more until the next week ends');
|
||||
// Only the sales order now: one tiny offer declined on day 23, reported when the week ends.
|
||||
ev("for(const k in S.ops.on)S.ops.on[k]=false;S.ops.on.sales=true;S.offers=[{id:'t2',city:'fra',name:'T2',type:'dia',bw:1,rate:600,reqs:[],exp:60}];S.day=23");shift(ev);
|
||||
ev("S.day=28");shift(ev);
|
||||
assert.equal(ev('S.log.length'), n0 + 2);
|
||||
assert.match(ev('S.log[0].t'), /declined a tiny offer\.$/, 'nothing spent: no money line');
|
||||
assert.equal(ev('S.log[0].k'), '');
|
||||
ev("S.day=35");shift(ev);
|
||||
assert.equal(ev('S.log.length'), n0 + 2, 'an idle week: no notice');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
|
@ -292,6 +311,9 @@ test('saves: old saves load with no intern and everything off, settings survive
|
|||
assert.equal(ev("JSON.stringify(S.ops.skip)"), '{"fra":["transit"]}');
|
||||
assert.equal(ev("JSON.stringify(S.ops.log)"), '[{"d":1,"i":"kevin","r":[["transit",2,["fra +1×100G"]]]}]');
|
||||
assert.equal(ev('S.ops.floor===50000&&S.ops.tpl.bb===true'), true);
|
||||
ev(`S.ops.wk={w:3,i:'kevin',n:{sales:2,evil:9,transit:'x'},wh:{transit:['fra +1×100G','<b>']},up:-5,mo:'a',rev:41000,ff:99};S.ops.rep={i:'mallory'};S=migrate(S)`);
|
||||
assert.equal(ev("JSON.stringify(S.ops.wk)"), '{"w":3,"i":"kevin","n":{"sales":2},"wh":{"transit":["fra +1×100G"]},"up":0,"mo":0,"rev":41000,"ff":7}');
|
||||
assert.equal(ev('S.ops.rep'), null);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
|
@ -503,6 +525,6 @@ test('transit: the log line and budget line show the monthly cost a top-up adds'
|
|||
assert.equal(ev('S.ops.log[0].up'), c0 - cash(ev));
|
||||
assert.equal(ev('S.ops.log[0].mo'), Math.round(mo));
|
||||
assert.equal(ev('Math.round(S.ops.addMo.transit)'), Math.round(mo));
|
||||
assert.match(ev('S.log[0].t'), /Cost: \$[\d.]+k up front, \+\$[\d.]+k?\/mo\./);
|
||||
assert.match(ev('opsEntry(S.ops.log[0])'), /Cost: \$[\d.]+k up front, \+\$[\d.]+k?\/mo\./);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue