NOC notices that would open the NOC get no Open button (#226)
The notice list is the NOC tab, so a target of tab:noc did nothing. #232 gave the shift report a real target; the chaos monkey's arrival still pointed at the NOC, where its own card already is. logSection() now leaves the button off for that target, whatever posts it.
This commit is contained in:
parent
d9f3cede11
commit
dc89369c2a
3 changed files with 14 additions and 1 deletions
|
|
@ -107,3 +107,14 @@ test('"Met the Chaos Monkey" comes from a visit, not from an ordinary fiber cut'
|
|||
assert.equal(ev("BADGES.find(b=>b.id==='backhoe').t"), 'Met the Chaos Monkey');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('#226 the monkey\'s notice in the NOC has no Open button that would open the NOC again', () => {
|
||||
const { ev, errors } = net('oncall');
|
||||
ev('mkArrive(S.day);ACT.leftTab({t:"noc"})');
|
||||
const row = ev(`(()=>{const e=S.log.find(x=>x.o&&x.o.a==='tab'&&x.o.v==='noc');if(!e)return 'none';const r=[...document.querySelectorAll('#left .row.note')].find(n=>n.textContent.includes(e.t.slice(0,20)));return r?(r.querySelector('[data-act=logOpen]')?'button':'no button'):'not shown'})()`);
|
||||
assert.equal(row, 'no button');
|
||||
// a notice that opens something else keeps its button
|
||||
ev("toast('A test notice','',[],{a:'bank'});ACT.leftTab({t:'noc'})");
|
||||
assert.equal(ev(`!![...document.querySelectorAll('#left .row.note')].find(n=>n.textContent.includes('A test notice')).querySelector('[data-act=logOpen]')`), true);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue