The intern's shift report opens the Standing orders sheet (#226)

Its NOC notification pointed at the NOC tab, where the notification already
is, so Open did nothing. It now opens the Ops sheet, which holds the report.
This commit is contained in:
Frederic Jung 2026-10-31 01:44:46 +00:00
parent 2d7aff4956
commit 198c636442
No known key found for this signature in database
6 changed files with 21 additions and 4 deletions

View file

@ -562,3 +562,19 @@ test('transit: the log line and budget line show the monthly cost a top-up adds'
assert.match(ev('opsEntry(S.ops.log[0])'), /Cost: \$[\d.]+k up front, \+\$[\d.]+k?\/mo\./);
assert.deepEqual(errors, []);
});
test('#226 the shift report\'s Open button in the NOC opens the Ops sheet, and survives a reload', t => {
const { ev, errors, dom } = game(t);
ev('S.day=14'); hire(ev); on(ev, 'sales', { acc: false, min: 5000 });
ev("S.offers=[{id:'t',city:'fra',name:'T',type:'dia',bw:1,rate:600,reqs:[],exp:60}];S.day=15"); shift(ev);
ev('S.day=21'); shift(ev);
assert.match(ev('S.log[0].t'), /^Kevin's week/);
ev("S=migrate(JSON.parse(JSON.stringify(S)));closeModal();ACT.leftTab({t:'noc'})");
const doc = dom.window.document;
const b = doc.querySelector(`#leftBody [data-act=logOpen][data-args='${JSON.stringify({ id: ev('S.log[0].id') })}']`);
assert.ok(b, 'the report has an Open button');
b.click();
assert.equal(doc.getElementById('modal').hidden, false, 'a sheet opened');
assert.ok(doc.querySelector('#modalCard .ops-rep'), 'and it is the Ops sheet with the report');
assert.deepEqual(errors, []);
});